Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM MediaKeysRequestStatus.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_MEDIAKEYSREQUESTSTATUSBINDING_H_
#define DOM_MEDIAKEYSREQUESTSTATUSBINDING_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"
namespace mozilla {
namespace dom {
struct NativePropertyHooks;
class ProtoAndIfaceCache;
struct RequestMediaKeySystemAccessNotificationAtoms;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
enum class MediaKeySystemStatus : uint8_t {
Available,
Api_disabled,
Cdm_disabled,
Cdm_not_supported,
Cdm_not_installed,
Cdm_created,
};
namespace binding_detail {
template <> struct EnumStrings<MediaKeySystemStatus> {
static const nsLiteralCString Values[6];
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, MediaKeySystemStatus aArgument, JS::MutableHandle<JS::Value> aValue);
struct RequestMediaKeySystemAccessNotification : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR nsString mKeySystem;
MOZ_INIT_OUTSIDE_CTOR MediaKeySystemStatus mStatus;
RequestMediaKeySystemAccessNotification();
explicit inline RequestMediaKeySystemAccessNotification(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
RequestMediaKeySystemAccessNotification(RequestMediaKeySystemAccessNotification&& aOther) = default;
explicit inline RequestMediaKeySystemAccessNotification(const RequestMediaKeySystemAccessNotification& aOther)
{
*this = aOther;
}
bool
Init(const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
bool
ToJSON(nsAString& aJSON) const;
void
TraceDictionary(JSTracer* trc);
RequestMediaKeySystemAccessNotification&
operator=(const RequestMediaKeySystemAccessNotification& aOther);
private:
static bool
InitIds(JSContext* cx, RequestMediaKeySystemAccessNotificationAtoms* atomsCache);
};
namespace binding_detail {
struct FastRequestMediaKeySystemAccessNotification : public RequestMediaKeySystemAccessNotification
{
inline FastRequestMediaKeySystemAccessNotification()
: RequestMediaKeySystemAccessNotification(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
} // namespace dom
template <>
struct MaxContiguousEnumValue<dom::MediaKeySystemStatus>
{
static constexpr dom::MediaKeySystemStatus value = dom::MediaKeySystemStatus::Cdm_created;
static_assert(static_cast<uint8_t>(dom::MediaKeySystemStatus::Available) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(mozilla::ArrayLength(dom::binding_detail::EnumStrings<dom::MediaKeySystemStatus>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
} // namespace mozilla
#endif // DOM_MEDIAKEYSREQUESTSTATUSBINDING_H_