Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/RTCDataChannelBinding.h
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM RTCDataChannel.webidl BY Codegen.py - DO NOT EDIT */
2
3
#ifndef mozilla_dom_RTCDataChannelBinding_h
4
#define mozilla_dom_RTCDataChannelBinding_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
class nsDOMDataChannel;
15
struct nsDOMDataChannelAtoms;
16
17
namespace mozilla {
18
namespace dom {
19
20
struct NativePropertyHooks;
21
class ProtoAndIfaceCache;
22
23
} // namespace dom
24
} // namespace mozilla
25
26
namespace mozilla {
27
namespace dom {
28
29
enum class RTCDataChannelState : uint8_t {
30
  Connecting,
31
  Open,
32
  Closing,
33
  Closed,
34
  EndGuard_
35
};
36
37
namespace RTCDataChannelStateValues {
38
extern const EnumEntry strings[5];
39
} // namespace RTCDataChannelStateValues
40
41
bool
42
ToJSValue(JSContext* aCx, RTCDataChannelState aArgument, JS::MutableHandle<JS::Value> aValue);
43
44
45
enum class RTCDataChannelType : uint8_t {
46
  Arraybuffer,
47
  Blob,
48
  EndGuard_
49
};
50
51
namespace RTCDataChannelTypeValues {
52
extern const EnumEntry strings[3];
53
} // namespace RTCDataChannelTypeValues
54
55
bool
56
ToJSValue(JSContext* aCx, RTCDataChannelType aArgument, JS::MutableHandle<JS::Value> aValue);
57
58
59
namespace RTCDataChannel_Binding {
60
61
  typedef nsDOMDataChannel NativeType;
62
63
  const JSClass*
64
  GetJSClass();
65
66
  bool
67
  Wrap(JSContext* aCx, nsDOMDataChannel* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
68
69
  template <class T>
70
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
71
0
  {
72
0
    JS::Rooted<JSObject*> reflector(aCx);
73
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
74
0
  }
75
76
  // We declare this as an array so that retrieving a pointer to this
77
  // binding's property hooks only requires compile/link-time resolvable
78
  // address arithmetic.  Declaring it as a pointer instead would require
79
  // doing a run-time load to fetch a pointer to this binding's property
80
  // hooks.  And then structures which embedded a pointer to this structure
81
  // would require a run-time load for proper initialization, which would
82
  // then induce static constructors.  Lots of static constructors.
83
  extern const NativePropertyHooks sNativePropertyHooks[];
84
85
  void
86
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
87
88
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
89
0
  {
90
0
    /* Get the interface prototype object for this class.  This will create the
91
0
       object as needed. */
92
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::RTCDataChannel,
93
0
                                       &CreateInterfaceObjects,
94
0
                                       /* aDefineOnGlobal = */ true);
95
0
96
0
  }
97
98
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
99
0
  {
100
0
    /* Get the interface object for this class.  This will create the object as
101
0
       needed. */
102
0
103
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::RTCDataChannel,
104
0
                                       &CreateInterfaceObjects,
105
0
                                       aDefineOnGlobal);
106
0
  }
107
108
  JSObject*
109
  GetConstructorObject(JSContext* aCx);
110
111
} // namespace RTCDataChannel_Binding
112
113
114
115
} // namespace dom
116
} // namespace mozilla
117
118
#endif // mozilla_dom_RTCDataChannelBinding_h