/work/obj-fuzz/dist/include/mozilla/dom/RTCDTMFSenderBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM RTCDTMFSender.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_RTCDTMFSenderBinding_h |
4 | | #define mozilla_dom_RTCDTMFSenderBinding_h |
5 | | |
6 | | #include "GeckoProfiler.h" |
7 | | #include "js/RootingAPI.h" |
8 | | #include "jspubtd.h" |
9 | | #include "mozilla/DOMEventTargetHelper.h" |
10 | | #include "mozilla/ErrorResult.h" |
11 | | #include "mozilla/dom/BindingDeclarations.h" |
12 | | #include "mozilla/dom/CallbackInterface.h" |
13 | | #include "mozilla/dom/Nullable.h" |
14 | | #include "mozilla/dom/PrototypeList.h" |
15 | | #include "mozilla/dom/ToJSValue.h" |
16 | | #include "nsWeakReference.h" |
17 | | |
18 | | namespace mozilla { |
19 | | namespace dom { |
20 | | |
21 | | class EventHandlerNonNull; |
22 | | struct NativePropertyHooks; |
23 | | class ProtoAndIfaceCache; |
24 | | class RTCDTMFSender; |
25 | | struct RTCDTMFSenderAtoms; |
26 | | |
27 | | } // namespace dom |
28 | | } // namespace mozilla |
29 | | |
30 | | namespace mozilla { |
31 | | namespace dom { |
32 | | |
33 | | namespace RTCDTMFSender_Binding { |
34 | | |
35 | | typedef mozilla::dom::RTCDTMFSender NativeType; |
36 | | |
37 | | const JSClass* |
38 | | GetJSClass(); |
39 | | |
40 | | bool |
41 | | Wrap(JSContext* aCx, mozilla::dom::RTCDTMFSender* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
42 | | |
43 | | template <class T> |
44 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
45 | 0 | { |
46 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
47 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
48 | 0 | } |
49 | | |
50 | | // We declare this as an array so that retrieving a pointer to this |
51 | | // binding's property hooks only requires compile/link-time resolvable |
52 | | // address arithmetic. Declaring it as a pointer instead would require |
53 | | // doing a run-time load to fetch a pointer to this binding's property |
54 | | // hooks. And then structures which embedded a pointer to this structure |
55 | | // would require a run-time load for proper initialization, which would |
56 | | // then induce static constructors. Lots of static constructors. |
57 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
58 | | |
59 | | void |
60 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
61 | | |
62 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
63 | 0 | { |
64 | 0 | /* Get the interface prototype object for this class. This will create the |
65 | 0 | object as needed. */ |
66 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::RTCDTMFSender, |
67 | 0 | &CreateInterfaceObjects, |
68 | 0 | /* aDefineOnGlobal = */ true); |
69 | 0 |
|
70 | 0 | } |
71 | | |
72 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
73 | 0 | { |
74 | 0 | /* Get the interface object for this class. This will create the object as |
75 | 0 | needed. */ |
76 | 0 |
|
77 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::RTCDTMFSender, |
78 | 0 | &CreateInterfaceObjects, |
79 | 0 | aDefineOnGlobal); |
80 | 0 | } |
81 | | |
82 | | JSObject* |
83 | | GetConstructorObject(JSContext* aCx); |
84 | | |
85 | | } // namespace RTCDTMFSender_Binding |
86 | | |
87 | | |
88 | | |
89 | | class RTCDTMFSenderJSImpl : public CallbackInterface |
90 | | { |
91 | | public: |
92 | | explicit inline RTCDTMFSenderJSImpl(JSContext* aCx, JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aCallbackGlobal, nsIGlobalObject* aIncumbentGlobal) |
93 | | : CallbackInterface(aCx, aCallback, aCallbackGlobal, aIncumbentGlobal) |
94 | 0 | { |
95 | 0 | } |
96 | | |
97 | | explicit inline RTCDTMFSenderJSImpl(JSObject* aCallback, JSObject* aCallbackGlobal, const FastCallbackConstructor& ) |
98 | | : CallbackInterface(aCallback, aCallbackGlobal, FastCallbackConstructor()) |
99 | 0 | { |
100 | 0 | } |
101 | | |
102 | | explicit inline RTCDTMFSenderJSImpl(JSObject* aCallback, JSObject* aCallbackGlobal, JSObject* aAsyncStack, nsIGlobalObject* aIncumbentGlobal) |
103 | | : CallbackInterface(aCallback, aCallbackGlobal, aAsyncStack, aIncumbentGlobal) |
104 | 0 | { |
105 | 0 | } |
106 | | |
107 | | void InsertDTMF(const nsAString& tones, uint32_t duration, uint32_t interToneGap, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
108 | | |
109 | | inline bool |
110 | | operator==(const RTCDTMFSenderJSImpl& aOther) const |
111 | 0 | { |
112 | 0 | return CallbackInterface::operator==(aOther); |
113 | 0 | } |
114 | | |
115 | | already_AddRefed<EventHandlerNonNull> GetOntonechange(ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
116 | | |
117 | | void GetToneBuffer(nsString& aRetVal, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
118 | | |
119 | | void SetOntonechange(EventHandlerNonNull* arg, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
120 | | |
121 | | private: |
122 | | static bool |
123 | | InitIds(JSContext* cx, RTCDTMFSenderAtoms* atomsCache); |
124 | | }; |
125 | | |
126 | | |
127 | | class RTCDTMFSender final : public mozilla::DOMEventTargetHelper |
128 | | { |
129 | | public: |
130 | | NS_DECL_ISUPPORTS_INHERITED |
131 | | NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(RTCDTMFSender, mozilla::DOMEventTargetHelper) |
132 | | |
133 | | private: |
134 | | RefPtr<RTCDTMFSenderJSImpl> mImpl; |
135 | | nsCOMPtr<nsIGlobalObject> mParent; |
136 | | |
137 | | public: |
138 | | RTCDTMFSender(JS::Handle<JSObject*> aJSImplObject, JS::Handle<JSObject*> aJSImplGlobal, nsIGlobalObject* aParent); |
139 | | |
140 | | private: |
141 | | ~RTCDTMFSender(); |
142 | | |
143 | | public: |
144 | | nsISupports* GetParentObject() const; |
145 | | |
146 | | virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; |
147 | | |
148 | | void InsertDTMF(const nsAString& tones, uint32_t duration, uint32_t interToneGap, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
149 | | |
150 | | already_AddRefed<EventHandlerNonNull> GetOntonechange(ErrorResult& aRv, JS::Realm* aRealm = nullptr) const; |
151 | | |
152 | | void SetOntonechange(EventHandlerNonNull* arg, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
153 | | |
154 | | void GetToneBuffer(nsString& aRetVal, ErrorResult& aRv, JS::Realm* aRealm = nullptr) const; |
155 | | |
156 | | static bool |
157 | | _Create(JSContext* cx, unsigned argc, JS::Value* vp); |
158 | | }; |
159 | | |
160 | | |
161 | | } // namespace dom |
162 | | } // namespace mozilla |
163 | | |
164 | | #endif // mozilla_dom_RTCDTMFSenderBinding_h |