Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/ChannelWrapperBinding.h
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM ChannelWrapper.webidl BY Codegen.py - DO NOT EDIT */
2
3
#ifndef mozilla_dom_ChannelWrapperBinding_h
4
#define mozilla_dom_ChannelWrapperBinding_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/Nullable.h"
12
#include "mozilla/dom/PrototypeList.h"
13
#include "mozilla/extensions/MatchPattern.h"
14
15
namespace mozilla {
16
17
namespace dom {
18
19
struct MozFrameAncestorInfoAtoms;
20
struct MozHTTPHeaderAtoms;
21
struct MozProxyInfoAtoms;
22
struct MozRequestFilterAtoms;
23
struct MozRequestMatchOptionsAtoms;
24
struct NativePropertyHooks;
25
class ProtoAndIfaceCache;
26
27
} // namespace dom
28
29
namespace extensions {
30
31
class ChannelWrapper;
32
struct ChannelWrapperAtoms;
33
class MatchPatternSet;
34
35
} // namespace extensions
36
37
} // namespace mozilla
38
39
namespace mozilla {
40
namespace dom {
41
42
enum class MozContentPolicyType : uint8_t {
43
  Main_frame,
44
  Sub_frame,
45
  Stylesheet,
46
  Script,
47
  Image,
48
  Object,
49
  Object_subrequest,
50
  Xmlhttprequest,
51
  Fetch,
52
  Xbl,
53
  Xslt,
54
  Ping,
55
  Beacon,
56
  Xml_dtd,
57
  Font,
58
  Media,
59
  Websocket,
60
  Csp_report,
61
  Imageset,
62
  Web_manifest,
63
  Speculative,
64
  Other,
65
  EndGuard_
66
};
67
68
namespace MozContentPolicyTypeValues {
69
extern const EnumEntry strings[23];
70
} // namespace MozContentPolicyTypeValues
71
72
bool
73
ToJSValue(JSContext* aCx, MozContentPolicyType aArgument, JS::MutableHandle<JS::Value> aValue);
74
75
76
struct MozFrameAncestorInfo : public DictionaryBase
77
{
78
  MOZ_INIT_OUTSIDE_CTOR uint64_t mFrameId;
79
  MOZ_INIT_OUTSIDE_CTOR nsCString mUrl;
80
81
  MozFrameAncestorInfo();
82
83
  explicit inline MozFrameAncestorInfo(const FastDictionaryInitializer& )
84
0
  {
85
0
    // Do nothing here; this is used by our "Fast" subclass
86
0
  }
87
88
  explicit inline MozFrameAncestorInfo(const MozFrameAncestorInfo& aOther)
89
0
  {
90
0
    *this = aOther;
91
0
  }
92
93
  bool
94
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
95
96
  bool
97
  Init(const nsAString& aJSON);
98
99
  bool
100
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
101
102
  bool
103
  ToJSON(nsAString& aJSON) const;
104
105
  void
106
  TraceDictionary(JSTracer* trc);
107
108
  MozFrameAncestorInfo&
109
  operator=(const MozFrameAncestorInfo& aOther);
110
111
private:
112
  static bool
113
  InitIds(JSContext* cx, MozFrameAncestorInfoAtoms* atomsCache);
114
};
115
116
namespace binding_detail {
117
struct FastMozFrameAncestorInfo : public MozFrameAncestorInfo
118
{
119
  inline FastMozFrameAncestorInfo()
120
    : MozFrameAncestorInfo(FastDictionaryInitializer())
121
0
  {
122
0
    // Doesn't matter what int we pass to the parent constructor
123
0
  }
124
};
125
} // namespace binding_detail
126
127
128
struct MozHTTPHeader : public DictionaryBase
129
{
130
  MOZ_INIT_OUTSIDE_CTOR nsCString mName;
131
  MOZ_INIT_OUTSIDE_CTOR nsCString mValue;
132
133
  MozHTTPHeader();
134
135
  explicit inline MozHTTPHeader(const FastDictionaryInitializer& )
136
0
  {
137
0
    // Do nothing here; this is used by our "Fast" subclass
138
0
  }
139
140
  explicit inline MozHTTPHeader(const MozHTTPHeader& aOther)
141
0
  {
142
0
    *this = aOther;
143
0
  }
144
145
  bool
146
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
147
148
  bool
149
  Init(const nsAString& aJSON);
150
151
  bool
152
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
153
154
  bool
155
  ToJSON(nsAString& aJSON) const;
156
157
  void
158
  TraceDictionary(JSTracer* trc);
159
160
  MozHTTPHeader&
161
  operator=(const MozHTTPHeader& aOther);
162
163
private:
164
  static bool
165
  InitIds(JSContext* cx, MozHTTPHeaderAtoms* atomsCache);
166
};
167
168
namespace binding_detail {
169
struct FastMozHTTPHeader : public MozHTTPHeader
170
{
171
  inline FastMozHTTPHeader()
172
    : MozHTTPHeader(FastDictionaryInitializer())
173
0
  {
174
0
    // Doesn't matter what int we pass to the parent constructor
175
0
  }
176
};
177
} // namespace binding_detail
178
179
180
struct MozProxyInfo : public DictionaryBase
181
{
182
  MOZ_INIT_OUTSIDE_CTOR Optional<uint32_t> mFailoverTimeout;
183
  MOZ_INIT_OUTSIDE_CTOR nsCString mHost;
184
  MOZ_INIT_OUTSIDE_CTOR int32_t mPort;
185
  MOZ_INIT_OUTSIDE_CTOR bool mProxyDNS;
186
  MOZ_INIT_OUTSIDE_CTOR nsCString mType;
187
  MOZ_INIT_OUTSIDE_CTOR nsCString mUsername;
188
189
  MozProxyInfo();
190
191
  explicit inline MozProxyInfo(const FastDictionaryInitializer& )
192
0
  {
193
0
    // Do nothing here; this is used by our "Fast" subclass
194
0
  }
195
196
  explicit inline MozProxyInfo(const MozProxyInfo& aOther)
197
0
  {
198
0
    *this = aOther;
199
0
  }
200
201
  bool
202
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
203
204
  bool
205
  Init(const nsAString& aJSON);
206
207
  bool
208
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
209
210
  bool
211
  ToJSON(nsAString& aJSON) const;
212
213
  void
214
  TraceDictionary(JSTracer* trc);
215
216
  MozProxyInfo&
217
  operator=(const MozProxyInfo& aOther);
218
219
private:
220
  static bool
221
  InitIds(JSContext* cx, MozProxyInfoAtoms* atomsCache);
222
};
223
224
namespace binding_detail {
225
struct FastMozProxyInfo : public MozProxyInfo
226
{
227
  inline FastMozProxyInfo()
228
    : MozProxyInfo(FastDictionaryInitializer())
229
0
  {
230
0
    // Doesn't matter what int we pass to the parent constructor
231
0
  }
232
};
233
} // namespace binding_detail
234
235
236
struct MozRequestFilter : public DictionaryBase
237
{
238
  MOZ_INIT_OUTSIDE_CTOR Nullable<Sequence<MozContentPolicyType>> mTypes;
239
  MOZ_INIT_OUTSIDE_CTOR RefPtr<mozilla::extensions::MatchPatternSet> mUrls;
240
241
  MozRequestFilter();
242
243
  explicit inline MozRequestFilter(const FastDictionaryInitializer& )
244
0
  {
245
0
    // Do nothing here; this is used by our "Fast" subclass
246
0
  }
247
248
  explicit inline MozRequestFilter(const MozRequestFilter& aOther)
249
0
  {
250
0
    *this = aOther;
251
0
  }
252
253
  bool
254
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
255
256
  bool
257
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
258
259
  void
260
  TraceDictionary(JSTracer* trc);
261
262
  inline void
263
  TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags)
264
0
  {
265
0
    ImplCycleCollectionTraverse(aCallback, mUrls, "mUrls", aFlags);
266
0
  }
267
268
  inline void
269
  UnlinkForCC()
270
0
  {
271
0
    ImplCycleCollectionUnlink(mUrls);
272
0
  }
273
274
  MozRequestFilter&
275
  operator=(const MozRequestFilter& aOther);
276
277
private:
278
  static bool
279
  InitIds(JSContext* cx, MozRequestFilterAtoms* atomsCache);
280
};
281
282
namespace binding_detail {
283
struct FastMozRequestFilter : public MozRequestFilter
284
{
285
  inline FastMozRequestFilter()
286
    : MozRequestFilter(FastDictionaryInitializer())
287
0
  {
288
0
    // Doesn't matter what int we pass to the parent constructor
289
0
  }
290
};
291
} // namespace binding_detail
292
293
294
struct MozRequestMatchOptions : public DictionaryBase
295
{
296
  MOZ_INIT_OUTSIDE_CTOR bool mIsProxy;
297
298
  MozRequestMatchOptions();
299
300
  explicit inline MozRequestMatchOptions(const FastDictionaryInitializer& )
301
0
  {
302
0
    // Do nothing here; this is used by our "Fast" subclass
303
0
  }
304
305
  explicit inline MozRequestMatchOptions(const MozRequestMatchOptions& aOther)
306
0
  {
307
0
    *this = aOther;
308
0
  }
309
310
  bool
311
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
312
313
  bool
314
  Init(const nsAString& aJSON);
315
316
  bool
317
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
318
319
  bool
320
  ToJSON(nsAString& aJSON) const;
321
322
  void
323
  TraceDictionary(JSTracer* trc);
324
325
  MozRequestMatchOptions&
326
  operator=(const MozRequestMatchOptions& aOther);
327
328
private:
329
  static bool
330
  InitIds(JSContext* cx, MozRequestMatchOptionsAtoms* atomsCache);
331
};
332
333
namespace binding_detail {
334
struct FastMozRequestMatchOptions : public MozRequestMatchOptions
335
{
336
  inline FastMozRequestMatchOptions()
337
    : MozRequestMatchOptions(FastDictionaryInitializer())
338
0
  {
339
0
    // Doesn't matter what int we pass to the parent constructor
340
0
  }
341
};
342
} // namespace binding_detail
343
344
345
namespace ChannelWrapper_Binding {
346
347
  typedef mozilla::extensions::ChannelWrapper NativeType;
348
349
  bool
350
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
351
352
  const JSClass*
353
  GetJSClass();
354
355
  bool
356
  Wrap(JSContext* aCx, mozilla::extensions::ChannelWrapper* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
357
358
  template <class T>
359
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
360
0
  {
361
0
    JS::Rooted<JSObject*> reflector(aCx);
362
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
363
0
  }
364
365
  void
366
  ClearCachedMethodValue(mozilla::extensions::ChannelWrapper* aObject);
367
368
  void
369
  ClearCachedTypeValue(mozilla::extensions::ChannelWrapper* aObject);
370
371
  void
372
  ClearCachedFinalURIValue(mozilla::extensions::ChannelWrapper* aObject);
373
374
  void
375
  ClearCachedFinalURLValue(mozilla::extensions::ChannelWrapper* aObject);
376
377
  void
378
  ClearCachedStatusCodeValue(mozilla::extensions::ChannelWrapper* aObject);
379
380
  void
381
  ClearCachedStatusLineValue(mozilla::extensions::ChannelWrapper* aObject);
382
383
  void
384
  ClearCachedErrorStringValue(mozilla::extensions::ChannelWrapper* aObject);
385
386
  void
387
  ClearCachedProxyInfoValue(mozilla::extensions::ChannelWrapper* aObject);
388
389
  void
390
  ClearCachedRemoteAddressValue(mozilla::extensions::ChannelWrapper* aObject);
391
392
  void
393
  ClearCachedLoadInfoValue(mozilla::extensions::ChannelWrapper* aObject);
394
395
  void
396
  ClearCachedIsSystemLoadValue(mozilla::extensions::ChannelWrapper* aObject);
397
398
  void
399
  ClearCachedOriginURLValue(mozilla::extensions::ChannelWrapper* aObject);
400
401
  void
402
  ClearCachedDocumentURLValue(mozilla::extensions::ChannelWrapper* aObject);
403
404
  void
405
  ClearCachedCanModifyValue(mozilla::extensions::ChannelWrapper* aObject);
406
407
  void
408
  ClearCachedBrowserElementValue(mozilla::extensions::ChannelWrapper* aObject);
409
410
  void
411
  ClearCachedFrameAncestorsValue(mozilla::extensions::ChannelWrapper* aObject);
412
413
  void
414
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
415
416
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
417
0
  {
418
0
    /* Get the interface prototype object for this class.  This will create the
419
0
       object as needed. */
420
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::ChannelWrapper,
421
0
                                       &CreateInterfaceObjects,
422
0
                                       /* aDefineOnGlobal = */ true);
423
0
424
0
  }
425
426
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
427
0
  {
428
0
    /* Get the interface object for this class.  This will create the object as
429
0
       needed. */
430
0
431
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::ChannelWrapper,
432
0
                                       &CreateInterfaceObjects,
433
0
                                       aDefineOnGlobal);
434
0
  }
435
436
  JSObject*
437
  GetConstructorObject(JSContext* aCx);
438
439
} // namespace ChannelWrapper_Binding
440
441
442
443
} // namespace dom
444
} // namespace mozilla
445
446
#endif // mozilla_dom_ChannelWrapperBinding_h