/work/obj-fuzz/dist/include/mozilla/dom/DeviceMotionEventBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM DeviceMotionEvent.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_DeviceMotionEventBinding_h |
4 | | #define mozilla_dom_DeviceMotionEventBinding_h |
5 | | |
6 | | #include "EventBinding.h" |
7 | | #include "GeckoProfiler.h" |
8 | | #include "js/RootingAPI.h" |
9 | | #include "jspubtd.h" |
10 | | #include "mozilla/ErrorResult.h" |
11 | | #include "mozilla/dom/BindingDeclarations.h" |
12 | | #include "mozilla/dom/Nullable.h" |
13 | | #include "mozilla/dom/PrototypeList.h" |
14 | | |
15 | | namespace mozilla { |
16 | | namespace dom { |
17 | | |
18 | | class DeviceAcceleration; |
19 | | struct DeviceAccelerationAtoms; |
20 | | struct DeviceAccelerationInit; |
21 | | struct DeviceAccelerationInitAtoms; |
22 | | class DeviceMotionEvent; |
23 | | struct DeviceMotionEventAtoms; |
24 | | struct DeviceMotionEventInitAtoms; |
25 | | class DeviceRotationRate; |
26 | | struct DeviceRotationRateAtoms; |
27 | | struct DeviceRotationRateInit; |
28 | | struct DeviceRotationRateInitAtoms; |
29 | | struct NativePropertyHooks; |
30 | | class ProtoAndIfaceCache; |
31 | | |
32 | | } // namespace dom |
33 | | } // namespace mozilla |
34 | | |
35 | | namespace mozilla { |
36 | | namespace dom { |
37 | | |
38 | | struct DeviceAccelerationInit : public DictionaryBase |
39 | | { |
40 | | MOZ_INIT_OUTSIDE_CTOR Nullable<double> mX; |
41 | | MOZ_INIT_OUTSIDE_CTOR Nullable<double> mY; |
42 | | MOZ_INIT_OUTSIDE_CTOR Nullable<double> mZ; |
43 | | |
44 | | DeviceAccelerationInit(); |
45 | | |
46 | | explicit inline DeviceAccelerationInit(const FastDictionaryInitializer& ) |
47 | 0 | { |
48 | 0 | // Do nothing here; this is used by our "Fast" subclass |
49 | 0 | } |
50 | | |
51 | | explicit inline DeviceAccelerationInit(const DeviceAccelerationInit& aOther) |
52 | 0 | { |
53 | 0 | *this = aOther; |
54 | 0 | } |
55 | | |
56 | | bool |
57 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
58 | | |
59 | | bool |
60 | | Init(const nsAString& aJSON); |
61 | | |
62 | | bool |
63 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
64 | | |
65 | | bool |
66 | | ToJSON(nsAString& aJSON) const; |
67 | | |
68 | | void |
69 | | TraceDictionary(JSTracer* trc); |
70 | | |
71 | | DeviceAccelerationInit& |
72 | | operator=(const DeviceAccelerationInit& aOther); |
73 | | |
74 | | private: |
75 | | static bool |
76 | | InitIds(JSContext* cx, DeviceAccelerationInitAtoms* atomsCache); |
77 | | }; |
78 | | |
79 | | namespace binding_detail { |
80 | | struct FastDeviceAccelerationInit : public DeviceAccelerationInit |
81 | | { |
82 | | inline FastDeviceAccelerationInit() |
83 | | : DeviceAccelerationInit(FastDictionaryInitializer()) |
84 | 0 | { |
85 | 0 | // Doesn't matter what int we pass to the parent constructor |
86 | 0 | } |
87 | | }; |
88 | | } // namespace binding_detail |
89 | | |
90 | | |
91 | | struct DeviceRotationRateInit : public DictionaryBase |
92 | | { |
93 | | MOZ_INIT_OUTSIDE_CTOR Nullable<double> mAlpha; |
94 | | MOZ_INIT_OUTSIDE_CTOR Nullable<double> mBeta; |
95 | | MOZ_INIT_OUTSIDE_CTOR Nullable<double> mGamma; |
96 | | |
97 | | DeviceRotationRateInit(); |
98 | | |
99 | | explicit inline DeviceRotationRateInit(const FastDictionaryInitializer& ) |
100 | 0 | { |
101 | 0 | // Do nothing here; this is used by our "Fast" subclass |
102 | 0 | } |
103 | | |
104 | | explicit inline DeviceRotationRateInit(const DeviceRotationRateInit& aOther) |
105 | 0 | { |
106 | 0 | *this = aOther; |
107 | 0 | } |
108 | | |
109 | | bool |
110 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
111 | | |
112 | | bool |
113 | | Init(const nsAString& aJSON); |
114 | | |
115 | | bool |
116 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
117 | | |
118 | | bool |
119 | | ToJSON(nsAString& aJSON) const; |
120 | | |
121 | | void |
122 | | TraceDictionary(JSTracer* trc); |
123 | | |
124 | | DeviceRotationRateInit& |
125 | | operator=(const DeviceRotationRateInit& aOther); |
126 | | |
127 | | private: |
128 | | static bool |
129 | | InitIds(JSContext* cx, DeviceRotationRateInitAtoms* atomsCache); |
130 | | }; |
131 | | |
132 | | namespace binding_detail { |
133 | | struct FastDeviceRotationRateInit : public DeviceRotationRateInit |
134 | | { |
135 | | inline FastDeviceRotationRateInit() |
136 | | : DeviceRotationRateInit(FastDictionaryInitializer()) |
137 | 0 | { |
138 | 0 | // Doesn't matter what int we pass to the parent constructor |
139 | 0 | } |
140 | | }; |
141 | | } // namespace binding_detail |
142 | | |
143 | | |
144 | | struct DeviceMotionEventInit : public EventInit |
145 | | { |
146 | | MOZ_INIT_OUTSIDE_CTOR DeviceAccelerationInit mAcceleration; |
147 | | MOZ_INIT_OUTSIDE_CTOR DeviceAccelerationInit mAccelerationIncludingGravity; |
148 | | MOZ_INIT_OUTSIDE_CTOR Nullable<double> mInterval; |
149 | | MOZ_INIT_OUTSIDE_CTOR DeviceRotationRateInit mRotationRate; |
150 | | |
151 | | DeviceMotionEventInit(); |
152 | | |
153 | | explicit inline DeviceMotionEventInit(const FastDictionaryInitializer& ) |
154 | | : EventInit(FastDictionaryInitializer()), |
155 | | mAcceleration(FastDictionaryInitializer()), |
156 | | mAccelerationIncludingGravity(FastDictionaryInitializer()), |
157 | | mRotationRate(FastDictionaryInitializer()) |
158 | 0 | { |
159 | 0 | // Do nothing here; this is used by our "Fast" subclass |
160 | 0 | } |
161 | | |
162 | | explicit inline DeviceMotionEventInit(const DeviceMotionEventInit& aOther) |
163 | | : mAcceleration(FastDictionaryInitializer()), |
164 | | mAccelerationIncludingGravity(FastDictionaryInitializer()), |
165 | | mRotationRate(FastDictionaryInitializer()) |
166 | 0 | { |
167 | 0 | *this = aOther; |
168 | 0 | } |
169 | | |
170 | | bool |
171 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
172 | | |
173 | | bool |
174 | | Init(const nsAString& aJSON); |
175 | | |
176 | | bool |
177 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
178 | | |
179 | | bool |
180 | | ToJSON(nsAString& aJSON) const; |
181 | | |
182 | | void |
183 | | TraceDictionary(JSTracer* trc); |
184 | | |
185 | | DeviceMotionEventInit& |
186 | | operator=(const DeviceMotionEventInit& aOther); |
187 | | |
188 | | private: |
189 | | static bool |
190 | | InitIds(JSContext* cx, DeviceMotionEventInitAtoms* atomsCache); |
191 | | }; |
192 | | |
193 | | namespace binding_detail { |
194 | | struct FastDeviceMotionEventInit : public DeviceMotionEventInit |
195 | | { |
196 | | inline FastDeviceMotionEventInit() |
197 | | : DeviceMotionEventInit(FastDictionaryInitializer()) |
198 | 0 | { |
199 | 0 | // Doesn't matter what int we pass to the parent constructor |
200 | 0 | } |
201 | | }; |
202 | | } // namespace binding_detail |
203 | | |
204 | | |
205 | | namespace DeviceAcceleration_Binding { |
206 | | |
207 | | typedef mozilla::dom::DeviceAcceleration NativeType; |
208 | | |
209 | | const JSClass* |
210 | | GetJSClass(); |
211 | | |
212 | | bool |
213 | | Wrap(JSContext* aCx, mozilla::dom::DeviceAcceleration* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
214 | | |
215 | | template <class T> |
216 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
217 | 0 | { |
218 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
219 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
220 | 0 | } |
221 | | |
222 | | // We declare this as an array so that retrieving a pointer to this |
223 | | // binding's property hooks only requires compile/link-time resolvable |
224 | | // address arithmetic. Declaring it as a pointer instead would require |
225 | | // doing a run-time load to fetch a pointer to this binding's property |
226 | | // hooks. And then structures which embedded a pointer to this structure |
227 | | // would require a run-time load for proper initialization, which would |
228 | | // then induce static constructors. Lots of static constructors. |
229 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
230 | | |
231 | | void |
232 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
233 | | |
234 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
235 | 0 | { |
236 | 0 | /* Get the interface prototype object for this class. This will create the |
237 | 0 | object as needed. */ |
238 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::DeviceAcceleration, |
239 | 0 | &CreateInterfaceObjects, |
240 | 0 | /* aDefineOnGlobal = */ true); |
241 | 0 |
|
242 | 0 | } |
243 | | |
244 | | } // namespace DeviceAcceleration_Binding |
245 | | |
246 | | |
247 | | |
248 | | namespace DeviceMotionEvent_Binding { |
249 | | |
250 | | typedef mozilla::dom::DeviceMotionEvent NativeType; |
251 | | |
252 | | bool |
253 | | ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj); |
254 | | |
255 | | const JSClass* |
256 | | GetJSClass(); |
257 | | |
258 | | bool |
259 | | Wrap(JSContext* aCx, mozilla::dom::DeviceMotionEvent* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
260 | | |
261 | | template <class T> |
262 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
263 | 0 | { |
264 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
265 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
266 | 0 | } |
267 | | |
268 | | // We declare this as an array so that retrieving a pointer to this |
269 | | // binding's property hooks only requires compile/link-time resolvable |
270 | | // address arithmetic. Declaring it as a pointer instead would require |
271 | | // doing a run-time load to fetch a pointer to this binding's property |
272 | | // hooks. And then structures which embedded a pointer to this structure |
273 | | // would require a run-time load for proper initialization, which would |
274 | | // then induce static constructors. Lots of static constructors. |
275 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
276 | | |
277 | | void |
278 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
279 | | |
280 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
281 | 0 | { |
282 | 0 | /* Get the interface prototype object for this class. This will create the |
283 | 0 | object as needed. */ |
284 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::DeviceMotionEvent, |
285 | 0 | &CreateInterfaceObjects, |
286 | 0 | /* aDefineOnGlobal = */ true); |
287 | 0 |
|
288 | 0 | } |
289 | | |
290 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
291 | 0 | { |
292 | 0 | /* Get the interface object for this class. This will create the object as |
293 | 0 | needed. */ |
294 | 0 |
|
295 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::DeviceMotionEvent, |
296 | 0 | &CreateInterfaceObjects, |
297 | 0 | aDefineOnGlobal); |
298 | 0 | } |
299 | | |
300 | | JSObject* |
301 | | GetConstructorObject(JSContext* aCx); |
302 | | |
303 | | } // namespace DeviceMotionEvent_Binding |
304 | | |
305 | | |
306 | | |
307 | | namespace DeviceRotationRate_Binding { |
308 | | |
309 | | typedef mozilla::dom::DeviceRotationRate NativeType; |
310 | | |
311 | | const JSClass* |
312 | | GetJSClass(); |
313 | | |
314 | | bool |
315 | | Wrap(JSContext* aCx, mozilla::dom::DeviceRotationRate* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
316 | | |
317 | | template <class T> |
318 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
319 | 0 | { |
320 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
321 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
322 | 0 | } |
323 | | |
324 | | // We declare this as an array so that retrieving a pointer to this |
325 | | // binding's property hooks only requires compile/link-time resolvable |
326 | | // address arithmetic. Declaring it as a pointer instead would require |
327 | | // doing a run-time load to fetch a pointer to this binding's property |
328 | | // hooks. And then structures which embedded a pointer to this structure |
329 | | // would require a run-time load for proper initialization, which would |
330 | | // then induce static constructors. Lots of static constructors. |
331 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
332 | | |
333 | | void |
334 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
335 | | |
336 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
337 | 0 | { |
338 | 0 | /* Get the interface prototype object for this class. This will create the |
339 | 0 | object as needed. */ |
340 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::DeviceRotationRate, |
341 | 0 | &CreateInterfaceObjects, |
342 | 0 | /* aDefineOnGlobal = */ true); |
343 | 0 |
|
344 | 0 | } |
345 | | |
346 | | } // namespace DeviceRotationRate_Binding |
347 | | |
348 | | |
349 | | |
350 | | } // namespace dom |
351 | | } // namespace mozilla |
352 | | |
353 | | #endif // mozilla_dom_DeviceMotionEventBinding_h |