Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM PeerConnectionObserverEnums.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_PEERCONNECTIONOBSERVERENUMSBINDING_H_
#define DOM_PEERCONNECTIONOBSERVERENUMSBINDING_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;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
enum class PCObserverStateType : uint8_t {
None,
IceConnectionState,
IceGatheringState,
SignalingState,
ConnectionState,
};
namespace binding_detail {
template <> struct EnumStrings<PCObserverStateType> {
static constexpr nsLiteralCString Values[5] {
"None"_ns,
"IceConnectionState"_ns,
"IceGatheringState"_ns,
"SignalingState"_ns,
"ConnectionState"_ns,
};
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, PCObserverStateType aArgument, JS::MutableHandle<JS::Value> aValue);
enum class PCError : uint8_t {
UnknownError,
InvalidAccessError,
InvalidStateError,
InvalidModificationError,
OperationError,
NotSupportedError,
SyntaxError,
NotReadableError,
TypeError,
RangeError,
InvalidCharacterError,
};
namespace binding_detail {
template <> struct EnumStrings<PCError> {
static constexpr nsLiteralCString Values[11] {
"UnknownError"_ns,
"InvalidAccessError"_ns,
"InvalidStateError"_ns,
"InvalidModificationError"_ns,
"OperationError"_ns,
"NotSupportedError"_ns,
"SyntaxError"_ns,
"NotReadableError"_ns,
"TypeError"_ns,
"RangeError"_ns,
"InvalidCharacterError"_ns,
};
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, PCError aArgument, JS::MutableHandle<JS::Value> aValue);
} // namespace dom
template <>
struct MaxContiguousEnumValue<dom::PCObserverStateType>
{
static constexpr dom::PCObserverStateType value = dom::PCObserverStateType::ConnectionState;
static_assert(static_cast<uint8_t>(dom::PCObserverStateType::None) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(std::size(dom::binding_detail::EnumStrings<dom::PCObserverStateType>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
template <>
struct MaxContiguousEnumValue<dom::PCError>
{
static constexpr dom::PCError value = dom::PCError::InvalidCharacterError;
static_assert(static_cast<uint8_t>(dom::PCError::UnknownError) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(std::size(dom::binding_detail::EnumStrings<dom::PCError>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
} // namespace mozilla
#endif // DOM_PEERCONNECTIONOBSERVERENUMSBINDING_H_