Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM WebrtcGlobalInformation.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_WEBRTCGLOBALINFORMATIONBINDING_H_
#define DOM_WEBRTCGLOBALINFORMATIONBINDING_H_
#include "RTCStatsReportBinding.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 {
struct NativePropertyHooks;
class ProtoAndIfaceCache;
struct RTCSdpHistoryInternal;
struct RTCStatsReportInternal;
class WebrtcGlobalInformation;
class WebrtcGlobalLoggingCallback;
struct WebrtcGlobalMediaContextAtoms;
class WebrtcGlobalStatisticsCallback;
class WebrtcGlobalStatisticsHistoryCallback;
class WebrtcGlobalStatisticsHistoryPcIdsCallback;
struct WebrtcGlobalStatisticsReport;
struct WebrtcGlobalStatisticsReportAtoms;
} // namespace dom
} // namespace mozilla
namespace mozilla::dom {
class WebrtcGlobalLoggingCallback : public CallbackFunction
{
public:
explicit inline WebrtcGlobalLoggingCallback(JSContext* aCx, JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aCallbackGlobal, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCx, aCallback, aCallbackGlobal, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline WebrtcGlobalLoggingCallback(JSObject* aCallback, JSObject* aCallbackGlobal, const FastCallbackConstructor& )
: CallbackFunction(aCallback, aCallbackGlobal, FastCallbackConstructor())
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline WebrtcGlobalLoggingCallback(JSObject* aCallback, JSObject* aCallbackGlobal, JSObject* aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCallback, aCallbackGlobal, aAsyncStack, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline WebrtcGlobalLoggingCallback(CallbackFunction* aOther)
: CallbackFunction(aOther)
{
}
template <typename T>
MOZ_CAN_RUN_SCRIPT inline void
Call(const T& thisVal, const Sequence<nsString>& logMessages, 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 = "WebrtcGlobalLoggingCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
JS::Rooted<JS::Value> thisValJS(s.GetContext());
if (!ToJSValue(s.GetContext(), thisVal, &thisValJS)) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}
return Call(s.GetCallContext(), thisValJS, logMessages, aRv);
}
MOZ_CAN_RUN_SCRIPT inline void
Call(const Sequence<nsString>& logMessages, 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 = "WebrtcGlobalLoggingCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
return Call(s.GetCallContext(), JS::UndefinedHandleValue, logMessages, aRv);
}
template <typename T>
MOZ_CAN_RUN_SCRIPT inline void
Call(const T& thisVal, const Sequence<nsString>& logMessages, const char* aExecutionReason = nullptr)
{
return Call(thisVal, logMessages, IgnoreErrors(), aExecutionReason);
}
MOZ_CAN_RUN_SCRIPT inline void
Call(const Sequence<nsString>& logMessages, const char* aExecutionReason = nullptr)
{
return Call(logMessages, IgnoreErrors(), aExecutionReason, eReportExceptions, nullptr);
}
inline bool
operator==(const WebrtcGlobalLoggingCallback& aOther) const
{
return CallbackFunction::operator==(aOther);
}
private:
MOZ_CAN_RUN_SCRIPT void Call(BindingCallContext& cx, JS::Handle<JS::Value> aThisVal, const Sequence<nsString>& logMessages, ErrorResult& aRv);
};
namespace binding_detail {
class FastWebrtcGlobalLoggingCallback : public WebrtcGlobalLoggingCallback
{
public:
explicit inline FastWebrtcGlobalLoggingCallback(JSObject* aCallback, JSObject* aCallbackGlobal)
: WebrtcGlobalLoggingCallback(aCallback, aCallbackGlobal, FastCallbackConstructor())
{
}
inline void
Trace(JSTracer* aTracer)
{
WebrtcGlobalLoggingCallback::Trace(aTracer);
}
inline void
FinishSlowJSInitIfMoreThanOneOwner(JSContext* aCx)
{
WebrtcGlobalLoggingCallback::FinishSlowJSInitIfMoreThanOneOwner(aCx);
}
};
} // namespace binding_detail
struct WebrtcGlobalMediaContext : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR bool mHasAv1;
MOZ_INIT_OUTSIDE_CTOR bool mHasH264Hardware;
WebrtcGlobalMediaContext();
explicit inline WebrtcGlobalMediaContext(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
WebrtcGlobalMediaContext(WebrtcGlobalMediaContext&& aOther) = default;
explicit inline WebrtcGlobalMediaContext(const WebrtcGlobalMediaContext& aOther)
{
*this = aOther;
}
bool
Init(const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
WebrtcGlobalMediaContext&
operator=(const WebrtcGlobalMediaContext& aOther);
private:
static bool
InitIds(JSContext* cx, WebrtcGlobalMediaContextAtoms* atomsCache);
};
namespace binding_detail {
struct FastWebrtcGlobalMediaContext : public WebrtcGlobalMediaContext
{
inline FastWebrtcGlobalMediaContext()
: WebrtcGlobalMediaContext(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
class WebrtcGlobalStatisticsCallback : public CallbackFunction
{
public:
explicit inline WebrtcGlobalStatisticsCallback(JSContext* aCx, JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aCallbackGlobal, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCx, aCallback, aCallbackGlobal, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline WebrtcGlobalStatisticsCallback(JSObject* aCallback, JSObject* aCallbackGlobal, const FastCallbackConstructor& )
: CallbackFunction(aCallback, aCallbackGlobal, FastCallbackConstructor())
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline WebrtcGlobalStatisticsCallback(JSObject* aCallback, JSObject* aCallbackGlobal, JSObject* aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCallback, aCallbackGlobal, aAsyncStack, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline WebrtcGlobalStatisticsCallback(CallbackFunction* aOther)
: CallbackFunction(aOther)
{
}
template <typename T>
MOZ_CAN_RUN_SCRIPT inline void
Call(const T& thisVal, const WebrtcGlobalStatisticsReport& reports, 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 = "WebrtcGlobalStatisticsCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
JS::Rooted<JS::Value> thisValJS(s.GetContext());
if (!ToJSValue(s.GetContext(), thisVal, &thisValJS)) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}
return Call(s.GetCallContext(), thisValJS, reports, aRv);
}
MOZ_CAN_RUN_SCRIPT inline void
Call(const WebrtcGlobalStatisticsReport& reports, 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 = "WebrtcGlobalStatisticsCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
return Call(s.GetCallContext(), JS::UndefinedHandleValue, reports, aRv);
}
template <typename T>
MOZ_CAN_RUN_SCRIPT inline void
Call(const T& thisVal, const WebrtcGlobalStatisticsReport& reports, const char* aExecutionReason = nullptr)
{
return Call(thisVal, reports, IgnoreErrors(), aExecutionReason);
}
MOZ_CAN_RUN_SCRIPT inline void
Call(const WebrtcGlobalStatisticsReport& reports, const char* aExecutionReason = nullptr)
{
return Call(reports, IgnoreErrors(), aExecutionReason, eReportExceptions, nullptr);
}
inline bool
operator==(const WebrtcGlobalStatisticsCallback& aOther) const
{
return CallbackFunction::operator==(aOther);
}
private:
MOZ_CAN_RUN_SCRIPT void Call(BindingCallContext& cx, JS::Handle<JS::Value> aThisVal, const WebrtcGlobalStatisticsReport& reports, ErrorResult& aRv);
};
namespace binding_detail {
class FastWebrtcGlobalStatisticsCallback : public WebrtcGlobalStatisticsCallback
{
public:
explicit inline FastWebrtcGlobalStatisticsCallback(JSObject* aCallback, JSObject* aCallbackGlobal)
: WebrtcGlobalStatisticsCallback(aCallback, aCallbackGlobal, FastCallbackConstructor())
{
}
inline void
Trace(JSTracer* aTracer)
{
WebrtcGlobalStatisticsCallback::Trace(aTracer);
}
inline void
FinishSlowJSInitIfMoreThanOneOwner(JSContext* aCx)
{
WebrtcGlobalStatisticsCallback::FinishSlowJSInitIfMoreThanOneOwner(aCx);
}
};
} // namespace binding_detail
class WebrtcGlobalStatisticsHistoryCallback : public CallbackFunction
{
public:
explicit inline WebrtcGlobalStatisticsHistoryCallback(JSContext* aCx, JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aCallbackGlobal, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCx, aCallback, aCallbackGlobal, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline WebrtcGlobalStatisticsHistoryCallback(JSObject* aCallback, JSObject* aCallbackGlobal, const FastCallbackConstructor& )
: CallbackFunction(aCallback, aCallbackGlobal, FastCallbackConstructor())
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline WebrtcGlobalStatisticsHistoryCallback(JSObject* aCallback, JSObject* aCallbackGlobal, JSObject* aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCallback, aCallbackGlobal, aAsyncStack, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline WebrtcGlobalStatisticsHistoryCallback(CallbackFunction* aOther)
: CallbackFunction(aOther)
{
}
template <typename T>
MOZ_CAN_RUN_SCRIPT inline void
Call(const T& thisVal, const WebrtcGlobalStatisticsReport& reports, 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 = "WebrtcGlobalStatisticsHistoryCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
JS::Rooted<JS::Value> thisValJS(s.GetContext());
if (!ToJSValue(s.GetContext(), thisVal, &thisValJS)) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}
return Call(s.GetCallContext(), thisValJS, reports, aRv);
}
MOZ_CAN_RUN_SCRIPT inline void
Call(const WebrtcGlobalStatisticsReport& reports, 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 = "WebrtcGlobalStatisticsHistoryCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
return Call(s.GetCallContext(), JS::UndefinedHandleValue, reports, aRv);
}
template <typename T>
MOZ_CAN_RUN_SCRIPT inline void
Call(const T& thisVal, const WebrtcGlobalStatisticsReport& reports, const char* aExecutionReason = nullptr)
{
return Call(thisVal, reports, IgnoreErrors(), aExecutionReason);
}
MOZ_CAN_RUN_SCRIPT inline void
Call(const WebrtcGlobalStatisticsReport& reports, const char* aExecutionReason = nullptr)
{
return Call(reports, IgnoreErrors(), aExecutionReason, eReportExceptions, nullptr);
}
inline bool
operator==(const WebrtcGlobalStatisticsHistoryCallback& aOther) const
{
return CallbackFunction::operator==(aOther);
}
private:
MOZ_CAN_RUN_SCRIPT void Call(BindingCallContext& cx, JS::Handle<JS::Value> aThisVal, const WebrtcGlobalStatisticsReport& reports, ErrorResult& aRv);
};
namespace binding_detail {
class FastWebrtcGlobalStatisticsHistoryCallback : public WebrtcGlobalStatisticsHistoryCallback
{
public:
explicit inline FastWebrtcGlobalStatisticsHistoryCallback(JSObject* aCallback, JSObject* aCallbackGlobal)
: WebrtcGlobalStatisticsHistoryCallback(aCallback, aCallbackGlobal, FastCallbackConstructor())
{
}
inline void
Trace(JSTracer* aTracer)
{
WebrtcGlobalStatisticsHistoryCallback::Trace(aTracer);
}
inline void
FinishSlowJSInitIfMoreThanOneOwner(JSContext* aCx)
{
WebrtcGlobalStatisticsHistoryCallback::FinishSlowJSInitIfMoreThanOneOwner(aCx);
}
};
} // namespace binding_detail
class WebrtcGlobalStatisticsHistoryPcIdsCallback : public CallbackFunction
{
public:
explicit inline WebrtcGlobalStatisticsHistoryPcIdsCallback(JSContext* aCx, JS::Handle<JSObject*> aCallback, JS::Handle<JSObject*> aCallbackGlobal, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCx, aCallback, aCallbackGlobal, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline WebrtcGlobalStatisticsHistoryPcIdsCallback(JSObject* aCallback, JSObject* aCallbackGlobal, const FastCallbackConstructor& )
: CallbackFunction(aCallback, aCallbackGlobal, FastCallbackConstructor())
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline WebrtcGlobalStatisticsHistoryPcIdsCallback(JSObject* aCallback, JSObject* aCallbackGlobal, JSObject* aAsyncStack, nsIGlobalObject* aIncumbentGlobal)
: CallbackFunction(aCallback, aCallbackGlobal, aAsyncStack, aIncumbentGlobal)
{
MOZ_ASSERT(JS::IsCallable(mCallback));
}
explicit inline WebrtcGlobalStatisticsHistoryPcIdsCallback(CallbackFunction* aOther)
: CallbackFunction(aOther)
{
}
template <typename T>
MOZ_CAN_RUN_SCRIPT inline void
Call(const T& thisVal, const Sequence<nsString>& pcIds, 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 = "WebrtcGlobalStatisticsHistoryPcIdsCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
JS::Rooted<JS::Value> thisValJS(s.GetContext());
if (!ToJSValue(s.GetContext(), thisVal, &thisValJS)) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}
return Call(s.GetCallContext(), thisValJS, pcIds, aRv);
}
MOZ_CAN_RUN_SCRIPT inline void
Call(const Sequence<nsString>& pcIds, 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 = "WebrtcGlobalStatisticsHistoryPcIdsCallback";
}
CallSetup s(this, aRv, aExecutionReason, aExceptionHandling, aRealm);
if (!s.GetContext()) {
MOZ_ASSERT(aRv.Failed());
return;
}
return Call(s.GetCallContext(), JS::UndefinedHandleValue, pcIds, aRv);
}
template <typename T>
MOZ_CAN_RUN_SCRIPT inline void
Call(const T& thisVal, const Sequence<nsString>& pcIds, const char* aExecutionReason = nullptr)
{
return Call(thisVal, pcIds, IgnoreErrors(), aExecutionReason);
}
MOZ_CAN_RUN_SCRIPT inline void
Call(const Sequence<nsString>& pcIds, const char* aExecutionReason = nullptr)
{
return Call(pcIds, IgnoreErrors(), aExecutionReason, eReportExceptions, nullptr);
}
inline bool
operator==(const WebrtcGlobalStatisticsHistoryPcIdsCallback& aOther) const
{
return CallbackFunction::operator==(aOther);
}
private:
MOZ_CAN_RUN_SCRIPT void Call(BindingCallContext& cx, JS::Handle<JS::Value> aThisVal, const Sequence<nsString>& pcIds, ErrorResult& aRv);
};
namespace binding_detail {
class FastWebrtcGlobalStatisticsHistoryPcIdsCallback : public WebrtcGlobalStatisticsHistoryPcIdsCallback
{
public:
explicit inline FastWebrtcGlobalStatisticsHistoryPcIdsCallback(JSObject* aCallback, JSObject* aCallbackGlobal)
: WebrtcGlobalStatisticsHistoryPcIdsCallback(aCallback, aCallbackGlobal, FastCallbackConstructor())
{
}
inline void
Trace(JSTracer* aTracer)
{
WebrtcGlobalStatisticsHistoryPcIdsCallback::Trace(aTracer);
}
inline void
FinishSlowJSInitIfMoreThanOneOwner(JSContext* aCx)
{
WebrtcGlobalStatisticsHistoryPcIdsCallback::FinishSlowJSInitIfMoreThanOneOwner(aCx);
}
};
} // namespace binding_detail
struct WebrtcGlobalStatisticsReport : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Sequence<RTCStatsReportInternal> mReports;
MOZ_INIT_OUTSIDE_CTOR Sequence<RTCSdpHistoryInternal> mSdpHistories;
WebrtcGlobalStatisticsReport();
explicit inline WebrtcGlobalStatisticsReport(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
WebrtcGlobalStatisticsReport(WebrtcGlobalStatisticsReport&& aOther) = default;
explicit inline WebrtcGlobalStatisticsReport(const WebrtcGlobalStatisticsReport& aOther)
{
*this = aOther;
}
bool
Init(const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
WebrtcGlobalStatisticsReport&
operator=(const WebrtcGlobalStatisticsReport& aOther);
private:
static bool
InitIds(JSContext* cx, WebrtcGlobalStatisticsReportAtoms* atomsCache);
};
namespace binding_detail {
struct FastWebrtcGlobalStatisticsReport : public WebrtcGlobalStatisticsReport
{
inline FastWebrtcGlobalStatisticsReport()
: WebrtcGlobalStatisticsReport(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace WebrtcGlobalInformation_Binding {
typedef mozilla::dom::WebrtcGlobalInformation NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
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::WebrtcGlobalInformation,
&CreateInterfaceObjects,
DefineInterfaceProperty::Always);
}
} // namespace WebrtcGlobalInformation_Binding
} // namespace mozilla::dom
#endif // DOM_WEBRTCGLOBALINFORMATIONBINDING_H_