/work/obj-fuzz/dist/include/mozilla/dom/BrowserElementBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM BrowserElement.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_BrowserElementBinding_h |
4 | | #define mozilla_dom_BrowserElementBinding_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/CallbackFunction.h" |
12 | | #include "mozilla/dom/Nullable.h" |
13 | | #include "mozilla/dom/ToJSValue.h" |
14 | | |
15 | | namespace mozilla { |
16 | | namespace dom { |
17 | | |
18 | | struct BrowserElementDownloadOptionsAtoms; |
19 | | struct BrowserElementExecuteScriptOptionsAtoms; |
20 | | class BrowserElementNextPaintEventCallback; |
21 | | struct NativePropertyHooks; |
22 | | class ProtoAndIfaceCache; |
23 | | |
24 | | } // namespace dom |
25 | | } // namespace mozilla |
26 | | |
27 | | namespace mozilla { |
28 | | namespace dom { |
29 | | |
30 | | enum class BrowserFindCaseSensitivity : uint8_t { |
31 | | Case_sensitive, |
32 | | Case_insensitive, |
33 | | EndGuard_ |
34 | | }; |
35 | | |
36 | | namespace BrowserFindCaseSensitivityValues { |
37 | | extern const EnumEntry strings[3]; |
38 | | } // namespace BrowserFindCaseSensitivityValues |
39 | | |
40 | | bool |
41 | | ToJSValue(JSContext* aCx, BrowserFindCaseSensitivity aArgument, JS::MutableHandle<JS::Value> aValue); |
42 | | |
43 | | |
44 | | enum class BrowserFindDirection : uint8_t { |
45 | | Forward, |
46 | | Backward, |
47 | | EndGuard_ |
48 | | }; |
49 | | |
50 | | namespace BrowserFindDirectionValues { |
51 | | extern const EnumEntry strings[3]; |
52 | | } // namespace BrowserFindDirectionValues |
53 | | |
54 | | bool |
55 | | ToJSValue(JSContext* aCx, BrowserFindDirection aArgument, JS::MutableHandle<JS::Value> aValue); |
56 | | |
57 | | |
58 | | struct BrowserElementDownloadOptions : public DictionaryBase |
59 | | { |
60 | | MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mFilename; |
61 | | MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mReferrer; |
62 | | |
63 | | BrowserElementDownloadOptions(); |
64 | | |
65 | | explicit inline BrowserElementDownloadOptions(const FastDictionaryInitializer& ) |
66 | 0 | { |
67 | 0 | // Do nothing here; this is used by our "Fast" subclass |
68 | 0 | } |
69 | | |
70 | | explicit inline BrowserElementDownloadOptions(const BrowserElementDownloadOptions& aOther) |
71 | 0 | { |
72 | 0 | *this = aOther; |
73 | 0 | } |
74 | | |
75 | | bool |
76 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
77 | | |
78 | | bool |
79 | | Init(const nsAString& aJSON); |
80 | | |
81 | | bool |
82 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
83 | | |
84 | | bool |
85 | | ToJSON(nsAString& aJSON) const; |
86 | | |
87 | | void |
88 | | TraceDictionary(JSTracer* trc); |
89 | | |
90 | | BrowserElementDownloadOptions& |
91 | | operator=(const BrowserElementDownloadOptions& aOther); |
92 | | |
93 | | private: |
94 | | static bool |
95 | | InitIds(JSContext* cx, BrowserElementDownloadOptionsAtoms* atomsCache); |
96 | | }; |
97 | | |
98 | | namespace binding_detail { |
99 | | struct FastBrowserElementDownloadOptions : public BrowserElementDownloadOptions |
100 | | { |
101 | | inline FastBrowserElementDownloadOptions() |
102 | | : BrowserElementDownloadOptions(FastDictionaryInitializer()) |
103 | 0 | { |
104 | 0 | // Doesn't matter what int we pass to the parent constructor |
105 | 0 | } |
106 | | }; |
107 | | } // namespace binding_detail |
108 | | |
109 | | |
110 | | struct BrowserElementExecuteScriptOptions : public DictionaryBase |
111 | | { |
112 | | MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mOrigin; |
113 | | MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mUrl; |
114 | | |
115 | | BrowserElementExecuteScriptOptions(); |
116 | | |
117 | | explicit inline BrowserElementExecuteScriptOptions(const FastDictionaryInitializer& ) |
118 | 0 | { |
119 | 0 | // Do nothing here; this is used by our "Fast" subclass |
120 | 0 | } |
121 | | |
122 | | explicit inline BrowserElementExecuteScriptOptions(const BrowserElementExecuteScriptOptions& aOther) |
123 | 0 | { |
124 | 0 | *this = aOther; |
125 | 0 | } |
126 | | |
127 | | bool |
128 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
129 | | |
130 | | bool |
131 | | Init(const nsAString& aJSON); |
132 | | |
133 | | bool |
134 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
135 | | |
136 | | bool |
137 | | ToJSON(nsAString& aJSON) const; |
138 | | |
139 | | void |
140 | | TraceDictionary(JSTracer* trc); |
141 | | |
142 | | BrowserElementExecuteScriptOptions& |
143 | | operator=(const BrowserElementExecuteScriptOptions& aOther); |
144 | | |
145 | | private: |
146 | | static bool |
147 | | InitIds(JSContext* cx, BrowserElementExecuteScriptOptionsAtoms* atomsCache); |
148 | | }; |
149 | | |
150 | | namespace binding_detail { |
151 | | struct FastBrowserElementExecuteScriptOptions : public BrowserElementExecuteScriptOptions |
152 | | { |
153 | | inline FastBrowserElementExecuteScriptOptions() |
154 | | : BrowserElementExecuteScriptOptions(FastDictionaryInitializer()) |
155 | 0 | { |
156 | 0 | // Doesn't matter what int we pass to the parent constructor |
157 | 0 | } |
158 | | }; |
159 | | } // namespace binding_detail |
160 | | |
161 | | |
162 | | class BrowserElementNextPaintEventCallback : public CallbackFunction |
163 | | { |
164 | | public: |
165 | | explicit inline BrowserElementNextPaintEventCallback(JSContext* aCx, JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aCallbackGlobal, nsIGlobalObject* aIncumbentGlobal) |
166 | | : CallbackFunction(aCx, aCallback, aCallbackGlobal, aIncumbentGlobal) |
167 | 0 | { |
168 | 0 | MOZ_ASSERT(JS::IsCallable(mCallback)); |
169 | 0 | } |
170 | | |
171 | | explicit inline BrowserElementNextPaintEventCallback(JSObject* aCallback, JSObject* aCallbackGlobal, const FastCallbackConstructor& ) |
172 | | : CallbackFunction(aCallback, aCallbackGlobal, FastCallbackConstructor()) |
173 | 0 | { |
174 | 0 | MOZ_ASSERT(JS::IsCallable(mCallback)); |
175 | 0 | } |
176 | | |
177 | | explicit inline BrowserElementNextPaintEventCallback(JSObject* aCallback, JSObject* aCallbackGlobal, JSObject* aAsyncStack, nsIGlobalObject* aIncumbentGlobal) |
178 | | : CallbackFunction(aCallback, aCallbackGlobal, aAsyncStack, aIncumbentGlobal) |
179 | 0 | { |
180 | 0 | MOZ_ASSERT(JS::IsCallable(mCallback)); |
181 | 0 | } |
182 | | |
183 | | explicit inline BrowserElementNextPaintEventCallback(CallbackFunction* aOther) |
184 | | : CallbackFunction(aOther) |
185 | 0 | { |
186 | 0 | } |
187 | | |
188 | | template <typename T> |
189 | | inline void |
190 | | Call(const T& thisVal, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JS::Realm* aRealm = nullptr) |
191 | | { |
192 | | MOZ_ASSERT(!aRv.Failed(), "Don't pass an already-failed ErrorResult to a callback!"); |
193 | | if (!aExecutionReason) { |
194 | | aExecutionReason = "BrowserElementNextPaintEventCallback"; |
195 | | } |
196 | | CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm); |
197 | | if (!s.GetContext()) { |
198 | | MOZ_ASSERT(aRv.Failed()); |
199 | | return; |
200 | | } |
201 | | JS::Rooted<JS::Value> thisValJS(s.GetContext()); |
202 | | if (!ToJSValue(s.GetContext(), thisVal, &thisValJS)) { |
203 | | aRv.Throw(NS_ERROR_FAILURE); |
204 | | return; |
205 | | } |
206 | | return Call(s.GetContext(), thisValJS, aRv); |
207 | | } |
208 | | |
209 | | inline void |
210 | | Call(ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JS::Realm* aRealm = nullptr) |
211 | 0 | { |
212 | 0 | MOZ_ASSERT(!aRv.Failed(), "Don't pass an already-failed ErrorResult to a callback!"); |
213 | 0 | if (!aExecutionReason) { |
214 | 0 | aExecutionReason = "BrowserElementNextPaintEventCallback"; |
215 | 0 | } |
216 | 0 | CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm); |
217 | 0 | if (!s.GetContext()) { |
218 | 0 | MOZ_ASSERT(aRv.Failed()); |
219 | 0 | return; |
220 | 0 | } |
221 | 0 | return Call(s.GetContext(), JS::UndefinedHandleValue, aRv); |
222 | 0 | } |
223 | | |
224 | | template <typename T> |
225 | | inline void |
226 | | Call(const T& thisVal, const char* aExecutionReason = nullptr) |
227 | | { |
228 | | return Call(thisVal, IgnoreErrors(), aExecutionReason); |
229 | | } |
230 | | |
231 | | inline void |
232 | | Call(const char* aExecutionReason = nullptr) |
233 | 0 | { |
234 | 0 | return Call(IgnoreErrors(), aExecutionReason, eReportExceptions, nullptr); |
235 | 0 | } |
236 | | |
237 | | inline bool |
238 | | operator==(const BrowserElementNextPaintEventCallback& aOther) const |
239 | 0 | { |
240 | 0 | return CallbackFunction::operator==(aOther); |
241 | 0 | } |
242 | | |
243 | | private: |
244 | | void Call(JSContext* cx, JS::Handle<JS::Value> aThisVal, ErrorResult& aRv); |
245 | | }; |
246 | | |
247 | | |
248 | | namespace binding_detail { |
249 | | class FastBrowserElementNextPaintEventCallback : public BrowserElementNextPaintEventCallback |
250 | | { |
251 | | public: |
252 | | explicit inline FastBrowserElementNextPaintEventCallback(JSObject* aCallback, JSObject* aCallbackGlobal) |
253 | | : BrowserElementNextPaintEventCallback(aCallback, aCallbackGlobal, FastCallbackConstructor()) |
254 | 0 | { |
255 | 0 | } |
256 | | |
257 | | inline void |
258 | | Trace(JSTracer* aTracer) |
259 | 0 | { |
260 | 0 | BrowserElementNextPaintEventCallback::Trace(aTracer); |
261 | 0 | } |
262 | | |
263 | | inline void |
264 | | FinishSlowJSInitIfMoreThanOneOwner(JSContext* aCx) |
265 | 0 | { |
266 | 0 | BrowserElementNextPaintEventCallback::FinishSlowJSInitIfMoreThanOneOwner(aCx); |
267 | 0 | } |
268 | | }; |
269 | | } // namespace binding_detail |
270 | | |
271 | | |
272 | | } // namespace dom |
273 | | } // namespace mozilla |
274 | | |
275 | | #endif // mozilla_dom_BrowserElementBinding_h |