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