Copy as Markdown
Other Tools
/* THIS FILE IS AUTOGENERATED FROM RTCIdentityProvider.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_RTCIDENTITYPROVIDERBINDING_H_
#define DOM_RTCIDENTITYPROVIDERBINDING_H_
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/CallbackFunction.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PrototypeList.h"
#include "mozilla/dom/ToJSValue.h"
namespace mozilla {
namespace dom {
class GenerateAssertionCallback;
struct NativePropertyHooks;
class Promise;
class ProtoAndIfaceCache;
struct RTCIdentityAssertionResultAtoms;
struct RTCIdentityProviderAtoms;
struct RTCIdentityProviderDetails;
struct RTCIdentityProviderDetailsAtoms;
struct RTCIdentityProviderOptions;
struct RTCIdentityProviderOptionsAtoms;
class RTCIdentityProviderRegistrar;
struct RTCIdentityValidationResultAtoms;
class ValidateAssertionCallback;
} // namespace dom
} // namespace mozilla
namespace mozilla::dom {
class GenerateAssertionCallback : public CallbackFunction
{
public:
explicit inline GenerateAssertionCallback(JSContext* aCx, JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aCallbackGlobal, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCx, aCallback, aCallbackGlobal, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline GenerateAssertionCallback(JSObject* aCallback, JSObject* aCallbackGlobal, const FastCallbackConstructor& )
: CallbackFunction(aCallback, aCallbackGlobal, FastCallbackConstructor())
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline GenerateAssertionCallback(JSObject* aCallback, JSObject* aCallbackGlobal, JSObject* aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCallback, aCallbackGlobal, aAsyncStack, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline GenerateAssertionCallback(CallbackFunction* aOther)
: CallbackFunction(aOther)
{
}
template <typename T>
MOZ_CAN_RUN_SCRIPT inline already_AddRefed<Promise>
Call(const T& thisVal, const nsAString& contents, const nsAString& origin, const RTCIdentityProviderOptions& options, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JS::Realm* aRealm = nullptr)
{
MOZ_ASSERT(!aRv.Failed(), "Don't pass an already-failed ErrorResult to a callback!");
if (!aExecutionReason) {
aExecutionReason = "GenerateAssertionCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return nullptr;
}
JS::Rooted<JS::Value> thisValJS(s.GetContext());
if (!ToJSValue(s.GetContext(), thisVal, &thisValJS)) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
return Call(s.GetCallContext(), thisValJS, contents, origin, options, aRv);
}
MOZ_CAN_RUN_SCRIPT inline already_AddRefed<Promise>
Call(const nsAString& contents, const nsAString& origin, const RTCIdentityProviderOptions& options, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JS::Realm* aRealm = nullptr)
{
MOZ_ASSERT(!aRv.Failed(), "Don't pass an already-failed ErrorResult to a callback!");
if (!aExecutionReason) {
aExecutionReason = "GenerateAssertionCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return nullptr;
}
return Call(s.GetCallContext(), JS::UndefinedHandleValue, contents, origin, options, aRv);
}
template <typename T>
MOZ_CAN_RUN_SCRIPT inline already_AddRefed<Promise>
Call(const T& thisVal, const nsAString& contents, const nsAString& origin, const RTCIdentityProviderOptions& options, const char* aExecutionReason = nullptr)
{
return Call(thisVal, contents, origin, options, IgnoreErrors(), aExecutionReason);
}
MOZ_CAN_RUN_SCRIPT inline already_AddRefed<Promise>
Call(const nsAString& contents, const nsAString& origin, const RTCIdentityProviderOptions& options, const char* aExecutionReason = nullptr)
{
return Call(contents, origin, options, IgnoreErrors(), aExecutionReason, eReportExceptions, nullptr);
}
inline bool
operator==(const GenerateAssertionCallback& aOther) const
{
return CallbackFunction::operator==(aOther);
}
private:
MOZ_CAN_RUN_SCRIPT already_AddRefed<Promise> Call(BindingCallContext& cx, JS::Handle<JS::Value> aThisVal, const nsAString& contents, const nsAString& origin, const RTCIdentityProviderOptions& options, ErrorResult& aRv);
};
namespace binding_detail {
class FastGenerateAssertionCallback : public GenerateAssertionCallback
{
public:
explicit inline FastGenerateAssertionCallback(JSObject* aCallback, JSObject* aCallbackGlobal)
: GenerateAssertionCallback(aCallback, aCallbackGlobal, FastCallbackConstructor())
{
}
inline void
Trace(JSTracer* aTracer)
{
GenerateAssertionCallback::Trace(aTracer);
}
inline void
FinishSlowJSInitIfMoreThanOneOwner(JSContext* aCx)
{
GenerateAssertionCallback::FinishSlowJSInitIfMoreThanOneOwner(aCx);
}
};
} // namespace binding_detail
struct RTCIdentityProvider : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR OwningNonNull<GenerateAssertionCallback> mGenerateAssertion;
MOZ_INIT_OUTSIDE_CTOR OwningNonNull<ValidateAssertionCallback> mValidateAssertion;
RTCIdentityProvider();
explicit inline RTCIdentityProvider(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
RTCIdentityProvider(RTCIdentityProvider&& aOther) = default;
private:
RTCIdentityProvider(const RTCIdentityProvider&) = delete;
RTCIdentityProvider& operator=(const RTCIdentityProvider&) = delete;
static bool
InitIds(JSContext* cx, RTCIdentityProviderAtoms* atomsCache);
public:
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);
inline void
TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags)
{
ImplCycleCollectionTraverse(aCallback, mGenerateAssertion, "mGenerateAssertion", aFlags);
ImplCycleCollectionTraverse(aCallback, mValidateAssertion, "mValidateAssertion", aFlags);
}
inline void
UnlinkForCC()
{
ImplCycleCollectionUnlink(mGenerateAssertion);
ImplCycleCollectionUnlink(mValidateAssertion);
}
};
namespace binding_detail {
struct FastRTCIdentityProvider : public RTCIdentityProvider
{
inline FastRTCIdentityProvider()
: RTCIdentityProvider(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct RTCIdentityProviderDetails : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR nsString mDomain;
MOZ_INIT_OUTSIDE_CTOR nsString mProtocol;
RTCIdentityProviderDetails();
explicit inline RTCIdentityProviderDetails(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
RTCIdentityProviderDetails(RTCIdentityProviderDetails&& aOther) = default;
explicit inline RTCIdentityProviderDetails(const RTCIdentityProviderDetails& 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);
RTCIdentityProviderDetails&
operator=(const RTCIdentityProviderDetails& aOther);
private:
static bool
InitIds(JSContext* cx, RTCIdentityProviderDetailsAtoms* atomsCache);
};
namespace binding_detail {
struct FastRTCIdentityProviderDetails : public RTCIdentityProviderDetails
{
inline FastRTCIdentityProviderDetails()
: RTCIdentityProviderDetails(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct RTCIdentityProviderOptions : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mPeerIdentity;
MOZ_INIT_OUTSIDE_CTOR nsString mProtocol;
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mUsernameHint;
RTCIdentityProviderOptions();
explicit inline RTCIdentityProviderOptions(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
RTCIdentityProviderOptions(RTCIdentityProviderOptions&& aOther) = default;
explicit inline RTCIdentityProviderOptions(const RTCIdentityProviderOptions& 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);
RTCIdentityProviderOptions&
operator=(const RTCIdentityProviderOptions& aOther);
private:
static bool
InitIds(JSContext* cx, RTCIdentityProviderOptionsAtoms* atomsCache);
};
namespace binding_detail {
struct FastRTCIdentityProviderOptions : public RTCIdentityProviderOptions
{
inline FastRTCIdentityProviderOptions()
: RTCIdentityProviderOptions(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct RTCIdentityValidationResult : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR nsString mContents;
MOZ_INIT_OUTSIDE_CTOR nsString mIdentity;
RTCIdentityValidationResult();
explicit inline RTCIdentityValidationResult(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
RTCIdentityValidationResult(RTCIdentityValidationResult&& aOther) = default;
explicit inline RTCIdentityValidationResult(const RTCIdentityValidationResult& 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);
RTCIdentityValidationResult&
operator=(const RTCIdentityValidationResult& aOther);
private:
static bool
InitIds(JSContext* cx, RTCIdentityValidationResultAtoms* atomsCache);
};
namespace binding_detail {
struct FastRTCIdentityValidationResult : public RTCIdentityValidationResult
{
inline FastRTCIdentityValidationResult()
: RTCIdentityValidationResult(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
class ValidateAssertionCallback : public CallbackFunction
{
public:
explicit inline ValidateAssertionCallback(JSContext* aCx, JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aCallbackGlobal, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCx, aCallback, aCallbackGlobal, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline ValidateAssertionCallback(JSObject* aCallback, JSObject* aCallbackGlobal, const FastCallbackConstructor& )
: CallbackFunction(aCallback, aCallbackGlobal, FastCallbackConstructor())
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline ValidateAssertionCallback(JSObject* aCallback, JSObject* aCallbackGlobal, JSObject* aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCallback, aCallbackGlobal, aAsyncStack, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline ValidateAssertionCallback(CallbackFunction* aOther)
: CallbackFunction(aOther)
{
}
template <typename T>
MOZ_CAN_RUN_SCRIPT inline already_AddRefed<Promise>
Call(const T& thisVal, const nsAString& assertion, const nsAString& origin, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JS::Realm* aRealm = nullptr)
{
MOZ_ASSERT(!aRv.Failed(), "Don't pass an already-failed ErrorResult to a callback!");
if (!aExecutionReason) {
aExecutionReason = "ValidateAssertionCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return nullptr;
}
JS::Rooted<JS::Value> thisValJS(s.GetContext());
if (!ToJSValue(s.GetContext(), thisVal, &thisValJS)) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
return Call(s.GetCallContext(), thisValJS, assertion, origin, aRv);
}
MOZ_CAN_RUN_SCRIPT inline already_AddRefed<Promise>
Call(const nsAString& assertion, const nsAString& origin, ErrorResult& aRv, const char* aExecutionReason = nullptr, ExceptionHandling aExceptionHandling = eReportExceptions, JS::Realm* aRealm = nullptr)
{
MOZ_ASSERT(!aRv.Failed(), "Don't pass an already-failed ErrorResult to a callback!");
if (!aExecutionReason) {
aExecutionReason = "ValidateAssertionCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return nullptr;
}
return Call(s.GetCallContext(), JS::UndefinedHandleValue, assertion, origin, aRv);
}
template <typename T>
MOZ_CAN_RUN_SCRIPT inline already_AddRefed<Promise>
Call(const T& thisVal, const nsAString& assertion, const nsAString& origin, const char* aExecutionReason = nullptr)
{
return Call(thisVal, assertion, origin, IgnoreErrors(), aExecutionReason);
}
MOZ_CAN_RUN_SCRIPT inline already_AddRefed<Promise>
Call(const nsAString& assertion, const nsAString& origin, const char* aExecutionReason = nullptr)
{
return Call(assertion, origin, IgnoreErrors(), aExecutionReason, eReportExceptions, nullptr);
}
inline bool
operator==(const ValidateAssertionCallback& aOther) const
{
return CallbackFunction::operator==(aOther);
}
private:
MOZ_CAN_RUN_SCRIPT already_AddRefed<Promise> Call(BindingCallContext& cx, JS::Handle<JS::Value> aThisVal, const nsAString& assertion, const nsAString& origin, ErrorResult& aRv);
};
namespace binding_detail {
class FastValidateAssertionCallback : public ValidateAssertionCallback
{
public:
explicit inline FastValidateAssertionCallback(JSObject* aCallback, JSObject* aCallbackGlobal)
: ValidateAssertionCallback(aCallback, aCallbackGlobal, FastCallbackConstructor())
{
}
inline void
Trace(JSTracer* aTracer)
{
ValidateAssertionCallback::Trace(aTracer);
}
inline void
FinishSlowJSInitIfMoreThanOneOwner(JSContext* aCx)
{
ValidateAssertionCallback::FinishSlowJSInitIfMoreThanOneOwner(aCx);
}
};
} // namespace binding_detail
struct RTCIdentityAssertionResult : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR nsString mAssertion;
MOZ_INIT_OUTSIDE_CTOR RTCIdentityProviderDetails mIdp;
RTCIdentityAssertionResult();
explicit inline RTCIdentityAssertionResult(const FastDictionaryInitializer& )
: mIdp(FastDictionaryInitializer())
{
// Do nothing here; this is used by our "Fast" subclass
}
RTCIdentityAssertionResult(RTCIdentityAssertionResult&& aOther) = default;
explicit inline RTCIdentityAssertionResult(const RTCIdentityAssertionResult& aOther)
: mIdp(FastDictionaryInitializer())
{
*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);
RTCIdentityAssertionResult&
operator=(const RTCIdentityAssertionResult& aOther);
private:
static bool
InitIds(JSContext* cx, RTCIdentityAssertionResultAtoms* atomsCache);
};
namespace binding_detail {
struct FastRTCIdentityAssertionResult : public RTCIdentityAssertionResult
{
inline FastRTCIdentityAssertionResult()
: RTCIdentityAssertionResult(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace RTCIdentityProviderRegistrar_Binding {
typedef mozilla::dom::RTCIdentityProviderRegistrar NativeType;
bool
Wrap(JSContext* aCx, mozilla::dom::RTCIdentityProviderRegistrar* 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);
} // namespace RTCIdentityProviderRegistrar_Binding
} // namespace mozilla::dom
#endif // DOM_RTCIDENTITYPROVIDERBINDING_H_