Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM DataChannel.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_DataChannelBinding_h
4 : #define mozilla_dom_DataChannelBinding_h
5 :
6 : #include "js/RootingAPI.h"
7 : #include "jspubtd.h"
8 : #include "mozilla/ErrorResult.h"
9 : #include "mozilla/dom/BindingDeclarations.h"
10 : #include "mozilla/dom/Nullable.h"
11 :
12 : class nsDOMDataChannel;
13 : struct nsDOMDataChannelAtoms;
14 :
15 : namespace mozilla {
16 : namespace dom {
17 :
18 : struct NativePropertyHooks;
19 : class ProtoAndIfaceCache;
20 :
21 : } // namespace dom
22 : } // namespace mozilla
23 :
24 : namespace mozilla {
25 : namespace dom {
26 :
27 : enum class RTCDataChannelState : uint8_t {
28 : Connecting,
29 : Open,
30 : Closing,
31 : Closed,
32 : EndGuard_
33 : };
34 :
35 : namespace RTCDataChannelStateValues {
36 : extern const EnumEntry strings[5];
37 : } // namespace RTCDataChannelStateValues
38 :
39 : bool
40 : ToJSValue(JSContext* aCx, RTCDataChannelState aArgument, JS::MutableHandle<JS::Value> aValue);
41 :
42 :
43 : enum class RTCDataChannelType : uint8_t {
44 : Arraybuffer,
45 : Blob,
46 : EndGuard_
47 : };
48 :
49 : namespace RTCDataChannelTypeValues {
50 : extern const EnumEntry strings[3];
51 : } // namespace RTCDataChannelTypeValues
52 :
53 : bool
54 : ToJSValue(JSContext* aCx, RTCDataChannelType aArgument, JS::MutableHandle<JS::Value> aValue);
55 :
56 :
57 : namespace DataChannelBinding {
58 :
59 : typedef nsDOMDataChannel NativeType;
60 :
61 : JSObject*
62 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
63 :
64 : const JSClass*
65 : GetJSClass();
66 :
67 : bool
68 : Wrap(JSContext* aCx, nsDOMDataChannel* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
69 :
70 : template <class T>
71 0 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
72 : {
73 0 : JS::Rooted<JSObject*> reflector(aCx);
74 0 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
75 : }
76 :
77 : // We declare this as an array so that retrieving a pointer to this
78 : // binding's property hooks only requires compile/link-time resolvable
79 : // address arithmetic. Declaring it as a pointer instead would require
80 : // doing a run-time load to fetch a pointer to this binding's property
81 : // hooks. And then structures which embedded a pointer to this structure
82 : // would require a run-time load for proper initialization, which would
83 : // then induce static constructors. Lots of static constructors.
84 : extern const NativePropertyHooks sNativePropertyHooks[];
85 :
86 : void
87 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
88 :
89 : JS::Handle<JSObject*>
90 : GetProtoObjectHandle(JSContext* aCx);
91 :
92 : JS::Handle<JSObject*>
93 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
94 :
95 : JSObject*
96 : GetConstructorObject(JSContext* aCx);
97 :
98 : } // namespace DataChannelBinding
99 :
100 :
101 :
102 : } // namespace dom
103 : } // namespace mozilla
104 :
105 : #endif // mozilla_dom_DataChannelBinding_h
|