Copy as Markdown
Other Tools
/* THIS FILE IS AUTOGENERATED FROM IdentityCredential.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_IDENTITYCREDENTIALBINDING_H_
#define DOM_IDENTITYCREDENTIALBINDING_H_
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/EnumTypeTraits.h"
#include "mozilla/Span.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PrototypeList.h"
namespace mozilla {
namespace dom {
class IdentityCredential;
struct IdentityCredentialInitAtoms;
struct IdentityCredentialRequestOptionsAtoms;
struct IdentityCredentialUserData;
struct IdentityCredentialUserDataAtoms;
struct IdentityProviderAPIConfigAtoms;
struct IdentityProviderAccount;
struct IdentityProviderAccountAtoms;
struct IdentityProviderAccountListAtoms;
struct IdentityProviderBranding;
struct IdentityProviderBrandingAtoms;
struct IdentityProviderClientMetadataAtoms;
struct IdentityProviderConfig;
struct IdentityProviderConfigAtoms;
struct IdentityProviderIcon;
struct IdentityProviderIconAtoms;
struct IdentityProviderTokenAtoms;
struct IdentityProviderWellKnownAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
enum class IdentityLoginTargetType : uint8_t {
Redirect,
Popup,
};
namespace binding_detail {
template <> struct EnumStrings<IdentityLoginTargetType> {
static constexpr nsLiteralCString Values[2] {
"redirect"_ns,
"popup"_ns,
};
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, IdentityLoginTargetType aArgument, JS::MutableHandle<JS::Value> aValue);
struct IdentityCredentialUserData : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<uint64_t> mExpiresAfter;
MOZ_INIT_OUTSIDE_CTOR nsCString mIconURL;
MOZ_INIT_OUTSIDE_CTOR nsCString mName;
IdentityCredentialUserData();
explicit inline IdentityCredentialUserData(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
IdentityCredentialUserData(IdentityCredentialUserData&& aOther) = default;
explicit inline IdentityCredentialUserData(const IdentityCredentialUserData& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
void
TraceDictionary(JSTracer* trc);
IdentityCredentialUserData&
operator=(const IdentityCredentialUserData& aOther);
private:
static bool
InitIds(JSContext* cx, IdentityCredentialUserDataAtoms* atomsCache);
};
namespace binding_detail {
struct FastIdentityCredentialUserData : public IdentityCredentialUserData
{
inline FastIdentityCredentialUserData()
: IdentityCredentialUserData(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct IdentityProviderAccount : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mApproved_clients;
MOZ_INIT_OUTSIDE_CTOR nsString mEmail;
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mGiven_name;
MOZ_INIT_OUTSIDE_CTOR nsString mId;
MOZ_INIT_OUTSIDE_CTOR nsString mName;
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mPicture;
IdentityProviderAccount();
explicit inline IdentityProviderAccount(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
IdentityProviderAccount(IdentityProviderAccount&& aOther) = default;
explicit inline IdentityProviderAccount(const IdentityProviderAccount& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
IdentityProviderAccount&
operator=(const IdentityProviderAccount& aOther);
private:
static bool
InitIds(JSContext* cx, IdentityProviderAccountAtoms* atomsCache);
};
namespace binding_detail {
struct FastIdentityProviderAccount : public IdentityProviderAccount
{
inline FastIdentityProviderAccount()
: IdentityProviderAccount(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct IdentityProviderClientMetadata : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mPrivacy_policy_url;
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mTerms_of_service_url;
IdentityProviderClientMetadata();
explicit inline IdentityProviderClientMetadata(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
IdentityProviderClientMetadata(IdentityProviderClientMetadata&& aOther) = default;
explicit inline IdentityProviderClientMetadata(const IdentityProviderClientMetadata& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
IdentityProviderClientMetadata&
operator=(const IdentityProviderClientMetadata& aOther);
private:
static bool
InitIds(JSContext* cx, IdentityProviderClientMetadataAtoms* atomsCache);
};
namespace binding_detail {
struct FastIdentityProviderClientMetadata : public IdentityProviderClientMetadata
{
inline FastIdentityProviderClientMetadata()
: IdentityProviderClientMetadata(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct IdentityProviderConfig : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<nsCString> mClientId;
MOZ_INIT_OUTSIDE_CTOR Optional<nsCString> mConfigURL;
MOZ_INIT_OUTSIDE_CTOR Optional<nsCString> mEffectiveQueryURL;
MOZ_INIT_OUTSIDE_CTOR Optional<nsCString> mEffectiveType;
MOZ_INIT_OUTSIDE_CTOR Optional<IdentityLoginTargetType> mLoginTarget;
MOZ_INIT_OUTSIDE_CTOR Optional<nsCString> mLoginURL;
MOZ_INIT_OUTSIDE_CTOR Optional<nsCString> mNonce;
MOZ_INIT_OUTSIDE_CTOR Optional<nsCString> mOrigin;
IdentityProviderConfig();
explicit inline IdentityProviderConfig(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
IdentityProviderConfig(IdentityProviderConfig&& aOther) = default;
explicit inline IdentityProviderConfig(const IdentityProviderConfig& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
IdentityProviderConfig&
operator=(const IdentityProviderConfig& aOther);
private:
static bool
InitIds(JSContext* cx, IdentityProviderConfigAtoms* atomsCache);
};
namespace binding_detail {
struct FastIdentityProviderConfig : public IdentityProviderConfig
{
inline FastIdentityProviderConfig()
: IdentityProviderConfig(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct IdentityProviderIcon : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<uint32_t> mSize;
MOZ_INIT_OUTSIDE_CTOR nsCString mUrl;
IdentityProviderIcon();
explicit inline IdentityProviderIcon(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
IdentityProviderIcon(IdentityProviderIcon&& aOther) = default;
explicit inline IdentityProviderIcon(const IdentityProviderIcon& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
IdentityProviderIcon&
operator=(const IdentityProviderIcon& aOther);
private:
static bool
InitIds(JSContext* cx, IdentityProviderIconAtoms* atomsCache);
};
namespace binding_detail {
struct FastIdentityProviderIcon : public IdentityProviderIcon
{
inline FastIdentityProviderIcon()
: IdentityProviderIcon(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct IdentityProviderToken : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR nsString mToken;
IdentityProviderToken();
explicit inline IdentityProviderToken(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
IdentityProviderToken(IdentityProviderToken&& aOther) = default;
explicit inline IdentityProviderToken(const IdentityProviderToken& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
void
TraceDictionary(JSTracer* trc);
IdentityProviderToken&
operator=(const IdentityProviderToken& aOther);
private:
static bool
InitIds(JSContext* cx, IdentityProviderTokenAtoms* atomsCache);
};
namespace binding_detail {
struct FastIdentityProviderToken : public IdentityProviderToken
{
inline FastIdentityProviderToken()
: IdentityProviderToken(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct IdentityProviderWellKnown : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Sequence<nsCString> mProvider_urls;
IdentityProviderWellKnown();
explicit inline IdentityProviderWellKnown(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
IdentityProviderWellKnown(IdentityProviderWellKnown&& aOther) = default;
explicit inline IdentityProviderWellKnown(const IdentityProviderWellKnown& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
void
TraceDictionary(JSTracer* trc);
IdentityProviderWellKnown&
operator=(const IdentityProviderWellKnown& aOther);
private:
static bool
InitIds(JSContext* cx, IdentityProviderWellKnownAtoms* atomsCache);
};
namespace binding_detail {
struct FastIdentityProviderWellKnown : public IdentityProviderWellKnown
{
inline FastIdentityProviderWellKnown()
: IdentityProviderWellKnown(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct IdentityCredentialInit : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsCString>> mEffectiveOrigins;
MOZ_INIT_OUTSIDE_CTOR Optional<nsCString> mEffectiveQueryURL;
MOZ_INIT_OUTSIDE_CTOR Optional<nsCString> mEffectiveType;
MOZ_INIT_OUTSIDE_CTOR nsString mId;
MOZ_INIT_OUTSIDE_CTOR Optional<nsCString> mToken;
MOZ_INIT_OUTSIDE_CTOR Optional<IdentityCredentialUserData> mUiHint;
IdentityCredentialInit();
explicit inline IdentityCredentialInit(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
IdentityCredentialInit(IdentityCredentialInit&& aOther) = default;
explicit inline IdentityCredentialInit(const IdentityCredentialInit& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
void
TraceDictionary(JSTracer* trc);
IdentityCredentialInit&
operator=(const IdentityCredentialInit& aOther);
private:
static bool
InitIds(JSContext* cx, IdentityCredentialInitAtoms* atomsCache);
};
namespace binding_detail {
struct FastIdentityCredentialInit : public IdentityCredentialInit
{
inline FastIdentityCredentialInit()
: IdentityCredentialInit(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct IdentityCredentialRequestOptions : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<IdentityProviderConfig>> mProviders;
IdentityCredentialRequestOptions();
explicit inline IdentityCredentialRequestOptions(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
IdentityCredentialRequestOptions(IdentityCredentialRequestOptions&& aOther) = default;
explicit inline IdentityCredentialRequestOptions(const IdentityCredentialRequestOptions& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
void
TraceDictionary(JSTracer* trc);
IdentityCredentialRequestOptions&
operator=(const IdentityCredentialRequestOptions& aOther);
private:
static bool
InitIds(JSContext* cx, IdentityCredentialRequestOptionsAtoms* atomsCache);
};
namespace binding_detail {
struct FastIdentityCredentialRequestOptions : public IdentityCredentialRequestOptions
{
inline FastIdentityCredentialRequestOptions()
: IdentityCredentialRequestOptions(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct IdentityProviderAccountList : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<IdentityProviderAccount>> mAccounts;
IdentityProviderAccountList();
explicit inline IdentityProviderAccountList(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
IdentityProviderAccountList(IdentityProviderAccountList&& aOther) = default;
explicit inline IdentityProviderAccountList(const IdentityProviderAccountList& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
IdentityProviderAccountList&
operator=(const IdentityProviderAccountList& aOther);
private:
static bool
InitIds(JSContext* cx, IdentityProviderAccountListAtoms* atomsCache);
};
namespace binding_detail {
struct FastIdentityProviderAccountList : public IdentityProviderAccountList
{
inline FastIdentityProviderAccountList()
: IdentityProviderAccountList(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct IdentityProviderBranding : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mBackground_color;
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mColor;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<IdentityProviderIcon>> mIcons;
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mName;
IdentityProviderBranding();
explicit inline IdentityProviderBranding(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
IdentityProviderBranding(IdentityProviderBranding&& aOther) = default;
explicit inline IdentityProviderBranding(const IdentityProviderBranding& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
IdentityProviderBranding&
operator=(const IdentityProviderBranding& aOther);
private:
static bool
InitIds(JSContext* cx, IdentityProviderBrandingAtoms* atomsCache);
};
namespace binding_detail {
struct FastIdentityProviderBranding : public IdentityProviderBranding
{
inline FastIdentityProviderBranding()
: IdentityProviderBranding(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct IdentityProviderAPIConfig : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR nsCString mAccounts_endpoint;
MOZ_INIT_OUTSIDE_CTOR Optional<IdentityProviderBranding> mBranding;
MOZ_INIT_OUTSIDE_CTOR nsCString mClient_metadata_endpoint;
MOZ_INIT_OUTSIDE_CTOR nsCString mId_assertion_endpoint;
IdentityProviderAPIConfig();
explicit inline IdentityProviderAPIConfig(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
IdentityProviderAPIConfig(IdentityProviderAPIConfig&& aOther) = default;
explicit inline IdentityProviderAPIConfig(const IdentityProviderAPIConfig& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
IdentityProviderAPIConfig&
operator=(const IdentityProviderAPIConfig& aOther);
private:
static bool
InitIds(JSContext* cx, IdentityProviderAPIConfigAtoms* atomsCache);
};
namespace binding_detail {
struct FastIdentityProviderAPIConfig : public IdentityProviderAPIConfig
{
inline FastIdentityProviderAPIConfig()
: IdentityProviderAPIConfig(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace IdentityCredential_Binding {
typedef mozilla::dom::IdentityCredential NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::dom::IdentityCredential* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
template <class T>
inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
{
JS::Rooted<JSObject*> reflector(aCx);
return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
}
void
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal);
JS::Handle<JSObject*>
GetConstructorObjectHandle(JSContext* aCx);
inline bool CreateAndDefineOnGlobal(JSContext* aCx)
{
// Get the interface or namespace object for this class. This will
// create the object as needed and always define the properties for
// it on the global. The caller should make sure the interface or
// namespace is exposed on the global before calling this.
return GetPerInterfaceObjectHandle(aCx, constructors::id::IdentityCredential,
&CreateInterfaceObjects,
DefineInterfaceProperty::Always);
}
} // namespace IdentityCredential_Binding
} // namespace dom
template <>
struct MaxContiguousEnumValue<dom::IdentityLoginTargetType>
{
static constexpr dom::IdentityLoginTargetType value = dom::IdentityLoginTargetType::Popup;
static_assert(static_cast<uint8_t>(dom::IdentityLoginTargetType::Redirect) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(std::size(dom::binding_detail::EnumStrings<dom::IdentityLoginTargetType>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
} // namespace mozilla
#endif // DOM_IDENTITYCREDENTIALBINDING_H_