Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM WebrtcDeprecated.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_WebrtcDeprecatedBinding_h
4 : #define mozilla_dom_WebrtcDeprecatedBinding_h
5 :
6 : #include "RTCIceCandidateBinding.h"
7 : #include "RTCPeerConnectionBinding.h"
8 : #include "RTCSessionDescriptionBinding.h"
9 : #include "js/RootingAPI.h"
10 : #include "jspubtd.h"
11 : #include "mozilla/ErrorResult.h"
12 : #include "mozilla/dom/BindingDeclarations.h"
13 : #include "mozilla/dom/CallbackInterface.h"
14 : #include "mozilla/dom/Nullable.h"
15 : #include "mozilla/dom/ToJSValue.h"
16 : #include "nsWeakReference.h"
17 :
18 : namespace mozilla {
19 : namespace dom {
20 :
21 : struct NativePropertyHooks;
22 : class ProtoAndIfaceCache;
23 : struct RTCConfiguration;
24 : struct RTCIceCandidateInit;
25 : struct RTCSessionDescriptionInit;
26 : class mozRTCIceCandidate;
27 : struct mozRTCIceCandidateAtoms;
28 : class mozRTCPeerConnection;
29 : struct mozRTCPeerConnectionAtoms;
30 : class mozRTCSessionDescription;
31 : struct mozRTCSessionDescriptionAtoms;
32 :
33 : } // namespace dom
34 : } // namespace mozilla
35 :
36 : namespace mozilla {
37 : namespace dom {
38 :
39 : namespace mozRTCIceCandidateBinding {
40 :
41 : typedef mozilla::dom::mozRTCIceCandidate NativeType;
42 :
43 : bool
44 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
45 :
46 : JSObject*
47 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
48 :
49 : const JSClass*
50 : GetJSClass();
51 :
52 : bool
53 : Wrap(JSContext* aCx, mozilla::dom::mozRTCIceCandidate* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
54 :
55 : template <class T>
56 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
57 : {
58 0 : JS::Rooted<JSObject*> reflector(aCx);
59 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
60 : }
61 :
62 : // We declare this as an array so that retrieving a pointer to this
63 : // binding's property hooks only requires compile/link-time resolvable
64 : // address arithmetic. Declaring it as a pointer instead would require
65 : // doing a run-time load to fetch a pointer to this binding's property
66 : // hooks. And then structures which embedded a pointer to this structure
67 : // would require a run-time load for proper initialization, which would
68 : // then induce static constructors. Lots of static constructors.
69 : extern const NativePropertyHooks sNativePropertyHooks[];
70 :
71 : void
72 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
73 :
74 : JS::Handle<JSObject*>
75 : GetProtoObjectHandle(JSContext* aCx);
76 :
77 : JS::Handle<JSObject*>
78 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
79 :
80 : JSObject*
81 : GetConstructorObject(JSContext* aCx);
82 :
83 : } // namespace mozRTCIceCandidateBinding
84 :
85 :
86 :
87 : namespace mozRTCPeerConnectionBinding {
88 :
89 : typedef mozilla::dom::mozRTCPeerConnection NativeType;
90 :
91 : bool
92 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
93 :
94 : JSObject*
95 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
96 :
97 : const JSClass*
98 : GetJSClass();
99 :
100 : bool
101 : Wrap(JSContext* aCx, mozilla::dom::mozRTCPeerConnection* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
102 :
103 : template <class T>
104 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
105 : {
106 0 : JS::Rooted<JSObject*> reflector(aCx);
107 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
108 : }
109 :
110 : // We declare this as an array so that retrieving a pointer to this
111 : // binding's property hooks only requires compile/link-time resolvable
112 : // address arithmetic. Declaring it as a pointer instead would require
113 : // doing a run-time load to fetch a pointer to this binding's property
114 : // hooks. And then structures which embedded a pointer to this structure
115 : // would require a run-time load for proper initialization, which would
116 : // then induce static constructors. Lots of static constructors.
117 : extern const NativePropertyHooks sNativePropertyHooks[];
118 :
119 : void
120 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
121 :
122 : JS::Handle<JSObject*>
123 : GetProtoObjectHandle(JSContext* aCx);
124 :
125 : JS::Handle<JSObject*>
126 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
127 :
128 : JSObject*
129 : GetConstructorObject(JSContext* aCx);
130 :
131 : } // namespace mozRTCPeerConnectionBinding
132 :
133 :
134 :
135 : namespace mozRTCSessionDescriptionBinding {
136 :
137 : typedef mozilla::dom::mozRTCSessionDescription NativeType;
138 :
139 : bool
140 : ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
141 :
142 : JSObject*
143 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
144 :
145 : const JSClass*
146 : GetJSClass();
147 :
148 : bool
149 : Wrap(JSContext* aCx, mozilla::dom::mozRTCSessionDescription* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
150 :
151 : template <class T>
152 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
153 : {
154 0 : JS::Rooted<JSObject*> reflector(aCx);
155 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
156 : }
157 :
158 : // We declare this as an array so that retrieving a pointer to this
159 : // binding's property hooks only requires compile/link-time resolvable
160 : // address arithmetic. Declaring it as a pointer instead would require
161 : // doing a run-time load to fetch a pointer to this binding's property
162 : // hooks. And then structures which embedded a pointer to this structure
163 : // would require a run-time load for proper initialization, which would
164 : // then induce static constructors. Lots of static constructors.
165 : extern const NativePropertyHooks sNativePropertyHooks[];
166 :
167 : void
168 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
169 :
170 : JS::Handle<JSObject*>
171 : GetProtoObjectHandle(JSContext* aCx);
172 :
173 : JS::Handle<JSObject*>
174 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
175 :
176 : JSObject*
177 : GetConstructorObject(JSContext* aCx);
178 :
179 : } // namespace mozRTCSessionDescriptionBinding
180 :
181 :
182 :
183 0 : class mozRTCIceCandidateJSImpl : public CallbackInterface
184 : {
185 : public:
186 0 : explicit inline mozRTCIceCandidateJSImpl(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal)
187 0 : : CallbackInterface(aCx, aCallback, aIncumbentGlobal)
188 : {
189 0 : }
190 :
191 : explicit inline mozRTCIceCandidateJSImpl(JS::Handle<JSObject*> aCallback, const FastCallbackConstructor& )
192 : : CallbackInterface(aCallback, FastCallbackConstructor())
193 : {
194 : }
195 :
196 : explicit inline mozRTCIceCandidateJSImpl(JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
197 : : CallbackInterface(aCallback, aAsyncStack, aIncumbentGlobal)
198 : {
199 : }
200 :
201 : void __Init(const RTCIceCandidateInit& candidateInitDict, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
202 :
203 : inline bool
204 : operator==(const mozRTCIceCandidateJSImpl& aOther) const
205 : {
206 : return CallbackInterface::operator==(aOther);
207 : }
208 :
209 : private:
210 : static bool
211 : InitIds(JSContext* cx, mozRTCIceCandidateAtoms* atomsCache);
212 : };
213 :
214 :
215 : class mozRTCIceCandidate final : public mozilla::dom::RTCIceCandidate
216 : {
217 : public:
218 : NS_DECL_ISUPPORTS_INHERITED
219 0 : NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(mozRTCIceCandidate, mozilla::dom::RTCIceCandidate)
220 :
221 : private:
222 : RefPtr<mozRTCIceCandidateJSImpl> mImpl;
223 : nsCOMPtr<nsISupports> mParent;
224 :
225 : public:
226 : mozRTCIceCandidate(JS::Handle<JSObject*> aJSImplObject, nsIGlobalObject* aParent);
227 :
228 : private:
229 : ~mozRTCIceCandidate();
230 :
231 : public:
232 : nsISupports* GetParentObject() const;
233 :
234 : virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
235 :
236 : static already_AddRefed<mozRTCIceCandidate> Constructor(const GlobalObject& global, JSContext* cx, const RTCIceCandidateInit& candidateInitDict, ErrorResult& aRv);
237 :
238 : static bool
239 : _Create(JSContext* cx, unsigned argc, JS::Value* vp);
240 : };
241 :
242 :
243 0 : class mozRTCPeerConnectionJSImpl : public CallbackInterface
244 : {
245 : public:
246 0 : explicit inline mozRTCPeerConnectionJSImpl(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal)
247 0 : : CallbackInterface(aCx, aCallback, aIncumbentGlobal)
248 : {
249 0 : }
250 :
251 : explicit inline mozRTCPeerConnectionJSImpl(JS::Handle<JSObject*> aCallback, const FastCallbackConstructor& )
252 : : CallbackInterface(aCallback, FastCallbackConstructor())
253 : {
254 : }
255 :
256 : explicit inline mozRTCPeerConnectionJSImpl(JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
257 : : CallbackInterface(aCallback, aAsyncStack, aIncumbentGlobal)
258 : {
259 : }
260 :
261 : void __Init(const RTCConfiguration& configuration, const Optional<JS::Handle<JSObject*>>& constraints, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
262 :
263 : inline bool
264 : operator==(const mozRTCPeerConnectionJSImpl& aOther) const
265 : {
266 : return CallbackInterface::operator==(aOther);
267 : }
268 :
269 : private:
270 : static bool
271 : InitIds(JSContext* cx, mozRTCPeerConnectionAtoms* atomsCache);
272 : };
273 :
274 :
275 : class mozRTCPeerConnection final : public mozilla::dom::RTCPeerConnection
276 : {
277 : public:
278 : NS_DECL_ISUPPORTS_INHERITED
279 0 : NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(mozRTCPeerConnection, mozilla::dom::RTCPeerConnection)
280 :
281 : private:
282 : RefPtr<mozRTCPeerConnectionJSImpl> mImpl;
283 : nsCOMPtr<nsISupports> mParent;
284 :
285 : public:
286 : mozRTCPeerConnection(JS::Handle<JSObject*> aJSImplObject, nsIGlobalObject* aParent);
287 :
288 : private:
289 : ~mozRTCPeerConnection();
290 :
291 : public:
292 : nsISupports* GetParentObject() const;
293 :
294 : virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
295 :
296 : static already_AddRefed<mozRTCPeerConnection> Constructor(const GlobalObject& global, JSContext* cx, const RTCConfiguration& configuration, const Optional<JS::Handle<JSObject*>>& constraints, ErrorResult& aRv);
297 :
298 : static bool
299 : _Create(JSContext* cx, unsigned argc, JS::Value* vp);
300 : };
301 :
302 :
303 0 : class mozRTCSessionDescriptionJSImpl : public CallbackInterface
304 : {
305 : public:
306 0 : explicit inline mozRTCSessionDescriptionJSImpl(JSContext* aCx, JS::Handle<JSObject*> aCallback, nsIGlobalObject* aIncumbentGlobal)
307 0 : : CallbackInterface(aCx, aCallback, aIncumbentGlobal)
308 : {
309 0 : }
310 :
311 : explicit inline mozRTCSessionDescriptionJSImpl(JS::Handle<JSObject*> aCallback, const FastCallbackConstructor& )
312 : : CallbackInterface(aCallback, FastCallbackConstructor())
313 : {
314 : }
315 :
316 : explicit inline mozRTCSessionDescriptionJSImpl(JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
317 : : CallbackInterface(aCallback, aAsyncStack, aIncumbentGlobal)
318 : {
319 : }
320 :
321 : void __Init(const RTCSessionDescriptionInit& descriptionInitDict, ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
322 :
323 : inline bool
324 : operator==(const mozRTCSessionDescriptionJSImpl& aOther) const
325 : {
326 : return CallbackInterface::operator==(aOther);
327 : }
328 :
329 : private:
330 : static bool
331 : InitIds(JSContext* cx, mozRTCSessionDescriptionAtoms* atomsCache);
332 : };
333 :
334 :
335 : class mozRTCSessionDescription final : public mozilla::dom::RTCSessionDescription
336 : {
337 : public:
338 : NS_DECL_ISUPPORTS_INHERITED
339 0 : NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(mozRTCSessionDescription, mozilla::dom::RTCSessionDescription)
340 :
341 : private:
342 : RefPtr<mozRTCSessionDescriptionJSImpl> mImpl;
343 : nsCOMPtr<nsISupports> mParent;
344 :
345 : public:
346 : mozRTCSessionDescription(JS::Handle<JSObject*> aJSImplObject, nsIGlobalObject* aParent);
347 :
348 : private:
349 : ~mozRTCSessionDescription();
350 :
351 : public:
352 : nsISupports* GetParentObject() const;
353 :
354 : virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
355 :
356 : static already_AddRefed<mozRTCSessionDescription> Constructor(const GlobalObject& global, JSContext* cx, const RTCSessionDescriptionInit& descriptionInitDict, ErrorResult& aRv);
357 :
358 : static bool
359 : _Create(JSContext* cx, unsigned argc, JS::Value* vp);
360 : };
361 :
362 :
363 : } // namespace dom
364 : } // namespace mozilla
365 :
366 : #endif // mozilla_dom_WebrtcDeprecatedBinding_h
|