LCOV - code coverage report
Current view: top level - obj-x86_64-pc-linux-gnu/dist/include/mozilla/dom - WebAuthenticationBinding.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 62 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 26 0.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.13