Coverage Report

Created: 2018-09-25 14:53

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