Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/FetchBinding.h
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM Fetch.webidl BY Codegen.py - DO NOT EDIT */
2
3
#ifndef mozilla_dom_FetchBinding_h
4
#define mozilla_dom_FetchBinding_h
5
6
#include "GeckoProfiler.h"
7
#include "js/RootingAPI.h"
8
#include "jsfriendapi.h"
9
#include "jspubtd.h"
10
#include "mozilla/ErrorResult.h"
11
#include "mozilla/dom/BindingDeclarations.h"
12
#include "mozilla/dom/FakeString.h"
13
#include "mozilla/dom/Nullable.h"
14
#include "mozilla/dom/TypedArray.h"
15
#include "mozilla/dom/UnionMember.h"
16
17
namespace mozilla {
18
namespace dom {
19
20
class Blob;
21
struct FetchReadableStreamReadDataArrayAtoms;
22
struct FetchReadableStreamReadDataDoneAtoms;
23
class FormData;
24
struct NativePropertyHooks;
25
class OwningBlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString;
26
class ProtoAndIfaceCache;
27
class URLSearchParams;
28
29
} // namespace dom
30
} // namespace mozilla
31
32
namespace mozilla {
33
namespace dom {
34
35
void
36
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback, OwningBlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString& aUnion, const char* aName, uint32_t aFlags = 0);
37
38
39
void
40
ImplCycleCollectionUnlink(OwningBlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString& aUnion);
41
42
43
class BlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString
44
{
45
  friend class BlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVStringArgument;
46
  enum Type
47
  {
48
    eUninitialized,
49
    eBlob,
50
    eArrayBufferView,
51
    eArrayBuffer,
52
    eFormData,
53
    eURLSearchParams,
54
    eUSVString
55
  };
56
57
  union Value
58
  {
59
    UnionMember<NonNull<mozilla::dom::Blob> > mBlob;
60
    UnionMember<RootedSpiderMonkeyInterface<ArrayBufferView> > mArrayBufferView;
61
    UnionMember<RootedSpiderMonkeyInterface<ArrayBuffer> > mArrayBuffer;
62
    UnionMember<NonNull<mozilla::dom::FormData> > mFormData;
63
    UnionMember<NonNull<mozilla::dom::URLSearchParams> > mURLSearchParams;
64
    UnionMember<binding_detail::FakeString > mUSVString;
65
66
  };
67
68
  Type mType;
69
  Value mValue;
70
71
  BlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString(const BlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString&) = delete;
72
  BlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString& operator=(const BlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString&) = delete;
73
public:
74
  explicit inline BlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString()
75
    : mType(eUninitialized)
76
0
  {
77
0
  }
78
79
  inline ~BlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString()
80
0
  {
81
0
    Uninit();
82
0
  }
83
84
  inline NonNull<mozilla::dom::Blob>&
85
  RawSetAsBlob()
86
0
  {
87
0
    if (mType == eBlob) {
88
0
      return mValue.mBlob.Value();
89
0
    }
90
0
    MOZ_ASSERT(mType == eUninitialized);
91
0
    mType = eBlob;
92
0
    return mValue.mBlob.SetValue();
93
0
  }
94
95
  inline NonNull<mozilla::dom::Blob>&
96
  SetAsBlob()
97
0
  {
98
0
    if (mType == eBlob) {
99
0
      return mValue.mBlob.Value();
100
0
    }
101
0
    Uninit();
102
0
    mType = eBlob;
103
0
    return mValue.mBlob.SetValue();
104
0
  }
105
106
  inline bool
107
  IsBlob() const
108
0
  {
109
0
    return mType == eBlob;
110
0
  }
111
112
  inline NonNull<mozilla::dom::Blob>&
113
  GetAsBlob()
114
0
  {
115
0
    MOZ_ASSERT(IsBlob(), "Wrong type!");
116
0
    return mValue.mBlob.Value();
117
0
  }
118
119
  inline mozilla::dom::Blob&
120
  GetAsBlob() const
121
0
  {
122
0
    MOZ_ASSERT(IsBlob(), "Wrong type!");
123
0
    return mValue.mBlob.Value();
124
0
  }
125
126
  inline RootedSpiderMonkeyInterface<ArrayBufferView>&
127
  RawSetAsArrayBufferView(JSContext* cx)
128
0
  {
129
0
    if (mType == eArrayBufferView) {
130
0
      return mValue.mArrayBufferView.Value();
131
0
    }
132
0
    MOZ_ASSERT(mType == eUninitialized);
133
0
    mType = eArrayBufferView;
134
0
    return mValue.mArrayBufferView.SetValue(cx);
135
0
  }
136
137
  inline RootedSpiderMonkeyInterface<ArrayBufferView>&
138
  SetAsArrayBufferView(JSContext* cx)
139
0
  {
140
0
    if (mType == eArrayBufferView) {
141
0
      return mValue.mArrayBufferView.Value();
142
0
    }
143
0
    Uninit();
144
0
    mType = eArrayBufferView;
145
0
    return mValue.mArrayBufferView.SetValue(cx);
146
0
  }
147
148
  inline bool
149
  IsArrayBufferView() const
150
0
  {
151
0
    return mType == eArrayBufferView;
152
0
  }
153
154
  inline RootedSpiderMonkeyInterface<ArrayBufferView>&
155
  GetAsArrayBufferView()
156
0
  {
157
0
    MOZ_ASSERT(IsArrayBufferView(), "Wrong type!");
158
0
    return mValue.mArrayBufferView.Value();
159
0
  }
160
161
  inline ArrayBufferView const &
162
  GetAsArrayBufferView() const
163
0
  {
164
0
    MOZ_ASSERT(IsArrayBufferView(), "Wrong type!");
165
0
    return mValue.mArrayBufferView.Value();
166
0
  }
167
168
  inline RootedSpiderMonkeyInterface<ArrayBuffer>&
169
  RawSetAsArrayBuffer(JSContext* cx)
170
0
  {
171
0
    if (mType == eArrayBuffer) {
172
0
      return mValue.mArrayBuffer.Value();
173
0
    }
174
0
    MOZ_ASSERT(mType == eUninitialized);
175
0
    mType = eArrayBuffer;
176
0
    return mValue.mArrayBuffer.SetValue(cx);
177
0
  }
178
179
  inline RootedSpiderMonkeyInterface<ArrayBuffer>&
180
  SetAsArrayBuffer(JSContext* cx)
181
0
  {
182
0
    if (mType == eArrayBuffer) {
183
0
      return mValue.mArrayBuffer.Value();
184
0
    }
185
0
    Uninit();
186
0
    mType = eArrayBuffer;
187
0
    return mValue.mArrayBuffer.SetValue(cx);
188
0
  }
189
190
  inline bool
191
  IsArrayBuffer() const
192
0
  {
193
0
    return mType == eArrayBuffer;
194
0
  }
195
196
  inline RootedSpiderMonkeyInterface<ArrayBuffer>&
197
  GetAsArrayBuffer()
198
0
  {
199
0
    MOZ_ASSERT(IsArrayBuffer(), "Wrong type!");
200
0
    return mValue.mArrayBuffer.Value();
201
0
  }
202
203
  inline ArrayBuffer const &
204
  GetAsArrayBuffer() const
205
0
  {
206
0
    MOZ_ASSERT(IsArrayBuffer(), "Wrong type!");
207
0
    return mValue.mArrayBuffer.Value();
208
0
  }
209
210
  inline NonNull<mozilla::dom::FormData>&
211
  RawSetAsFormData()
212
0
  {
213
0
    if (mType == eFormData) {
214
0
      return mValue.mFormData.Value();
215
0
    }
216
0
    MOZ_ASSERT(mType == eUninitialized);
217
0
    mType = eFormData;
218
0
    return mValue.mFormData.SetValue();
219
0
  }
220
221
  inline NonNull<mozilla::dom::FormData>&
222
  SetAsFormData()
223
0
  {
224
0
    if (mType == eFormData) {
225
0
      return mValue.mFormData.Value();
226
0
    }
227
0
    Uninit();
228
0
    mType = eFormData;
229
0
    return mValue.mFormData.SetValue();
230
0
  }
231
232
  inline bool
233
  IsFormData() const
234
0
  {
235
0
    return mType == eFormData;
236
0
  }
237
238
  inline NonNull<mozilla::dom::FormData>&
239
  GetAsFormData()
240
0
  {
241
0
    MOZ_ASSERT(IsFormData(), "Wrong type!");
242
0
    return mValue.mFormData.Value();
243
0
  }
244
245
  inline mozilla::dom::FormData&
246
  GetAsFormData() const
247
0
  {
248
0
    MOZ_ASSERT(IsFormData(), "Wrong type!");
249
0
    return mValue.mFormData.Value();
250
0
  }
251
252
  inline NonNull<mozilla::dom::URLSearchParams>&
253
  RawSetAsURLSearchParams()
254
0
  {
255
0
    if (mType == eURLSearchParams) {
256
0
      return mValue.mURLSearchParams.Value();
257
0
    }
258
0
    MOZ_ASSERT(mType == eUninitialized);
259
0
    mType = eURLSearchParams;
260
0
    return mValue.mURLSearchParams.SetValue();
261
0
  }
262
263
  inline NonNull<mozilla::dom::URLSearchParams>&
264
  SetAsURLSearchParams()
265
0
  {
266
0
    if (mType == eURLSearchParams) {
267
0
      return mValue.mURLSearchParams.Value();
268
0
    }
269
0
    Uninit();
270
0
    mType = eURLSearchParams;
271
0
    return mValue.mURLSearchParams.SetValue();
272
0
  }
273
274
  inline bool
275
  IsURLSearchParams() const
276
0
  {
277
0
    return mType == eURLSearchParams;
278
0
  }
279
280
  inline NonNull<mozilla::dom::URLSearchParams>&
281
  GetAsURLSearchParams()
282
0
  {
283
0
    MOZ_ASSERT(IsURLSearchParams(), "Wrong type!");
284
0
    return mValue.mURLSearchParams.Value();
285
0
  }
286
287
  inline mozilla::dom::URLSearchParams&
288
  GetAsURLSearchParams() const
289
0
  {
290
0
    MOZ_ASSERT(IsURLSearchParams(), "Wrong type!");
291
0
    return mValue.mURLSearchParams.Value();
292
0
  }
293
294
  inline binding_detail::FakeString&
295
  RawSetAsUSVString()
296
0
  {
297
0
    if (mType == eUSVString) {
298
0
      return mValue.mUSVString.Value();
299
0
    }
300
0
    MOZ_ASSERT(mType == eUninitialized);
301
0
    mType = eUSVString;
302
0
    return mValue.mUSVString.SetValue();
303
0
  }
304
305
  inline binding_detail::FakeString&
306
  SetAsUSVString()
307
0
  {
308
0
    if (mType == eUSVString) {
309
0
      return mValue.mUSVString.Value();
310
0
    }
311
0
    Uninit();
312
0
    mType = eUSVString;
313
0
    return mValue.mUSVString.SetValue();
314
0
  }
315
316
  inline bool
317
  IsUSVString() const
318
0
  {
319
0
    return mType == eUSVString;
320
0
  }
321
322
  inline binding_detail::FakeString&
323
  GetAsUSVString()
324
0
  {
325
0
    MOZ_ASSERT(IsUSVString(), "Wrong type!");
326
0
    return mValue.mUSVString.Value();
327
0
  }
328
329
  inline const nsAString&
330
  GetAsUSVString() const
331
0
  {
332
0
    MOZ_ASSERT(IsUSVString(), "Wrong type!");
333
0
    return mValue.mUSVString.Value();
334
0
  }
335
336
  inline void
337
  Uninit()
338
  {
339
    switch (mType) {
340
      case eUninitialized: {
341
        break;
342
      }
343
      case eBlob: {
344
        DestroyBlob();
345
        break;
346
      }
347
      case eArrayBufferView: {
348
        DestroyArrayBufferView();
349
        break;
350
      }
351
      case eArrayBuffer: {
352
        DestroyArrayBuffer();
353
        break;
354
      }
355
      case eFormData: {
356
        DestroyFormData();
357
        break;
358
      }
359
      case eURLSearchParams: {
360
        DestroyURLSearchParams();
361
        break;
362
      }
363
      case eUSVString: {
364
        DestroyUSVString();
365
        break;
366
      }
367
    }
368
  }
369
370
  bool
371
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
372
373
private:
374
  inline void
375
  DestroyBlob()
376
0
  {
377
0
    MOZ_ASSERT(IsBlob(), "Wrong type!");
378
0
    mValue.mBlob.Destroy();
379
0
    mType = eUninitialized;
380
0
  }
381
382
  inline void
383
  DestroyArrayBufferView()
384
0
  {
385
0
    MOZ_ASSERT(IsArrayBufferView(), "Wrong type!");
386
0
    mValue.mArrayBufferView.Destroy();
387
0
    mType = eUninitialized;
388
0
  }
389
390
  inline void
391
  DestroyArrayBuffer()
392
0
  {
393
0
    MOZ_ASSERT(IsArrayBuffer(), "Wrong type!");
394
0
    mValue.mArrayBuffer.Destroy();
395
0
    mType = eUninitialized;
396
0
  }
397
398
  inline void
399
  DestroyFormData()
400
0
  {
401
0
    MOZ_ASSERT(IsFormData(), "Wrong type!");
402
0
    mValue.mFormData.Destroy();
403
0
    mType = eUninitialized;
404
0
  }
405
406
  inline void
407
  DestroyURLSearchParams()
408
0
  {
409
0
    MOZ_ASSERT(IsURLSearchParams(), "Wrong type!");
410
0
    mValue.mURLSearchParams.Destroy();
411
0
    mType = eUninitialized;
412
0
  }
413
414
  inline void
415
  DestroyUSVString()
416
0
  {
417
0
    MOZ_ASSERT(IsUSVString(), "Wrong type!");
418
0
    mValue.mUSVString.Destroy();
419
0
    mType = eUninitialized;
420
0
  }
421
};
422
423
424
class OwningBlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString : public AllOwningUnionBase
425
{
426
  friend void ImplCycleCollectionUnlink(OwningBlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString& aUnion);
427
  enum Type
428
  {
429
    eUninitialized,
430
    eBlob,
431
    eArrayBufferView,
432
    eArrayBuffer,
433
    eFormData,
434
    eURLSearchParams,
435
    eUSVString
436
  };
437
438
  union Value
439
  {
440
    UnionMember<OwningNonNull<mozilla::dom::Blob> > mBlob;
441
    UnionMember<ArrayBufferView > mArrayBufferView;
442
    UnionMember<ArrayBuffer > mArrayBuffer;
443
    UnionMember<OwningNonNull<mozilla::dom::FormData> > mFormData;
444
    UnionMember<OwningNonNull<mozilla::dom::URLSearchParams> > mURLSearchParams;
445
    UnionMember<nsString > mUSVString;
446
447
  };
448
449
  Type mType;
450
  Value mValue;
451
452
  OwningBlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString(const OwningBlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString&) = delete;
453
  OwningBlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString& operator=(const OwningBlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString&) = delete;
454
public:
455
  explicit inline OwningBlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString()
456
    : mType(eUninitialized)
457
0
  {
458
0
  }
459
460
  inline ~OwningBlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString()
461
0
  {
462
0
    Uninit();
463
0
  }
464
465
  OwningNonNull<mozilla::dom::Blob>&
466
  RawSetAsBlob();
467
468
  OwningNonNull<mozilla::dom::Blob>&
469
  SetAsBlob();
470
471
  bool
472
  TrySetToBlob(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
473
474
  inline bool
475
  IsBlob() const
476
0
  {
477
0
    return mType == eBlob;
478
0
  }
479
480
  inline OwningNonNull<mozilla::dom::Blob>&
481
  GetAsBlob()
482
0
  {
483
0
    MOZ_ASSERT(IsBlob(), "Wrong type!");
484
0
    return mValue.mBlob.Value();
485
0
  }
486
487
  inline OwningNonNull<mozilla::dom::Blob> const &
488
  GetAsBlob() const
489
0
  {
490
0
    MOZ_ASSERT(IsBlob(), "Wrong type!");
491
0
    return mValue.mBlob.Value();
492
0
  }
493
494
  ArrayBufferView&
495
  RawSetAsArrayBufferView();
496
497
  ArrayBufferView&
498
  SetAsArrayBufferView();
499
500
  bool
501
  TrySetToArrayBufferView(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
502
503
  inline bool
504
  IsArrayBufferView() const
505
0
  {
506
0
    return mType == eArrayBufferView;
507
0
  }
508
509
  inline ArrayBufferView&
510
  GetAsArrayBufferView()
511
0
  {
512
0
    MOZ_ASSERT(IsArrayBufferView(), "Wrong type!");
513
0
    return mValue.mArrayBufferView.Value();
514
0
  }
515
516
  inline ArrayBufferView const &
517
  GetAsArrayBufferView() const
518
0
  {
519
0
    MOZ_ASSERT(IsArrayBufferView(), "Wrong type!");
520
0
    return mValue.mArrayBufferView.Value();
521
0
  }
522
523
  ArrayBuffer&
524
  RawSetAsArrayBuffer();
525
526
  ArrayBuffer&
527
  SetAsArrayBuffer();
528
529
  bool
530
  TrySetToArrayBuffer(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
531
532
  inline bool
533
  IsArrayBuffer() const
534
0
  {
535
0
    return mType == eArrayBuffer;
536
0
  }
537
538
  inline ArrayBuffer&
539
  GetAsArrayBuffer()
540
0
  {
541
0
    MOZ_ASSERT(IsArrayBuffer(), "Wrong type!");
542
0
    return mValue.mArrayBuffer.Value();
543
0
  }
544
545
  inline ArrayBuffer const &
546
  GetAsArrayBuffer() const
547
0
  {
548
0
    MOZ_ASSERT(IsArrayBuffer(), "Wrong type!");
549
0
    return mValue.mArrayBuffer.Value();
550
0
  }
551
552
  OwningNonNull<mozilla::dom::FormData>&
553
  RawSetAsFormData();
554
555
  OwningNonNull<mozilla::dom::FormData>&
556
  SetAsFormData();
557
558
  bool
559
  TrySetToFormData(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
560
561
  inline bool
562
  IsFormData() const
563
0
  {
564
0
    return mType == eFormData;
565
0
  }
566
567
  inline OwningNonNull<mozilla::dom::FormData>&
568
  GetAsFormData()
569
0
  {
570
0
    MOZ_ASSERT(IsFormData(), "Wrong type!");
571
0
    return mValue.mFormData.Value();
572
0
  }
573
574
  inline OwningNonNull<mozilla::dom::FormData> const &
575
  GetAsFormData() const
576
0
  {
577
0
    MOZ_ASSERT(IsFormData(), "Wrong type!");
578
0
    return mValue.mFormData.Value();
579
0
  }
580
581
  OwningNonNull<mozilla::dom::URLSearchParams>&
582
  RawSetAsURLSearchParams();
583
584
  OwningNonNull<mozilla::dom::URLSearchParams>&
585
  SetAsURLSearchParams();
586
587
  bool
588
  TrySetToURLSearchParams(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
589
590
  inline bool
591
  IsURLSearchParams() const
592
0
  {
593
0
    return mType == eURLSearchParams;
594
0
  }
595
596
  inline OwningNonNull<mozilla::dom::URLSearchParams>&
597
  GetAsURLSearchParams()
598
0
  {
599
0
    MOZ_ASSERT(IsURLSearchParams(), "Wrong type!");
600
0
    return mValue.mURLSearchParams.Value();
601
0
  }
602
603
  inline OwningNonNull<mozilla::dom::URLSearchParams> const &
604
  GetAsURLSearchParams() const
605
0
  {
606
0
    MOZ_ASSERT(IsURLSearchParams(), "Wrong type!");
607
0
    return mValue.mURLSearchParams.Value();
608
0
  }
609
610
  nsString&
611
  RawSetAsUSVString();
612
613
  nsString&
614
  SetAsUSVString();
615
616
  bool
617
  TrySetToUSVString(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
618
619
  inline void
620
  SetStringData(const nsString::char_type* aData, nsString::size_type aLength)
621
0
  {
622
0
    RawSetAsUSVString().Assign(aData, aLength);
623
0
  }
624
625
  inline bool
626
  IsUSVString() const
627
0
  {
628
0
    return mType == eUSVString;
629
0
  }
630
631
  inline nsString&
632
  GetAsUSVString()
633
0
  {
634
0
    MOZ_ASSERT(IsUSVString(), "Wrong type!");
635
0
    return mValue.mUSVString.Value();
636
0
  }
637
638
  inline nsString const &
639
  GetAsUSVString() const
640
0
  {
641
0
    MOZ_ASSERT(IsUSVString(), "Wrong type!");
642
0
    return mValue.mUSVString.Value();
643
0
  }
644
645
  void
646
  Uninit();
647
648
  bool
649
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
650
651
  void
652
  TraceUnion(JSTracer* trc);
653
654
private:
655
  void
656
  DestroyBlob();
657
658
  void
659
  DestroyArrayBufferView();
660
661
  void
662
  DestroyArrayBuffer();
663
664
  void
665
  DestroyFormData();
666
667
  void
668
  DestroyURLSearchParams();
669
670
  void
671
  DestroyUSVString();
672
};
673
674
675
struct FetchReadableStreamReadDataArray : public DictionaryBase
676
{
677
  MOZ_INIT_OUTSIDE_CTOR Optional<Uint8Array> mValue;
678
679
  FetchReadableStreamReadDataArray();
680
681
  explicit inline FetchReadableStreamReadDataArray(const FastDictionaryInitializer& )
682
0
  {
683
0
    // Do nothing here; this is used by our "Fast" subclass
684
0
  }
685
686
private:
687
  FetchReadableStreamReadDataArray(const FetchReadableStreamReadDataArray&) = delete;
688
  FetchReadableStreamReadDataArray& operator=(const FetchReadableStreamReadDataArray&) = delete;
689
690
  static bool
691
  InitIds(JSContext* cx, FetchReadableStreamReadDataArrayAtoms* atomsCache);
692
693
public:
694
  bool
695
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
696
697
  bool
698
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
699
700
  void
701
  TraceDictionary(JSTracer* trc);
702
};
703
704
namespace binding_detail {
705
struct FastFetchReadableStreamReadDataArray : public FetchReadableStreamReadDataArray
706
{
707
  inline FastFetchReadableStreamReadDataArray()
708
    : FetchReadableStreamReadDataArray(FastDictionaryInitializer())
709
0
  {
710
0
    // Doesn't matter what int we pass to the parent constructor
711
0
  }
712
};
713
} // namespace binding_detail
714
715
716
struct FetchReadableStreamReadDataDone : public DictionaryBase
717
{
718
  MOZ_INIT_OUTSIDE_CTOR bool mDone;
719
720
  FetchReadableStreamReadDataDone();
721
722
  explicit inline FetchReadableStreamReadDataDone(const FastDictionaryInitializer& )
723
0
  {
724
0
    // Do nothing here; this is used by our "Fast" subclass
725
0
  }
726
727
  explicit inline FetchReadableStreamReadDataDone(const FetchReadableStreamReadDataDone& aOther)
728
0
  {
729
0
    *this = aOther;
730
0
  }
731
732
  bool
733
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
734
735
  bool
736
  Init(const nsAString& aJSON);
737
738
  bool
739
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
740
741
  bool
742
  ToJSON(nsAString& aJSON) const;
743
744
  void
745
  TraceDictionary(JSTracer* trc);
746
747
  FetchReadableStreamReadDataDone&
748
  operator=(const FetchReadableStreamReadDataDone& aOther);
749
750
private:
751
  static bool
752
  InitIds(JSContext* cx, FetchReadableStreamReadDataDoneAtoms* atomsCache);
753
};
754
755
namespace binding_detail {
756
struct FastFetchReadableStreamReadDataDone : public FetchReadableStreamReadDataDone
757
{
758
  inline FastFetchReadableStreamReadDataDone()
759
    : FetchReadableStreamReadDataDone(FastDictionaryInitializer())
760
0
  {
761
0
    // Doesn't matter what int we pass to the parent constructor
762
0
  }
763
};
764
} // namespace binding_detail
765
766
767
} // namespace dom
768
} // namespace mozilla
769
770
#endif // mozilla_dom_FetchBinding_h