Copy as Markdown
Other Tools
/* THIS FILE IS AUTOGENERATED FROM SocketCommon.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_SOCKETCOMMONBINDING_H_
#define DOM_SOCKETCOMMONBINDING_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 SocketReadyState : uint8_t {
Opening,
Open,
Closing,
Closed,
Halfclosed,
};
namespace binding_detail {
template <> struct EnumStrings<SocketReadyState> {
static constexpr nsLiteralCString Values[5] {
"opening"_ns,
"open"_ns,
"closing"_ns,
"closed"_ns,
"halfclosed"_ns,
};
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, SocketReadyState aArgument, JS::MutableHandle<JS::Value> aValue);
} // namespace dom
template <>
struct MaxContiguousEnumValue<dom::SocketReadyState>
{
static constexpr dom::SocketReadyState value = dom::SocketReadyState::Halfclosed;
static_assert(static_cast<uint8_t>(dom::SocketReadyState::Opening) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(std::size(dom::binding_detail::EnumStrings<dom::SocketReadyState>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
} // namespace mozilla
#endif // DOM_SOCKETCOMMONBINDING_H_