/work/obj-fuzz/dist/include/mozilla/dom/IntlUtilsBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM IntlUtils.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_IntlUtilsBinding_h |
4 | | #define mozilla_dom_IntlUtilsBinding_h |
5 | | |
6 | | #include "GeckoProfiler.h" |
7 | | #include "js/RootingAPI.h" |
8 | | #include "jspubtd.h" |
9 | | #include "mozilla/ErrorResult.h" |
10 | | #include "mozilla/dom/BindingDeclarations.h" |
11 | | #include "mozilla/dom/Nullable.h" |
12 | | #include "mozilla/dom/PrototypeList.h" |
13 | | #include "mozilla/dom/Record.h" |
14 | | |
15 | | namespace mozilla { |
16 | | namespace dom { |
17 | | |
18 | | struct DisplayNameOptionsAtoms; |
19 | | struct DisplayNameResultAtoms; |
20 | | class IntlUtils; |
21 | | struct IntlUtilsAtoms; |
22 | | struct LocaleInfoAtoms; |
23 | | struct NativePropertyHooks; |
24 | | class ProtoAndIfaceCache; |
25 | | |
26 | | } // namespace dom |
27 | | } // namespace mozilla |
28 | | |
29 | | namespace mozilla { |
30 | | namespace dom { |
31 | | |
32 | | struct DisplayNameOptions : public DictionaryBase |
33 | | { |
34 | | MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mKeys; |
35 | | MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mStyle; |
36 | | |
37 | | DisplayNameOptions(); |
38 | | |
39 | | explicit inline DisplayNameOptions(const FastDictionaryInitializer& ) |
40 | 0 | { |
41 | 0 | // Do nothing here; this is used by our "Fast" subclass |
42 | 0 | } |
43 | | |
44 | | explicit inline DisplayNameOptions(const DisplayNameOptions& aOther) |
45 | 0 | { |
46 | 0 | *this = aOther; |
47 | 0 | } |
48 | | |
49 | | bool |
50 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
51 | | |
52 | | bool |
53 | | Init(const nsAString& aJSON); |
54 | | |
55 | | bool |
56 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
57 | | |
58 | | bool |
59 | | ToJSON(nsAString& aJSON) const; |
60 | | |
61 | | void |
62 | | TraceDictionary(JSTracer* trc); |
63 | | |
64 | | DisplayNameOptions& |
65 | | operator=(const DisplayNameOptions& aOther); |
66 | | |
67 | | private: |
68 | | static bool |
69 | | InitIds(JSContext* cx, DisplayNameOptionsAtoms* atomsCache); |
70 | | }; |
71 | | |
72 | | namespace binding_detail { |
73 | | struct FastDisplayNameOptions : public DisplayNameOptions |
74 | | { |
75 | | inline FastDisplayNameOptions() |
76 | | : DisplayNameOptions(FastDictionaryInitializer()) |
77 | 0 | { |
78 | 0 | // Doesn't matter what int we pass to the parent constructor |
79 | 0 | } |
80 | | }; |
81 | | } // namespace binding_detail |
82 | | |
83 | | |
84 | | struct DisplayNameResult : public DictionaryBase |
85 | | { |
86 | | MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mLocale; |
87 | | MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mStyle; |
88 | | MOZ_INIT_OUTSIDE_CTOR Optional<Record<nsString, nsString>> mValues; |
89 | | |
90 | | DisplayNameResult(); |
91 | | |
92 | | explicit inline DisplayNameResult(const FastDictionaryInitializer& ) |
93 | 0 | { |
94 | 0 | // Do nothing here; this is used by our "Fast" subclass |
95 | 0 | } |
96 | | |
97 | | private: |
98 | | DisplayNameResult(const DisplayNameResult&) = delete; |
99 | | DisplayNameResult& operator=(const DisplayNameResult&) = delete; |
100 | | |
101 | | static bool |
102 | | InitIds(JSContext* cx, DisplayNameResultAtoms* atomsCache); |
103 | | |
104 | | public: |
105 | | bool |
106 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
107 | | |
108 | | bool |
109 | | Init(const nsAString& aJSON); |
110 | | |
111 | | bool |
112 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
113 | | |
114 | | bool |
115 | | ToJSON(nsAString& aJSON) const; |
116 | | |
117 | | void |
118 | | TraceDictionary(JSTracer* trc); |
119 | | }; |
120 | | |
121 | | namespace binding_detail { |
122 | | struct FastDisplayNameResult : public DisplayNameResult |
123 | | { |
124 | | inline FastDisplayNameResult() |
125 | | : DisplayNameResult(FastDictionaryInitializer()) |
126 | 0 | { |
127 | 0 | // Doesn't matter what int we pass to the parent constructor |
128 | 0 | } |
129 | | }; |
130 | | } // namespace binding_detail |
131 | | |
132 | | |
133 | | struct LocaleInfo : public DictionaryBase |
134 | | { |
135 | | MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mDirection; |
136 | | MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mLocale; |
137 | | |
138 | | LocaleInfo(); |
139 | | |
140 | | explicit inline LocaleInfo(const FastDictionaryInitializer& ) |
141 | 0 | { |
142 | 0 | // Do nothing here; this is used by our "Fast" subclass |
143 | 0 | } |
144 | | |
145 | | explicit inline LocaleInfo(const LocaleInfo& aOther) |
146 | 0 | { |
147 | 0 | *this = aOther; |
148 | 0 | } |
149 | | |
150 | | bool |
151 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
152 | | |
153 | | bool |
154 | | Init(const nsAString& aJSON); |
155 | | |
156 | | bool |
157 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
158 | | |
159 | | bool |
160 | | ToJSON(nsAString& aJSON) const; |
161 | | |
162 | | void |
163 | | TraceDictionary(JSTracer* trc); |
164 | | |
165 | | LocaleInfo& |
166 | | operator=(const LocaleInfo& aOther); |
167 | | |
168 | | private: |
169 | | static bool |
170 | | InitIds(JSContext* cx, LocaleInfoAtoms* atomsCache); |
171 | | }; |
172 | | |
173 | | namespace binding_detail { |
174 | | struct FastLocaleInfo : public LocaleInfo |
175 | | { |
176 | | inline FastLocaleInfo() |
177 | | : LocaleInfo(FastDictionaryInitializer()) |
178 | 0 | { |
179 | 0 | // Doesn't matter what int we pass to the parent constructor |
180 | 0 | } |
181 | | }; |
182 | | } // namespace binding_detail |
183 | | |
184 | | |
185 | | namespace IntlUtils_Binding { |
186 | | |
187 | | typedef mozilla::dom::IntlUtils NativeType; |
188 | | |
189 | | const JSClass* |
190 | | GetJSClass(); |
191 | | |
192 | | bool |
193 | | Wrap(JSContext* aCx, mozilla::dom::IntlUtils* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
194 | | |
195 | | template <class T> |
196 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
197 | 0 | { |
198 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
199 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
200 | 0 | } |
201 | | |
202 | | // We declare this as an array so that retrieving a pointer to this |
203 | | // binding's property hooks only requires compile/link-time resolvable |
204 | | // address arithmetic. Declaring it as a pointer instead would require |
205 | | // doing a run-time load to fetch a pointer to this binding's property |
206 | | // hooks. And then structures which embedded a pointer to this structure |
207 | | // would require a run-time load for proper initialization, which would |
208 | | // then induce static constructors. Lots of static constructors. |
209 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
210 | | |
211 | | void |
212 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
213 | | |
214 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
215 | 0 | { |
216 | 0 | /* Get the interface prototype object for this class. This will create the |
217 | 0 | object as needed. */ |
218 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::IntlUtils, |
219 | 0 | &CreateInterfaceObjects, |
220 | 0 | /* aDefineOnGlobal = */ true); |
221 | 0 |
|
222 | 0 | } |
223 | | |
224 | | } // namespace IntlUtils_Binding |
225 | | |
226 | | |
227 | | |
228 | | } // namespace dom |
229 | | } // namespace mozilla |
230 | | |
231 | | #endif // mozilla_dom_IntlUtilsBinding_h |