/work/obj-fuzz/dist/include/mozilla/dom/RTCIceCandidateBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM RTCIceCandidate.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_RTCIceCandidateBinding_h |
4 | | #define mozilla_dom_RTCIceCandidateBinding_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/CallbackInterface.h" |
12 | | #include "mozilla/dom/Nullable.h" |
13 | | #include "mozilla/dom/PrototypeList.h" |
14 | | #include "mozilla/dom/ToJSValue.h" |
15 | | #include "nsWeakReference.h" |
16 | | |
17 | | namespace mozilla { |
18 | | namespace dom { |
19 | | |
20 | | struct NativePropertyHooks; |
21 | | class ProtoAndIfaceCache; |
22 | | class RTCIceCandidate; |
23 | | struct RTCIceCandidateAtoms; |
24 | | struct RTCIceCandidateInit; |
25 | | struct RTCIceCandidateInitAtoms; |
26 | | |
27 | | } // namespace dom |
28 | | } // namespace mozilla |
29 | | |
30 | | namespace mozilla { |
31 | | namespace dom { |
32 | | |
33 | | struct RTCIceCandidateInit : public DictionaryBase |
34 | | { |
35 | | MOZ_INIT_OUTSIDE_CTOR nsString mCandidate; |
36 | | MOZ_INIT_OUTSIDE_CTOR Nullable<uint16_t> mSdpMLineIndex; |
37 | | MOZ_INIT_OUTSIDE_CTOR nsString mSdpMid; |
38 | | |
39 | | RTCIceCandidateInit(); |
40 | | |
41 | | explicit inline RTCIceCandidateInit(const FastDictionaryInitializer& ) |
42 | 0 | { |
43 | 0 | // Do nothing here; this is used by our "Fast" subclass |
44 | 0 | } |
45 | | |
46 | | explicit inline RTCIceCandidateInit(const RTCIceCandidateInit& aOther) |
47 | 0 | { |
48 | 0 | *this = aOther; |
49 | 0 | } |
50 | | |
51 | | bool |
52 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
53 | | |
54 | | bool |
55 | | Init(const nsAString& aJSON); |
56 | | |
57 | | bool |
58 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
59 | | |
60 | | bool |
61 | | ToJSON(nsAString& aJSON) const; |
62 | | |
63 | | void |
64 | | TraceDictionary(JSTracer* trc); |
65 | | |
66 | | RTCIceCandidateInit& |
67 | | operator=(const RTCIceCandidateInit& aOther); |
68 | | |
69 | | private: |
70 | | static bool |
71 | | InitIds(JSContext* cx, RTCIceCandidateInitAtoms* atomsCache); |
72 | | }; |
73 | | |
74 | | namespace binding_detail { |
75 | | struct FastRTCIceCandidateInit : public RTCIceCandidateInit |
76 | | { |
77 | | inline FastRTCIceCandidateInit() |
78 | | : RTCIceCandidateInit(FastDictionaryInitializer()) |
79 | 0 | { |
80 | 0 | // Doesn't matter what int we pass to the parent constructor |
81 | 0 | } |
82 | | }; |
83 | | } // namespace binding_detail |
84 | | |
85 | | |
86 | | namespace RTCIceCandidate_Binding { |
87 | | |
88 | | typedef mozilla::dom::RTCIceCandidate NativeType; |
89 | | |
90 | | MOZ_CAN_RUN_SCRIPT bool |
91 | | CollectJSONAttributes(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::RTCIceCandidate* self, JS::Rooted<JSObject*>& result); |
92 | | |
93 | | bool |
94 | | ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj); |
95 | | |
96 | | const JSClass* |
97 | | GetJSClass(); |
98 | | |
99 | | bool |
100 | | Wrap(JSContext* aCx, mozilla::dom::RTCIceCandidate* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
101 | | |
102 | | template <class T> |
103 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
104 | 0 | { |
105 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
106 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
107 | 0 | } |
108 | | |
109 | | // We declare this as an array so that retrieving a pointer to this |
110 | | // binding's property hooks only requires compile/link-time resolvable |
111 | | // address arithmetic. Declaring it as a pointer instead would require |
112 | | // doing a run-time load to fetch a pointer to this binding's property |
113 | | // hooks. And then structures which embedded a pointer to this structure |
114 | | // would require a run-time load for proper initialization, which would |
115 | | // then induce static constructors. Lots of static constructors. |
116 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
117 | | |
118 | | void |
119 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
120 | | |
121 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
122 | 0 | { |
123 | 0 | /* Get the interface prototype object for this class. This will create the |
124 | 0 | object as needed. */ |
125 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::RTCIceCandidate, |
126 | 0 | &CreateInterfaceObjects, |
127 | 0 | /* aDefineOnGlobal = */ true); |
128 | 0 |
|
129 | 0 | } |
130 | | |
131 | | JSObject* |
132 | | GetProtoObject(JSContext* aCx); |
133 | | |
134 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
135 | 0 | { |
136 | 0 | /* Get the interface object for this class. This will create the object as |
137 | 0 | needed. */ |
138 | 0 |
|
139 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::RTCIceCandidate, |
140 | 0 | &CreateInterfaceObjects, |
141 | 0 | aDefineOnGlobal); |
142 | 0 | } |
143 | | |
144 | | JSObject* |
145 | | GetConstructorObject(JSContext* aCx); |
146 | | |
147 | | } // namespace RTCIceCandidate_Binding |
148 | | |
149 | | |
150 | | |
151 | | class RTCIceCandidateJSImpl : public CallbackInterface |
152 | | { |
153 | | public: |
154 | | explicit inline RTCIceCandidateJSImpl(JSContext* aCx, JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aCallbackGlobal, nsIGlobalObject* aIncumbentGlobal) |
155 | | : CallbackInterface(aCx, aCallback, aCallbackGlobal, aIncumbentGlobal) |
156 | 0 | { |
157 | 0 | } |
158 | | |
159 | | explicit inline RTCIceCandidateJSImpl(JSObject* aCallback, JSObject* aCallbackGlobal, const FastCallbackConstructor& ) |
160 | | : CallbackInterface(aCallback, aCallbackGlobal, FastCallbackConstructor()) |
161 | 0 | { |
162 | 0 | } |
163 | | |
164 | | explicit inline RTCIceCandidateJSImpl(JSObject* aCallback, JSObject* aCallbackGlobal, JSObject* aAsyncStack, nsIGlobalObject* aIncumbentGlobal) |
165 | | : CallbackInterface(aCallback, aCallbackGlobal, aAsyncStack, aIncumbentGlobal) |
166 | 0 | { |
167 | 0 | } |
168 | | |
169 | | void ToJSON(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
170 | | |
171 | | void __Init(const RTCIceCandidateInit& candidateInitDict, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
172 | | |
173 | | inline bool |
174 | | operator==(const RTCIceCandidateJSImpl& aOther) const |
175 | 0 | { |
176 | 0 | return CallbackInterface::operator==(aOther); |
177 | 0 | } |
178 | | |
179 | | void GetCandidate(nsString& aRetVal, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
180 | | |
181 | | void GetSdpMid(nsString& aRetVal, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
182 | | |
183 | | Nullable<uint16_t> GetSdpMLineIndex(ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
184 | | |
185 | | void SetCandidate(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
186 | | |
187 | | void SetSdpMid(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
188 | | |
189 | | void SetSdpMLineIndex(const Nullable<uint16_t>& arg, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
190 | | |
191 | | private: |
192 | | static bool |
193 | | InitIds(JSContext* cx, RTCIceCandidateAtoms* atomsCache); |
194 | | }; |
195 | | |
196 | | |
197 | | class RTCIceCandidate : public nsSupportsWeakReference, |
198 | | public nsWrapperCache |
199 | | { |
200 | | public: |
201 | | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
202 | | NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(RTCIceCandidate) |
203 | | |
204 | | private: |
205 | | RefPtr<RTCIceCandidateJSImpl> mImpl; |
206 | | nsCOMPtr<nsIGlobalObject> mParent; |
207 | | |
208 | | public: |
209 | | RTCIceCandidate(JS::Handle<JSObject*> aJSImplObject, JS::Handle<JSObject*> aJSImplGlobal, nsIGlobalObject* aParent); |
210 | | |
211 | | protected: |
212 | | virtual ~RTCIceCandidate(); |
213 | | |
214 | | public: |
215 | | nsISupports* GetParentObject() const; |
216 | | |
217 | | virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; |
218 | | |
219 | | static already_AddRefed<RTCIceCandidate> Constructor(const GlobalObject& global, JSContext* cx, const RTCIceCandidateInit& candidateInitDict, ErrorResult& aRv, JS::Handle<JSObject*> aGivenProto = nullptr); |
220 | | |
221 | | void GetCandidate(nsString& aRetVal, ErrorResult& aRv, JS::Realm* aRealm = nullptr) const; |
222 | | |
223 | | void SetCandidate(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
224 | | |
225 | | void GetSdpMid(nsString& aRetVal, ErrorResult& aRv, JS::Realm* aRealm = nullptr) const; |
226 | | |
227 | | void SetSdpMid(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
228 | | |
229 | | Nullable<uint16_t> GetSdpMLineIndex(ErrorResult& aRv, JS::Realm* aRealm = nullptr) const; |
230 | | |
231 | | void SetSdpMLineIndex(const Nullable<uint16_t>& arg, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
232 | | |
233 | | void ToJSON(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm = nullptr); |
234 | | |
235 | | static bool |
236 | | _Create(JSContext* cx, unsigned argc, JS::Value* vp); |
237 | | }; |
238 | | |
239 | | |
240 | | } // namespace dom |
241 | | } // namespace mozilla |
242 | | |
243 | | #endif // mozilla_dom_RTCIceCandidateBinding_h |