Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/WebAuthenticationBinding.h
Line
Count
Source (jump to first uncovered line)
1
/* THIS FILE IS AUTOGENERATED FROM WebAuthentication.webidl BY Codegen.py - DO NOT EDIT */
2
3
#ifndef mozilla_dom_WebAuthenticationBinding_h
4
#define mozilla_dom_WebAuthenticationBinding_h
5
6
#include "GeckoProfiler.h"
7
#include "WebAuthenticationBinding.h"
8
#include "js/RootingAPI.h"
9
#include "jspubtd.h"
10
#include "mozilla/ErrorResult.h"
11
#include "mozilla/dom/BindingDeclarations.h"
12
#include "mozilla/dom/Nullable.h"
13
#include "mozilla/dom/PrototypeList.h"
14
#include "mozilla/dom/Record.h"
15
#include "mozilla/dom/UnionTypes.h"
16
17
namespace mozilla {
18
namespace dom {
19
20
class ArrayBufferViewOrArrayBuffer;
21
struct AuthenticationExtensionsClientInputs;
22
struct AuthenticationExtensionsClientInputsAtoms;
23
struct AuthenticationExtensionsClientOutputsAtoms;
24
class AuthenticatorAssertionResponse;
25
struct AuthenticatorAssertionResponseAtoms;
26
class AuthenticatorAttestationResponse;
27
struct AuthenticatorAttestationResponseAtoms;
28
class AuthenticatorResponse;
29
struct AuthenticatorResponseAtoms;
30
struct AuthenticatorSelectionCriteria;
31
struct AuthenticatorSelectionCriteriaAtoms;
32
struct CollectedClientDataAtoms;
33
struct NativePropertyHooks;
34
class OwningArrayBufferViewOrArrayBuffer;
35
class ProtoAndIfaceCache;
36
class PublicKeyCredential;
37
struct PublicKeyCredentialAtoms;
38
struct PublicKeyCredentialCreationOptionsAtoms;
39
struct PublicKeyCredentialDescriptor;
40
struct PublicKeyCredentialDescriptorAtoms;
41
struct PublicKeyCredentialEntityAtoms;
42
struct PublicKeyCredentialParameters;
43
struct PublicKeyCredentialParametersAtoms;
44
struct PublicKeyCredentialRequestOptionsAtoms;
45
struct PublicKeyCredentialRpEntity;
46
struct PublicKeyCredentialRpEntityAtoms;
47
struct PublicKeyCredentialUserEntity;
48
struct PublicKeyCredentialUserEntityAtoms;
49
50
} // namespace dom
51
} // namespace mozilla
52
53
namespace mozilla {
54
namespace dom {
55
56
enum class AuthenticatorAttachment : uint8_t {
57
  Platform,
58
  Cross_platform,
59
  EndGuard_
60
};
61
62
namespace AuthenticatorAttachmentValues {
63
extern const EnumEntry strings[3];
64
} // namespace AuthenticatorAttachmentValues
65
66
bool
67
ToJSValue(JSContext* aCx, AuthenticatorAttachment aArgument, JS::MutableHandle<JS::Value> aValue);
68
69
70
enum class AttestationConveyancePreference : uint8_t {
71
  None,
72
  Indirect,
73
  Direct,
74
  EndGuard_
75
};
76
77
namespace AttestationConveyancePreferenceValues {
78
extern const EnumEntry strings[4];
79
} // namespace AttestationConveyancePreferenceValues
80
81
bool
82
ToJSValue(JSContext* aCx, AttestationConveyancePreference aArgument, JS::MutableHandle<JS::Value> aValue);
83
84
85
enum class UserVerificationRequirement : uint8_t {
86
  Required,
87
  Preferred,
88
  Discouraged,
89
  EndGuard_
90
};
91
92
namespace UserVerificationRequirementValues {
93
extern const EnumEntry strings[4];
94
} // namespace UserVerificationRequirementValues
95
96
bool
97
ToJSValue(JSContext* aCx, UserVerificationRequirement aArgument, JS::MutableHandle<JS::Value> aValue);
98
99
100
enum class PublicKeyCredentialType : uint8_t {
101
  Public_key,
102
  EndGuard_
103
};
104
105
namespace PublicKeyCredentialTypeValues {
106
extern const EnumEntry strings[2];
107
} // namespace PublicKeyCredentialTypeValues
108
109
bool
110
ToJSValue(JSContext* aCx, PublicKeyCredentialType aArgument, JS::MutableHandle<JS::Value> aValue);
111
112
113
enum class AuthenticatorTransport : uint8_t {
114
  Usb,
115
  Nfc,
116
  Ble,
117
  EndGuard_
118
};
119
120
namespace AuthenticatorTransportValues {
121
extern const EnumEntry strings[4];
122
} // namespace AuthenticatorTransportValues
123
124
bool
125
ToJSValue(JSContext* aCx, AuthenticatorTransport aArgument, JS::MutableHandle<JS::Value> aValue);
126
127
128
struct AuthenticationExtensionsClientInputs : public DictionaryBase
129
{
130
  MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mAppid;
131
132
  AuthenticationExtensionsClientInputs();
133
134
  explicit inline AuthenticationExtensionsClientInputs(const FastDictionaryInitializer& )
135
0
  {
136
0
    // Do nothing here; this is used by our "Fast" subclass
137
0
  }
138
139
  explicit inline AuthenticationExtensionsClientInputs(const AuthenticationExtensionsClientInputs& aOther)
140
0
  {
141
0
    *this = aOther;
142
0
  }
143
144
  bool
145
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
146
147
  bool
148
  Init(const nsAString& aJSON);
149
150
  bool
151
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
152
153
  bool
154
  ToJSON(nsAString& aJSON) const;
155
156
  void
157
  TraceDictionary(JSTracer* trc);
158
159
  AuthenticationExtensionsClientInputs&
160
  operator=(const AuthenticationExtensionsClientInputs& aOther);
161
162
private:
163
  static bool
164
  InitIds(JSContext* cx, AuthenticationExtensionsClientInputsAtoms* atomsCache);
165
};
166
167
namespace binding_detail {
168
struct FastAuthenticationExtensionsClientInputs : public AuthenticationExtensionsClientInputs
169
{
170
  inline FastAuthenticationExtensionsClientInputs()
171
    : AuthenticationExtensionsClientInputs(FastDictionaryInitializer())
172
0
  {
173
0
    // Doesn't matter what int we pass to the parent constructor
174
0
  }
175
};
176
} // namespace binding_detail
177
178
179
struct AuthenticationExtensionsClientOutputs : public DictionaryBase
180
{
181
  MOZ_INIT_OUTSIDE_CTOR Optional<bool> mAppid;
182
183
  AuthenticationExtensionsClientOutputs();
184
185
  explicit inline AuthenticationExtensionsClientOutputs(const FastDictionaryInitializer& )
186
0
  {
187
0
    // Do nothing here; this is used by our "Fast" subclass
188
0
  }
189
190
  explicit inline AuthenticationExtensionsClientOutputs(const AuthenticationExtensionsClientOutputs& aOther)
191
0
  {
192
0
    *this = aOther;
193
0
  }
194
195
  bool
196
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
197
198
  bool
199
  Init(const nsAString& aJSON);
200
201
  bool
202
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
203
204
  bool
205
  ToJSON(nsAString& aJSON) const;
206
207
  void
208
  TraceDictionary(JSTracer* trc);
209
210
  AuthenticationExtensionsClientOutputs&
211
  operator=(const AuthenticationExtensionsClientOutputs& aOther);
212
213
private:
214
  static bool
215
  InitIds(JSContext* cx, AuthenticationExtensionsClientOutputsAtoms* atomsCache);
216
};
217
218
namespace binding_detail {
219
struct FastAuthenticationExtensionsClientOutputs : public AuthenticationExtensionsClientOutputs
220
{
221
  inline FastAuthenticationExtensionsClientOutputs()
222
    : AuthenticationExtensionsClientOutputs(FastDictionaryInitializer())
223
0
  {
224
0
    // Doesn't matter what int we pass to the parent constructor
225
0
  }
226
};
227
} // namespace binding_detail
228
229
230
struct AuthenticatorSelectionCriteria : public DictionaryBase
231
{
232
  MOZ_INIT_OUTSIDE_CTOR Optional<AuthenticatorAttachment> mAuthenticatorAttachment;
233
  MOZ_INIT_OUTSIDE_CTOR bool mRequireResidentKey;
234
  MOZ_INIT_OUTSIDE_CTOR UserVerificationRequirement mUserVerification;
235
236
  AuthenticatorSelectionCriteria();
237
238
  explicit inline AuthenticatorSelectionCriteria(const FastDictionaryInitializer& )
239
0
  {
240
0
    // Do nothing here; this is used by our "Fast" subclass
241
0
  }
242
243
  explicit inline AuthenticatorSelectionCriteria(const AuthenticatorSelectionCriteria& aOther)
244
0
  {
245
0
    *this = aOther;
246
0
  }
247
248
  bool
249
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
250
251
  bool
252
  Init(const nsAString& aJSON);
253
254
  bool
255
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
256
257
  bool
258
  ToJSON(nsAString& aJSON) const;
259
260
  void
261
  TraceDictionary(JSTracer* trc);
262
263
  AuthenticatorSelectionCriteria&
264
  operator=(const AuthenticatorSelectionCriteria& aOther);
265
266
private:
267
  static bool
268
  InitIds(JSContext* cx, AuthenticatorSelectionCriteriaAtoms* atomsCache);
269
};
270
271
namespace binding_detail {
272
struct FastAuthenticatorSelectionCriteria : public AuthenticatorSelectionCriteria
273
{
274
  inline FastAuthenticatorSelectionCriteria()
275
    : AuthenticatorSelectionCriteria(FastDictionaryInitializer())
276
0
  {
277
0
    // Doesn't matter what int we pass to the parent constructor
278
0
  }
279
};
280
} // namespace binding_detail
281
282
283
struct PublicKeyCredentialDescriptor : public DictionaryBase
284
{
285
  MOZ_INIT_OUTSIDE_CTOR OwningArrayBufferViewOrArrayBuffer mId;
286
  MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<AuthenticatorTransport>> mTransports;
287
  MOZ_INIT_OUTSIDE_CTOR PublicKeyCredentialType mType;
288
289
  PublicKeyCredentialDescriptor();
290
291
  explicit inline PublicKeyCredentialDescriptor(const FastDictionaryInitializer& )
292
0
  {
293
0
    // Do nothing here; this is used by our "Fast" subclass
294
0
  }
295
296
private:
297
  PublicKeyCredentialDescriptor(const PublicKeyCredentialDescriptor&) = delete;
298
  PublicKeyCredentialDescriptor& operator=(const PublicKeyCredentialDescriptor&) = delete;
299
300
  static bool
301
  InitIds(JSContext* cx, PublicKeyCredentialDescriptorAtoms* atomsCache);
302
303
public:
304
  bool
305
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
306
307
  bool
308
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
309
310
  void
311
  TraceDictionary(JSTracer* trc);
312
};
313
314
namespace binding_detail {
315
struct FastPublicKeyCredentialDescriptor : public PublicKeyCredentialDescriptor
316
{
317
  inline FastPublicKeyCredentialDescriptor()
318
    : PublicKeyCredentialDescriptor(FastDictionaryInitializer())
319
0
  {
320
0
    // Doesn't matter what int we pass to the parent constructor
321
0
  }
322
};
323
} // namespace binding_detail
324
325
326
struct PublicKeyCredentialEntity : public DictionaryBase
327
{
328
  MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mIcon;
329
  MOZ_INIT_OUTSIDE_CTOR nsString mName;
330
331
  PublicKeyCredentialEntity();
332
333
  explicit inline PublicKeyCredentialEntity(const FastDictionaryInitializer& )
334
0
  {
335
0
    // Do nothing here; this is used by our "Fast" subclass
336
0
  }
337
338
  explicit inline PublicKeyCredentialEntity(const PublicKeyCredentialEntity& aOther)
339
0
  {
340
0
    *this = aOther;
341
0
  }
342
343
  bool
344
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
345
346
  bool
347
  Init(const nsAString& aJSON);
348
349
  bool
350
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
351
352
  bool
353
  ToJSON(nsAString& aJSON) const;
354
355
  void
356
  TraceDictionary(JSTracer* trc);
357
358
  PublicKeyCredentialEntity&
359
  operator=(const PublicKeyCredentialEntity& aOther);
360
361
private:
362
  static bool
363
  InitIds(JSContext* cx, PublicKeyCredentialEntityAtoms* atomsCache);
364
};
365
366
namespace binding_detail {
367
struct FastPublicKeyCredentialEntity : public PublicKeyCredentialEntity
368
{
369
  inline FastPublicKeyCredentialEntity()
370
    : PublicKeyCredentialEntity(FastDictionaryInitializer())
371
0
  {
372
0
    // Doesn't matter what int we pass to the parent constructor
373
0
  }
374
};
375
} // namespace binding_detail
376
377
378
struct PublicKeyCredentialParameters : public DictionaryBase
379
{
380
  MOZ_INIT_OUTSIDE_CTOR int32_t mAlg;
381
  MOZ_INIT_OUTSIDE_CTOR PublicKeyCredentialType mType;
382
383
  PublicKeyCredentialParameters();
384
385
  explicit inline PublicKeyCredentialParameters(const FastDictionaryInitializer& )
386
0
  {
387
0
    // Do nothing here; this is used by our "Fast" subclass
388
0
  }
389
390
  explicit inline PublicKeyCredentialParameters(const PublicKeyCredentialParameters& aOther)
391
0
  {
392
0
    *this = aOther;
393
0
  }
394
395
  bool
396
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
397
398
  bool
399
  Init(const nsAString& aJSON);
400
401
  bool
402
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
403
404
  bool
405
  ToJSON(nsAString& aJSON) const;
406
407
  void
408
  TraceDictionary(JSTracer* trc);
409
410
  PublicKeyCredentialParameters&
411
  operator=(const PublicKeyCredentialParameters& aOther);
412
413
private:
414
  static bool
415
  InitIds(JSContext* cx, PublicKeyCredentialParametersAtoms* atomsCache);
416
};
417
418
namespace binding_detail {
419
struct FastPublicKeyCredentialParameters : public PublicKeyCredentialParameters
420
{
421
  inline FastPublicKeyCredentialParameters()
422
    : PublicKeyCredentialParameters(FastDictionaryInitializer())
423
0
  {
424
0
    // Doesn't matter what int we pass to the parent constructor
425
0
  }
426
};
427
} // namespace binding_detail
428
429
430
struct CollectedClientData : public DictionaryBase
431
{
432
  MOZ_INIT_OUTSIDE_CTOR Optional<Record<nsString, nsString>> mAuthenticatorExtensions;
433
  MOZ_INIT_OUTSIDE_CTOR nsString mChallenge;
434
  MOZ_INIT_OUTSIDE_CTOR AuthenticationExtensionsClientInputs mClientExtensions;
435
  MOZ_INIT_OUTSIDE_CTOR nsString mHashAlgorithm;
436
  MOZ_INIT_OUTSIDE_CTOR nsString mOrigin;
437
  MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mTokenBindingId;
438
  MOZ_INIT_OUTSIDE_CTOR nsString mType;
439
440
  CollectedClientData();
441
442
  explicit inline CollectedClientData(const FastDictionaryInitializer& )
443
    : mClientExtensions(FastDictionaryInitializer())
444
0
  {
445
0
    // Do nothing here; this is used by our "Fast" subclass
446
0
  }
447
448
private:
449
  CollectedClientData(const CollectedClientData&) = delete;
450
  CollectedClientData& operator=(const CollectedClientData&) = delete;
451
452
  static bool
453
  InitIds(JSContext* cx, CollectedClientDataAtoms* atomsCache);
454
455
public:
456
  bool
457
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
458
459
  bool
460
  Init(const nsAString& aJSON);
461
462
  bool
463
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
464
465
  bool
466
  ToJSON(nsAString& aJSON) const;
467
468
  void
469
  TraceDictionary(JSTracer* trc);
470
};
471
472
namespace binding_detail {
473
struct FastCollectedClientData : public CollectedClientData
474
{
475
  inline FastCollectedClientData()
476
    : CollectedClientData(FastDictionaryInitializer())
477
0
  {
478
0
    // Doesn't matter what int we pass to the parent constructor
479
0
  }
480
};
481
} // namespace binding_detail
482
483
484
struct PublicKeyCredentialRequestOptions : public DictionaryBase
485
{
486
  MOZ_INIT_OUTSIDE_CTOR Sequence<PublicKeyCredentialDescriptor> mAllowCredentials;
487
  MOZ_INIT_OUTSIDE_CTOR OwningArrayBufferViewOrArrayBuffer mChallenge;
488
  MOZ_INIT_OUTSIDE_CTOR AuthenticationExtensionsClientInputs mExtensions;
489
  MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mRpId;
490
  MOZ_INIT_OUTSIDE_CTOR Optional<uint32_t> mTimeout;
491
  MOZ_INIT_OUTSIDE_CTOR UserVerificationRequirement mUserVerification;
492
493
  PublicKeyCredentialRequestOptions();
494
495
  explicit inline PublicKeyCredentialRequestOptions(const FastDictionaryInitializer& )
496
    : mExtensions(FastDictionaryInitializer())
497
0
  {
498
0
    // Do nothing here; this is used by our "Fast" subclass
499
0
  }
500
501
private:
502
  PublicKeyCredentialRequestOptions(const PublicKeyCredentialRequestOptions&) = delete;
503
  PublicKeyCredentialRequestOptions& operator=(const PublicKeyCredentialRequestOptions&) = delete;
504
505
  static bool
506
  InitIds(JSContext* cx, PublicKeyCredentialRequestOptionsAtoms* atomsCache);
507
508
public:
509
  bool
510
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
511
512
  bool
513
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
514
515
  void
516
  TraceDictionary(JSTracer* trc);
517
};
518
519
namespace binding_detail {
520
struct FastPublicKeyCredentialRequestOptions : public PublicKeyCredentialRequestOptions
521
{
522
  inline FastPublicKeyCredentialRequestOptions()
523
    : PublicKeyCredentialRequestOptions(FastDictionaryInitializer())
524
0
  {
525
0
    // Doesn't matter what int we pass to the parent constructor
526
0
  }
527
};
528
} // namespace binding_detail
529
530
531
struct PublicKeyCredentialRpEntity : public PublicKeyCredentialEntity
532
{
533
  MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mId;
534
535
  PublicKeyCredentialRpEntity();
536
537
  explicit inline PublicKeyCredentialRpEntity(const FastDictionaryInitializer& )
538
    : PublicKeyCredentialEntity(FastDictionaryInitializer())
539
0
  {
540
0
    // Do nothing here; this is used by our "Fast" subclass
541
0
  }
542
543
  explicit inline PublicKeyCredentialRpEntity(const PublicKeyCredentialRpEntity& aOther)
544
0
  {
545
0
    *this = aOther;
546
0
  }
547
548
  bool
549
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
550
551
  bool
552
  Init(const nsAString& aJSON);
553
554
  bool
555
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
556
557
  bool
558
  ToJSON(nsAString& aJSON) const;
559
560
  void
561
  TraceDictionary(JSTracer* trc);
562
563
  PublicKeyCredentialRpEntity&
564
  operator=(const PublicKeyCredentialRpEntity& aOther);
565
566
private:
567
  static bool
568
  InitIds(JSContext* cx, PublicKeyCredentialRpEntityAtoms* atomsCache);
569
};
570
571
namespace binding_detail {
572
struct FastPublicKeyCredentialRpEntity : public PublicKeyCredentialRpEntity
573
{
574
  inline FastPublicKeyCredentialRpEntity()
575
    : PublicKeyCredentialRpEntity(FastDictionaryInitializer())
576
0
  {
577
0
    // Doesn't matter what int we pass to the parent constructor
578
0
  }
579
};
580
} // namespace binding_detail
581
582
583
struct PublicKeyCredentialUserEntity : public PublicKeyCredentialEntity
584
{
585
  MOZ_INIT_OUTSIDE_CTOR nsString mDisplayName;
586
  MOZ_INIT_OUTSIDE_CTOR OwningArrayBufferViewOrArrayBuffer mId;
587
588
  PublicKeyCredentialUserEntity();
589
590
  explicit inline PublicKeyCredentialUserEntity(const FastDictionaryInitializer& )
591
    : PublicKeyCredentialEntity(FastDictionaryInitializer())
592
0
  {
593
0
    // Do nothing here; this is used by our "Fast" subclass
594
0
  }
595
596
private:
597
  PublicKeyCredentialUserEntity(const PublicKeyCredentialUserEntity&) = delete;
598
  PublicKeyCredentialUserEntity& operator=(const PublicKeyCredentialUserEntity&) = delete;
599
600
  static bool
601
  InitIds(JSContext* cx, PublicKeyCredentialUserEntityAtoms* atomsCache);
602
603
public:
604
  bool
605
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
606
607
  bool
608
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
609
610
  void
611
  TraceDictionary(JSTracer* trc);
612
};
613
614
namespace binding_detail {
615
struct FastPublicKeyCredentialUserEntity : public PublicKeyCredentialUserEntity
616
{
617
  inline FastPublicKeyCredentialUserEntity()
618
    : PublicKeyCredentialUserEntity(FastDictionaryInitializer())
619
0
  {
620
0
    // Doesn't matter what int we pass to the parent constructor
621
0
  }
622
};
623
} // namespace binding_detail
624
625
626
struct PublicKeyCredentialCreationOptions : public DictionaryBase
627
{
628
  MOZ_INIT_OUTSIDE_CTOR AttestationConveyancePreference mAttestation;
629
  MOZ_INIT_OUTSIDE_CTOR AuthenticatorSelectionCriteria mAuthenticatorSelection;
630
  MOZ_INIT_OUTSIDE_CTOR OwningArrayBufferViewOrArrayBuffer mChallenge;
631
  MOZ_INIT_OUTSIDE_CTOR Sequence<PublicKeyCredentialDescriptor> mExcludeCredentials;
632
  MOZ_INIT_OUTSIDE_CTOR AuthenticationExtensionsClientInputs mExtensions;
633
  MOZ_INIT_OUTSIDE_CTOR Sequence<PublicKeyCredentialParameters> mPubKeyCredParams;
634
  MOZ_INIT_OUTSIDE_CTOR PublicKeyCredentialRpEntity mRp;
635
  MOZ_INIT_OUTSIDE_CTOR Optional<uint32_t> mTimeout;
636
  MOZ_INIT_OUTSIDE_CTOR PublicKeyCredentialUserEntity mUser;
637
638
  PublicKeyCredentialCreationOptions();
639
640
  explicit inline PublicKeyCredentialCreationOptions(const FastDictionaryInitializer& )
641
    : mAuthenticatorSelection(FastDictionaryInitializer()),
642
      mExtensions(FastDictionaryInitializer()),
643
      mRp(FastDictionaryInitializer()),
644
      mUser(FastDictionaryInitializer())
645
0
  {
646
0
    // Do nothing here; this is used by our "Fast" subclass
647
0
  }
648
649
private:
650
  PublicKeyCredentialCreationOptions(const PublicKeyCredentialCreationOptions&) = delete;
651
  PublicKeyCredentialCreationOptions& operator=(const PublicKeyCredentialCreationOptions&) = delete;
652
653
  static bool
654
  InitIds(JSContext* cx, PublicKeyCredentialCreationOptionsAtoms* atomsCache);
655
656
public:
657
  bool
658
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
659
660
  bool
661
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
662
663
  void
664
  TraceDictionary(JSTracer* trc);
665
};
666
667
namespace binding_detail {
668
struct FastPublicKeyCredentialCreationOptions : public PublicKeyCredentialCreationOptions
669
{
670
  inline FastPublicKeyCredentialCreationOptions()
671
    : PublicKeyCredentialCreationOptions(FastDictionaryInitializer())
672
0
  {
673
0
    // Doesn't matter what int we pass to the parent constructor
674
0
  }
675
};
676
} // namespace binding_detail
677
678
679
namespace AuthenticatorAssertionResponse_Binding {
680
681
  typedef mozilla::dom::AuthenticatorAssertionResponse NativeType;
682
683
  bool
684
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
685
686
  const JSClass*
687
  GetJSClass();
688
689
  bool
690
  Wrap(JSContext* aCx, mozilla::dom::AuthenticatorAssertionResponse* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
691
692
  template <class T>
693
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
694
0
  {
695
0
    JS::Rooted<JSObject*> reflector(aCx);
696
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
697
0
  }
698
699
  // We declare this as an array so that retrieving a pointer to this
700
  // binding's property hooks only requires compile/link-time resolvable
701
  // address arithmetic.  Declaring it as a pointer instead would require
702
  // doing a run-time load to fetch a pointer to this binding's property
703
  // hooks.  And then structures which embedded a pointer to this structure
704
  // would require a run-time load for proper initialization, which would
705
  // then induce static constructors.  Lots of static constructors.
706
  extern const NativePropertyHooks sNativePropertyHooks[];
707
708
  void
709
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
710
711
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
712
0
  {
713
0
    /* Get the interface prototype object for this class.  This will create the
714
0
       object as needed. */
715
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::AuthenticatorAssertionResponse,
716
0
                                       &CreateInterfaceObjects,
717
0
                                       /* aDefineOnGlobal = */ true);
718
0
719
0
  }
720
721
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
722
0
  {
723
0
    /* Get the interface object for this class.  This will create the object as
724
0
       needed. */
725
0
726
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::AuthenticatorAssertionResponse,
727
0
                                       &CreateInterfaceObjects,
728
0
                                       aDefineOnGlobal);
729
0
  }
730
731
  JSObject*
732
  GetConstructorObject(JSContext* aCx);
733
734
} // namespace AuthenticatorAssertionResponse_Binding
735
736
737
738
namespace AuthenticatorAttestationResponse_Binding {
739
740
  typedef mozilla::dom::AuthenticatorAttestationResponse NativeType;
741
742
  bool
743
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
744
745
  const JSClass*
746
  GetJSClass();
747
748
  bool
749
  Wrap(JSContext* aCx, mozilla::dom::AuthenticatorAttestationResponse* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
750
751
  template <class T>
752
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
753
0
  {
754
0
    JS::Rooted<JSObject*> reflector(aCx);
755
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
756
0
  }
757
758
  // We declare this as an array so that retrieving a pointer to this
759
  // binding's property hooks only requires compile/link-time resolvable
760
  // address arithmetic.  Declaring it as a pointer instead would require
761
  // doing a run-time load to fetch a pointer to this binding's property
762
  // hooks.  And then structures which embedded a pointer to this structure
763
  // would require a run-time load for proper initialization, which would
764
  // then induce static constructors.  Lots of static constructors.
765
  extern const NativePropertyHooks sNativePropertyHooks[];
766
767
  void
768
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
769
770
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
771
0
  {
772
0
    /* Get the interface prototype object for this class.  This will create the
773
0
       object as needed. */
774
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::AuthenticatorAttestationResponse,
775
0
                                       &CreateInterfaceObjects,
776
0
                                       /* aDefineOnGlobal = */ true);
777
0
778
0
  }
779
780
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
781
0
  {
782
0
    /* Get the interface object for this class.  This will create the object as
783
0
       needed. */
784
0
785
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::AuthenticatorAttestationResponse,
786
0
                                       &CreateInterfaceObjects,
787
0
                                       aDefineOnGlobal);
788
0
  }
789
790
  JSObject*
791
  GetConstructorObject(JSContext* aCx);
792
793
} // namespace AuthenticatorAttestationResponse_Binding
794
795
796
797
namespace AuthenticatorResponse_Binding {
798
799
  typedef mozilla::dom::AuthenticatorResponse NativeType;
800
801
  bool
802
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
803
804
  const JSClass*
805
  GetJSClass();
806
807
  bool
808
  Wrap(JSContext* aCx, mozilla::dom::AuthenticatorResponse* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
809
810
  template <class T>
811
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
812
0
  {
813
0
    JS::Rooted<JSObject*> reflector(aCx);
814
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
815
0
  }
816
817
  // We declare this as an array so that retrieving a pointer to this
818
  // binding's property hooks only requires compile/link-time resolvable
819
  // address arithmetic.  Declaring it as a pointer instead would require
820
  // doing a run-time load to fetch a pointer to this binding's property
821
  // hooks.  And then structures which embedded a pointer to this structure
822
  // would require a run-time load for proper initialization, which would
823
  // then induce static constructors.  Lots of static constructors.
824
  extern const NativePropertyHooks sNativePropertyHooks[];
825
826
  void
827
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
828
829
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
830
0
  {
831
0
    /* Get the interface prototype object for this class.  This will create the
832
0
       object as needed. */
833
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::AuthenticatorResponse,
834
0
                                       &CreateInterfaceObjects,
835
0
                                       /* aDefineOnGlobal = */ true);
836
0
837
0
  }
838
839
  JSObject*
840
  GetProtoObject(JSContext* aCx);
841
842
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
843
0
  {
844
0
    /* Get the interface object for this class.  This will create the object as
845
0
       needed. */
846
0
847
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::AuthenticatorResponse,
848
0
                                       &CreateInterfaceObjects,
849
0
                                       aDefineOnGlobal);
850
0
  }
851
852
  JSObject*
853
  GetConstructorObject(JSContext* aCx);
854
855
} // namespace AuthenticatorResponse_Binding
856
857
858
859
namespace PublicKeyCredential_Binding {
860
861
  typedef mozilla::dom::PublicKeyCredential NativeType;
862
863
  bool
864
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
865
866
  const JSClass*
867
  GetJSClass();
868
869
  bool
870
  Wrap(JSContext* aCx, mozilla::dom::PublicKeyCredential* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
871
872
  template <class T>
873
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
874
0
  {
875
0
    JS::Rooted<JSObject*> reflector(aCx);
876
0
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
877
0
  }
878
879
  // We declare this as an array so that retrieving a pointer to this
880
  // binding's property hooks only requires compile/link-time resolvable
881
  // address arithmetic.  Declaring it as a pointer instead would require
882
  // doing a run-time load to fetch a pointer to this binding's property
883
  // hooks.  And then structures which embedded a pointer to this structure
884
  // would require a run-time load for proper initialization, which would
885
  // then induce static constructors.  Lots of static constructors.
886
  extern const NativePropertyHooks sNativePropertyHooks[];
887
888
  void
889
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
890
891
  inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
892
0
  {
893
0
    /* Get the interface prototype object for this class.  This will create the
894
0
       object as needed. */
895
0
    return GetPerInterfaceObjectHandle(aCx, prototypes::id::PublicKeyCredential,
896
0
                                       &CreateInterfaceObjects,
897
0
                                       /* aDefineOnGlobal = */ true);
898
0
899
0
  }
900
901
  inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
902
0
  {
903
0
    /* Get the interface object for this class.  This will create the object as
904
0
       needed. */
905
0
906
0
    return GetPerInterfaceObjectHandle(aCx, constructors::id::PublicKeyCredential,
907
0
                                       &CreateInterfaceObjects,
908
0
                                       aDefineOnGlobal);
909
0
  }
910
911
  JSObject*
912
  GetConstructorObject(JSContext* aCx);
913
914
} // namespace PublicKeyCredential_Binding
915
916
917
918
} // namespace dom
919
} // namespace mozilla
920
921
#endif // mozilla_dom_WebAuthenticationBinding_h