Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM DecoderDoctorNotification.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_DECODERDOCTORNOTIFICATIONBINDING_H_
#define DOM_DECODERDOCTORNOTIFICATIONBINDING_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 DecoderDoctorNotificationAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
enum class DecoderDoctorNotificationType : uint8_t {
Cannot_play,
Platform_decoder_not_found,
Can_play_but_some_missing_decoders,
Cannot_initialize_pulseaudio,
Unsupported_libavcodec,
Decode_error,
Decode_warning,
};
namespace binding_detail {
template <> struct EnumStrings<DecoderDoctorNotificationType> {
static constexpr nsLiteralCString Values[7] {
"cannot-play"_ns,
"platform-decoder-not-found"_ns,
"can-play-but-some-missing-decoders"_ns,
"cannot-initialize-pulseaudio"_ns,
"unsupported-libavcodec"_ns,
"decode-error"_ns,
"decode-warning"_ns,
};
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, DecoderDoctorNotificationType aArgument, JS::MutableHandle<JS::Value> aValue);
enum class DecoderDoctorReportType : uint8_t {
Mediawidevinenowmf,
Mediawmfneeded,
Mediaplatformdecodernotfound,
Mediacannotplaynodecoders,
Medianodecoders,
Mediacannotinitializepulseaudio,
Mediaunsupportedlibavcodec,
Mediadecodeerror,
Mediadecodewarning,
};
namespace binding_detail {
template <> struct EnumStrings<DecoderDoctorReportType> {
static constexpr nsLiteralCString Values[9] {
"mediawidevinenowmf"_ns,
"mediawmfneeded"_ns,
"mediaplatformdecodernotfound"_ns,
"mediacannotplaynodecoders"_ns,
"medianodecoders"_ns,
"mediacannotinitializepulseaudio"_ns,
"mediaunsupportedlibavcodec"_ns,
"mediadecodeerror"_ns,
"mediadecodewarning"_ns,
};
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, DecoderDoctorReportType aArgument, JS::MutableHandle<JS::Value> aValue);
struct DecoderDoctorNotification : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mDecodeIssue;
MOZ_INIT_OUTSIDE_CTOR nsString mDecoderDoctorReportId;
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mDocURL;
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mFormats;
MOZ_INIT_OUTSIDE_CTOR bool mIsSolved;
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mResourceURL;
MOZ_INIT_OUTSIDE_CTOR DecoderDoctorNotificationType mType;
DecoderDoctorNotification();
explicit inline DecoderDoctorNotification(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
DecoderDoctorNotification(DecoderDoctorNotification&& aOther) = default;
explicit inline DecoderDoctorNotification(const DecoderDoctorNotification& 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);
DecoderDoctorNotification&
operator=(const DecoderDoctorNotification& aOther);
private:
static bool
InitIds(JSContext* cx, DecoderDoctorNotificationAtoms* atomsCache);
};
namespace binding_detail {
struct FastDecoderDoctorNotification : public DecoderDoctorNotification
{
inline FastDecoderDoctorNotification()
: DecoderDoctorNotification(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
} // namespace dom
template <>
struct MaxContiguousEnumValue<dom::DecoderDoctorNotificationType>
{
static constexpr dom::DecoderDoctorNotificationType value = dom::DecoderDoctorNotificationType::Decode_warning;
static_assert(static_cast<uint8_t>(dom::DecoderDoctorNotificationType::Cannot_play) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(std::size(dom::binding_detail::EnumStrings<dom::DecoderDoctorNotificationType>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
template <>
struct MaxContiguousEnumValue<dom::DecoderDoctorReportType>
{
static constexpr dom::DecoderDoctorReportType value = dom::DecoderDoctorReportType::Mediadecodewarning;
static_assert(static_cast<uint8_t>(dom::DecoderDoctorReportType::Mediawidevinenowmf) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(std::size(dom::binding_detail::EnumStrings<dom::DecoderDoctorReportType>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
} // namespace mozilla
#endif // DOM_DECODERDOCTORNOTIFICATIONBINDING_H_