/work/obj-fuzz/dist/include/mozilla/dom/PeerConnectionObserverBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM PeerConnectionObserver.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_PeerConnectionObserverBinding_h |
4 | | #define mozilla_dom_PeerConnectionObserverBinding_h |
5 | | |
6 | | #include "GeckoProfiler.h" |
7 | | #include "PeerConnectionObserverEnumsBinding.h" |
8 | | #include "RTCPeerConnectionBinding.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/PrototypeList.h" |
16 | | #include "mozilla/dom/ToJSValue.h" |
17 | | #include "mozilla/dom/TypedArray.h" |
18 | | #include "nsWeakReference.h" |
19 | | |
20 | | class nsDOMDataChannel; |
21 | | |
22 | | namespace mozilla { |
23 | | |
24 | | class TransceiverImpl; |
25 | | |
26 | | namespace dom { |
27 | | |
28 | | class MediaStreamTrack; |
29 | | struct NativePropertyHooks; |
30 | | class PeerConnectionObserver; |
31 | | struct PeerConnectionObserverAtoms; |
32 | | class ProtoAndIfaceCache; |
33 | | class RTCPeerConnection; |
34 | | struct RTCStatsReportInternal; |
35 | | |
36 | | } // namespace dom |
37 | | |
38 | | } // namespace mozilla |
39 | | |
40 | | namespace mozilla { |
41 | | namespace dom { |
42 | | |
43 | | namespace PeerConnectionObserver_Binding { |
44 | | |
45 | | typedef mozilla::dom::PeerConnectionObserver NativeType; |
46 | | |
47 | | bool |
48 | | ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj); |
49 | | |
50 | | const JSClass* |
51 | | GetJSClass(); |
52 | | |
53 | | bool |
54 | | Wrap(JSContext* aCx, mozilla::dom::PeerConnectionObserver* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
55 | | |
56 | | template <class T> |
57 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
58 | 0 | { |
59 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
60 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
61 | 0 | } |
62 | | |
63 | | // We declare this as an array so that retrieving a pointer to this |
64 | | // binding's property hooks only requires compile/link-time resolvable |
65 | | // address arithmetic. Declaring it as a pointer instead would require |
66 | | // doing a run-time load to fetch a pointer to this binding's property |
67 | | // hooks. And then structures which embedded a pointer to this structure |
68 | | // would require a run-time load for proper initialization, which would |
69 | | // then induce static constructors. Lots of static constructors. |
70 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
71 | | |
72 | | void |
73 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
74 | | |
75 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
76 | 0 | { |
77 | 0 | /* Get the interface prototype object for this class. This will create the |
78 | 0 | object as needed. */ |
79 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::PeerConnectionObserver, |
80 | 0 | &CreateInterfaceObjects, |
81 | 0 | /* aDefineOnGlobal = */ true); |
82 | 0 |
|
83 | 0 | } |
84 | | |
85 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
86 | 0 | { |
87 | 0 | /* Get the interface object for this class. This will create the object as |
88 | 0 | needed. */ |
89 | 0 |
|
90 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::PeerConnectionObserver, |
91 | 0 | &CreateInterfaceObjects, |
92 | 0 | aDefineOnGlobal); |
93 | 0 | } |
94 | | |
95 | | JSObject* |
96 | | GetConstructorObject(JSContext* aCx); |
97 | | |
98 | | } // namespace PeerConnectionObserver_Binding |
99 | | |
100 | | |
101 | | |
102 | | class PeerConnectionObserverJSImpl : public CallbackInterface |
103 | | { |
104 | | public: |
105 | | explicit inline PeerConnectionObserverJSImpl(JSContext* aCx, JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aCallbackGlobal, nsIGlobalObject* aIncumbentGlobal) |
106 | | : CallbackInterface(aCx, aCallback, aCallbackGlobal, aIncumbentGlobal) |
107 | 0 | { |
108 | 0 | } |
109 | | |
110 | | explicit inline PeerConnectionObserverJSImpl(JSObject* aCallback, JSObject* aCallbackGlobal, const FastCallbackConstructor& ) |
111 | | : CallbackInterface(aCallback, aCallbackGlobal, FastCallbackConstructor()) |
112 | 0 | { |
113 | 0 | } |
114 | | |
115 | | explicit inline PeerConnectionObserverJSImpl(JSObject* aCallback, JSObject* aCallbackGlobal, JSObject* aAsyncStack, nsIGlobalObject* aIncumbentGlobal) |
116 | | : CallbackInterface(aCallback, aCallbackGlobal, aAsyncStack, aIncumbentGlobal) |
117 | 0 | { |
118 | 0 | } |
119 | | |
120 | | void OnCreateOfferSuccess(const nsAString& offer, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
121 | | |
122 | | void OnCreateOfferError(uint32_t name, const nsAString& message, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
123 | | |
124 | | void OnCreateAnswerSuccess(const nsAString& answer, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
125 | | |
126 | | void OnCreateAnswerError(uint32_t name, const nsAString& message, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
127 | | |
128 | | void OnSetLocalDescriptionSuccess(ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
129 | | |
130 | | void OnSetRemoteDescriptionSuccess(ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
131 | | |
132 | | void OnSetLocalDescriptionError(uint32_t name, const nsAString& message, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
133 | | |
134 | | void OnSetRemoteDescriptionError(uint32_t name, const nsAString& message, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
135 | | |
136 | | void OnAddIceCandidateSuccess(ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
137 | | |
138 | | void OnAddIceCandidateError(uint32_t name, const nsAString& message, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
139 | | |
140 | | void OnIceCandidate(uint16_t level, const nsAString& mid, const nsAString& candidate, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
141 | | |
142 | | void OnGetStatsSuccess(const RTCStatsReportInternal& report, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
143 | | |
144 | | void OnGetStatsError(uint32_t name, const nsAString& message, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
145 | | |
146 | | void NotifyDataChannel(nsDOMDataChannel& channel, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
147 | | |
148 | | void OnStateChange(PCObserverStateType state, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
149 | | |
150 | | void OnTransceiverNeeded(const nsAString& kind, TransceiverImpl& transceiverImpl, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
151 | | |
152 | | void OnDTMFToneChange(MediaStreamTrack& track, const nsAString& tone, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
153 | | |
154 | | void OnPacket(uint32_t level, mozPacketDumpType type, bool sending, const ArrayBuffer& packet, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
155 | | |
156 | | void SyncTransceivers(ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
157 | | |
158 | | void __Init(RTCPeerConnection& domPC, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
159 | | |
160 | | inline bool |
161 | | operator==(const PeerConnectionObserverJSImpl& aOther) const |
162 | 0 | { |
163 | 0 | return CallbackInterface::operator==(aOther); |
164 | 0 | } |
165 | | |
166 | | private: |
167 | | static bool |
168 | | InitIds(JSContext* cx, PeerConnectionObserverAtoms* atomsCache); |
169 | | }; |
170 | | |
171 | | |
172 | | class PeerConnectionObserver final : public nsSupportsWeakReference, |
173 | | public nsWrapperCache |
174 | | { |
175 | | public: |
176 | | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
177 | | NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PeerConnectionObserver) |
178 | | |
179 | | private: |
180 | | RefPtr<PeerConnectionObserverJSImpl> mImpl; |
181 | | nsCOMPtr<nsIGlobalObject> mParent; |
182 | | |
183 | | public: |
184 | | PeerConnectionObserver(JS::Handle<JSObject*> aJSImplObject, JS::Handle<JSObject*> aJSImplGlobal, nsIGlobalObject* aParent); |
185 | | |
186 | | private: |
187 | | ~PeerConnectionObserver(); |
188 | | |
189 | | public: |
190 | | nsISupports* GetParentObject() const; |
191 | | |
192 | | virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; |
193 | | |
194 | | static already_AddRefed<PeerConnectionObserver> Constructor(const GlobalObject& global, JSContext* cx, RTCPeerConnection& domPC, ErrorResult& aRv, JS::Handle<JSObject*> aGivenProto = nullptr); |
195 | | |
196 | | void OnCreateOfferSuccess(const nsAString& offer, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
197 | | |
198 | | void OnCreateOfferError(uint32_t name, const nsAString& message, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
199 | | |
200 | | void OnCreateAnswerSuccess(const nsAString& answer, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
201 | | |
202 | | void OnCreateAnswerError(uint32_t name, const nsAString& message, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
203 | | |
204 | | void OnSetLocalDescriptionSuccess(ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
205 | | |
206 | | void OnSetRemoteDescriptionSuccess(ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
207 | | |
208 | | void OnSetLocalDescriptionError(uint32_t name, const nsAString& message, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
209 | | |
210 | | void OnSetRemoteDescriptionError(uint32_t name, const nsAString& message, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
211 | | |
212 | | void OnAddIceCandidateSuccess(ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
213 | | |
214 | | void OnAddIceCandidateError(uint32_t name, const nsAString& message, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
215 | | |
216 | | void OnIceCandidate(uint16_t level, const nsAString& mid, const nsAString& candidate, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
217 | | |
218 | | void OnGetStatsSuccess(const RTCStatsReportInternal& report, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
219 | | |
220 | | void OnGetStatsError(uint32_t name, const nsAString& message, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
221 | | |
222 | | void NotifyDataChannel(nsDOMDataChannel& channel, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
223 | | |
224 | | void OnStateChange(PCObserverStateType state, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
225 | | |
226 | | void OnTransceiverNeeded(const nsAString& kind, TransceiverImpl& transceiverImpl, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
227 | | |
228 | | void OnDTMFToneChange(MediaStreamTrack& track, const nsAString& tone, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
229 | | |
230 | | void OnPacket(uint32_t level, mozPacketDumpType type, bool sending, const ArrayBuffer& packet, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
231 | | |
232 | | void SyncTransceivers(ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
233 | | |
234 | | static bool |
235 | | _Create(JSContext* cx, unsigned argc, JS::Value* vp); |
236 | | }; |
237 | | |
238 | | |
239 | | } // namespace dom |
240 | | } // namespace mozilla |
241 | | |
242 | | #endif // mozilla_dom_PeerConnectionObserverBinding_h |