Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM FileSystemWritableFileStream.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_FILESYSTEMWRITABLEFILESTREAMBINDING_H_
#define DOM_FILESYSTEMWRITABLEFILESTREAMBINDING_H_
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "js/Value.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/EnumTypeTraits.h"
#include "mozilla/Span.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/FakeString.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PrototypeList.h"
#include "mozilla/dom/RootedDictionary.h"
#include "mozilla/dom/TypedArray.h"
#include "mozilla/dom/UnionMember.h"
#include "mozilla/dom/UnionTypes.h"
namespace mozilla {
namespace dom {
class ArrayBufferViewOrArrayBufferOrBlobOrUTF8String;
class Blob;
class FileSystemWritableFileStream;
struct NativePropertyHooks;
class OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8String;
class OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams;
class ProtoAndIfaceCache;
struct WriteParamsAtoms;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
enum class WriteCommandType : uint8_t {
Write,
Seek,
Truncate,
};
namespace binding_detail {
template <> struct EnumStrings<WriteCommandType> {
static constexpr nsLiteralCString Values[3] {
"write"_ns,
"seek"_ns,
"truncate"_ns,
};
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, WriteCommandType aArgument, JS::MutableHandle<JS::Value> aValue);
void
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback, OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams& aUnion, const char* aName, uint32_t aFlags = 0);
void
ImplCycleCollectionUnlink(OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams& aUnion);
struct WriteParams : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<Nullable<OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8String >> mData;
MOZ_INIT_OUTSIDE_CTOR Optional<Nullable<uint64_t>> mPosition;
MOZ_INIT_OUTSIDE_CTOR Optional<Nullable<uint64_t>> mSize;
MOZ_INIT_OUTSIDE_CTOR WriteCommandType mType;
WriteParams();
explicit inline WriteParams(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
WriteParams(WriteParams&& aOther) = default;
private:
WriteParams(const WriteParams&) = delete;
WriteParams& operator=(const WriteParams&) = delete;
static bool
InitIds(JSContext* cx, WriteParamsAtoms* atomsCache);
public:
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
inline void
TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags)
{
ImplCycleCollectionTraverse(aCallback, mData, "mData", aFlags);
}
inline void
UnlinkForCC()
{
ImplCycleCollectionUnlink(mData);
}
};
namespace binding_detail {
struct FastWriteParams : public WriteParams
{
inline FastWriteParams()
: WriteParams(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
class ArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams : public AllUnionBase,
public UnionWithTypedArraysBase
{
public:
using ApplyToTypedArrays = binding_detail::ApplyToTypedArraysHelper<ArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams, true, ArrayBufferView, ArrayBuffer>;
private:
enum TypeOrUninit
{
eUninitialized,
eArrayBufferView,
eArrayBuffer,
eBlob,
eUTF8String,
eWriteParams
};
public:
enum class Type
{
eArrayBufferView = TypeOrUninit::eArrayBufferView,
eArrayBuffer = TypeOrUninit::eArrayBuffer,
eBlob = TypeOrUninit::eBlob,
eUTF8String = TypeOrUninit::eUTF8String,
eWriteParams = TypeOrUninit::eWriteParams
};
private:
union Value
{
UnionMember<RootedSpiderMonkeyInterface<ArrayBufferView> > mArrayBufferView;
UnionMember<RootedSpiderMonkeyInterface<ArrayBuffer> > mArrayBuffer;
UnionMember<NonNull<mozilla::dom::Blob> > mBlob;
UnionMember<binding_detail::FakeString<char> > mUTF8String;
UnionMember<RootedDictionary<binding_detail::FastWriteParams> > mWriteParams;
};
TypeOrUninit mType;
Value mValue;
ArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams(const ArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams&) = delete;
ArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams& operator=(const ArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams&) = delete;
public:
explicit inline ArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams()
: mType(eUninitialized)
{
}
inline ~ArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams()
{
Uninit();
}
[[nodiscard]] inline RootedSpiderMonkeyInterface<ArrayBufferView>&
RawSetAsArrayBufferView(JSContext* cx)
{
if (mType == eArrayBufferView) {
return mValue.mArrayBufferView.Value();
}
MOZ_ASSERT(mType == eUninitialized);
mType = eArrayBufferView;
return mValue.mArrayBufferView.SetValue(cx);
}
[[nodiscard]] inline RootedSpiderMonkeyInterface<ArrayBufferView>&
SetAsArrayBufferView(JSContext* cx)
{
if (mType == eArrayBufferView) {
return mValue.mArrayBufferView.Value();
}
Uninit();
mType = eArrayBufferView;
return mValue.mArrayBufferView.SetValue(cx);
}
inline bool
IsArrayBufferView() const
{
return mType == eArrayBufferView;
}
inline RootedSpiderMonkeyInterface<ArrayBufferView>&
GetAsArrayBufferView()
{
MOZ_RELEASE_ASSERT(IsArrayBufferView(), "Wrong type!");
return mValue.mArrayBufferView.Value();
}
inline ArrayBufferView const &
GetAsArrayBufferView() const
{
MOZ_RELEASE_ASSERT(IsArrayBufferView(), "Wrong type!");
return mValue.mArrayBufferView.Value();
}
[[nodiscard]] inline RootedSpiderMonkeyInterface<ArrayBuffer>&
RawSetAsArrayBuffer(JSContext* cx)
{
if (mType == eArrayBuffer) {
return mValue.mArrayBuffer.Value();
}
MOZ_ASSERT(mType == eUninitialized);
mType = eArrayBuffer;
return mValue.mArrayBuffer.SetValue(cx);
}
[[nodiscard]] inline RootedSpiderMonkeyInterface<ArrayBuffer>&
SetAsArrayBuffer(JSContext* cx)
{
if (mType == eArrayBuffer) {
return mValue.mArrayBuffer.Value();
}
Uninit();
mType = eArrayBuffer;
return mValue.mArrayBuffer.SetValue(cx);
}
inline bool
IsArrayBuffer() const
{
return mType == eArrayBuffer;
}
inline RootedSpiderMonkeyInterface<ArrayBuffer>&
GetAsArrayBuffer()
{
MOZ_RELEASE_ASSERT(IsArrayBuffer(), "Wrong type!");
return mValue.mArrayBuffer.Value();
}
inline ArrayBuffer const &
GetAsArrayBuffer() const
{
MOZ_RELEASE_ASSERT(IsArrayBuffer(), "Wrong type!");
return mValue.mArrayBuffer.Value();
}
[[nodiscard]] inline NonNull<mozilla::dom::Blob>&
RawSetAsBlob()
{
if (mType == eBlob) {
return mValue.mBlob.Value();
}
MOZ_ASSERT(mType == eUninitialized);
mType = eBlob;
return mValue.mBlob.SetValue();
}
[[nodiscard]] inline NonNull<mozilla::dom::Blob>&
SetAsBlob()
{
if (mType == eBlob) {
return mValue.mBlob.Value();
}
Uninit();
mType = eBlob;
return mValue.mBlob.SetValue();
}
inline bool
IsBlob() const
{
return mType == eBlob;
}
inline NonNull<mozilla::dom::Blob>&
GetAsBlob()
{
MOZ_RELEASE_ASSERT(IsBlob(), "Wrong type!");
return mValue.mBlob.Value();
}
inline mozilla::dom::Blob&
GetAsBlob() const
{
MOZ_RELEASE_ASSERT(IsBlob(), "Wrong type!");
return mValue.mBlob.Value();
}
[[nodiscard]] inline binding_detail::FakeString<char>&
RawSetAsUTF8String()
{
if (mType == eUTF8String) {
return mValue.mUTF8String.Value();
}
MOZ_ASSERT(mType == eUninitialized);
mType = eUTF8String;
return mValue.mUTF8String.SetValue();
}
[[nodiscard]] inline binding_detail::FakeString<char>&
SetAsUTF8String()
{
if (mType == eUTF8String) {
return mValue.mUTF8String.Value();
}
Uninit();
mType = eUTF8String;
return mValue.mUTF8String.SetValue();
}
template <int N>
inline void
SetStringLiteral(const nsCString::char_type (&aData)[N])
{
RawSetAsUTF8String().AssignLiteral(aData);
}
inline bool
IsUTF8String() const
{
return mType == eUTF8String;
}
inline binding_detail::FakeString<char>&
GetAsUTF8String()
{
MOZ_RELEASE_ASSERT(IsUTF8String(), "Wrong type!");
return mValue.mUTF8String.Value();
}
inline const nsACString&
GetAsUTF8String() const
{
MOZ_RELEASE_ASSERT(IsUTF8String(), "Wrong type!");
return mValue.mUTF8String.Value();
}
[[nodiscard]] inline RootedDictionary<binding_detail::FastWriteParams>&
RawSetAsWriteParams(JSContext* cx)
{
if (mType == eWriteParams) {
return mValue.mWriteParams.Value();
}
MOZ_ASSERT(mType == eUninitialized);
mType = eWriteParams;
return mValue.mWriteParams.SetValue(cx);
}
[[nodiscard]] inline RootedDictionary<binding_detail::FastWriteParams>&
SetAsWriteParams(JSContext* cx)
{
if (mType == eWriteParams) {
return mValue.mWriteParams.Value();
}
Uninit();
mType = eWriteParams;
return mValue.mWriteParams.SetValue(cx);
}
inline bool
IsWriteParams() const
{
return mType == eWriteParams;
}
inline RootedDictionary<binding_detail::FastWriteParams>&
GetAsWriteParams()
{
MOZ_RELEASE_ASSERT(IsWriteParams(), "Wrong type!");
return mValue.mWriteParams.Value();
}
inline const WriteParams&
GetAsWriteParams() const
{
MOZ_RELEASE_ASSERT(IsWriteParams(), "Wrong type!");
return mValue.mWriteParams.Value();
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> value, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> value, const char* sourceDescription = "Value", bool passedToJSImpl = false);
inline void
Uninit()
{
switch (mType) {
case eUninitialized: {
break;
}
case eArrayBufferView: {
DestroyArrayBufferView();
break;
}
case eArrayBuffer: {
DestroyArrayBuffer();
break;
}
case eBlob: {
DestroyBlob();
break;
}
case eUTF8String: {
DestroyUTF8String();
break;
}
case eWriteParams: {
DestroyWriteParams();
break;
}
}
}
bool
ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
private:
bool
TrySetToArrayBufferView(BindingCallContext& cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
bool
TrySetToArrayBufferView(JSContext* cx_, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
inline void
DestroyArrayBufferView()
{
MOZ_RELEASE_ASSERT(IsArrayBufferView(), "Wrong type!");
mValue.mArrayBufferView.Destroy();
mType = eUninitialized;
}
bool
TrySetToArrayBuffer(BindingCallContext& cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
bool
TrySetToArrayBuffer(JSContext* cx_, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
inline void
DestroyArrayBuffer()
{
MOZ_RELEASE_ASSERT(IsArrayBuffer(), "Wrong type!");
mValue.mArrayBuffer.Destroy();
mType = eUninitialized;
}
bool
TrySetToBlob(BindingCallContext& cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
bool
TrySetToBlob(JSContext* cx_, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
inline void
DestroyBlob()
{
MOZ_RELEASE_ASSERT(IsBlob(), "Wrong type!");
mValue.mBlob.Destroy();
mType = eUninitialized;
}
bool
TrySetToUTF8String(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
inline void
DestroyUTF8String()
{
MOZ_RELEASE_ASSERT(IsUTF8String(), "Wrong type!");
mValue.mUTF8String.Destroy();
mType = eUninitialized;
}
bool
TrySetToWriteParams(BindingCallContext& cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
bool
TrySetToWriteParams(JSContext* cx_, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
inline void
DestroyWriteParams()
{
MOZ_RELEASE_ASSERT(IsWriteParams(), "Wrong type!");
mValue.mWriteParams.Destroy();
mType = eUninitialized;
}
};
class OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams : public AllOwningUnionBase,
public UnionWithTypedArraysBase
{
friend void ImplCycleCollectionUnlink(OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams& aUnion);
public:
using ApplyToTypedArrays = binding_detail::ApplyToTypedArraysHelper<OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams, true, ArrayBufferView, ArrayBuffer>;
private:
enum TypeOrUninit
{
eUninitialized,
eArrayBufferView,
eArrayBuffer,
eBlob,
eUTF8String,
eWriteParams
};
public:
enum class Type
{
eArrayBufferView = TypeOrUninit::eArrayBufferView,
eArrayBuffer = TypeOrUninit::eArrayBuffer,
eBlob = TypeOrUninit::eBlob,
eUTF8String = TypeOrUninit::eUTF8String,
eWriteParams = TypeOrUninit::eWriteParams
};
private:
union Value
{
UnionMember<ArrayBufferView > mArrayBufferView;
UnionMember<ArrayBuffer > mArrayBuffer;
UnionMember<OwningNonNull<mozilla::dom::Blob> > mBlob;
UnionMember<nsCString > mUTF8String;
UnionMember<WriteParams > mWriteParams;
};
TypeOrUninit mType;
Value mValue;
OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams(const OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams&) = delete;
OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams& operator=(const OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams&) = delete;
public:
explicit inline OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams()
: mType(eUninitialized)
{
}
OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams(OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams&& aOther);
inline ~OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams()
{
Uninit();
}
[[nodiscard]] ArrayBufferView&
RawSetAsArrayBufferView();
[[nodiscard]] ArrayBufferView&
SetAsArrayBufferView();
inline bool
IsArrayBufferView() const
{
return mType == eArrayBufferView;
}
inline ArrayBufferView&
GetAsArrayBufferView()
{
MOZ_RELEASE_ASSERT(IsArrayBufferView(), "Wrong type!");
return mValue.mArrayBufferView.Value();
}
inline ArrayBufferView const &
GetAsArrayBufferView() const
{
MOZ_RELEASE_ASSERT(IsArrayBufferView(), "Wrong type!");
return mValue.mArrayBufferView.Value();
}
[[nodiscard]] ArrayBuffer&
RawSetAsArrayBuffer();
[[nodiscard]] ArrayBuffer&
SetAsArrayBuffer();
inline bool
IsArrayBuffer() const
{
return mType == eArrayBuffer;
}
inline ArrayBuffer&
GetAsArrayBuffer()
{
MOZ_RELEASE_ASSERT(IsArrayBuffer(), "Wrong type!");
return mValue.mArrayBuffer.Value();
}
inline ArrayBuffer const &
GetAsArrayBuffer() const
{
MOZ_RELEASE_ASSERT(IsArrayBuffer(), "Wrong type!");
return mValue.mArrayBuffer.Value();
}
[[nodiscard]] OwningNonNull<mozilla::dom::Blob>&
RawSetAsBlob();
[[nodiscard]] OwningNonNull<mozilla::dom::Blob>&
SetAsBlob();
inline bool
IsBlob() const
{
return mType == eBlob;
}
inline OwningNonNull<mozilla::dom::Blob>&
GetAsBlob()
{
MOZ_RELEASE_ASSERT(IsBlob(), "Wrong type!");
return mValue.mBlob.Value();
}
inline OwningNonNull<mozilla::dom::Blob> const &
GetAsBlob() const
{
MOZ_RELEASE_ASSERT(IsBlob(), "Wrong type!");
return mValue.mBlob.Value();
}
[[nodiscard]] nsCString&
RawSetAsUTF8String();
[[nodiscard]] nsCString&
SetAsUTF8String();
template <int N>
inline void
SetStringLiteral(const nsCString::char_type (&aData)[N])
{
RawSetAsUTF8String().AssignLiteral(aData);
}
inline bool
IsUTF8String() const
{
return mType == eUTF8String;
}
inline nsCString&
GetAsUTF8String()
{
MOZ_RELEASE_ASSERT(IsUTF8String(), "Wrong type!");
return mValue.mUTF8String.Value();
}
inline nsCString const &
GetAsUTF8String() const
{
MOZ_RELEASE_ASSERT(IsUTF8String(), "Wrong type!");
return mValue.mUTF8String.Value();
}
[[nodiscard]] WriteParams&
RawSetAsWriteParams();
[[nodiscard]] WriteParams&
SetAsWriteParams();
inline bool
IsWriteParams() const
{
return mType == eWriteParams;
}
inline WriteParams&
GetAsWriteParams()
{
MOZ_RELEASE_ASSERT(IsWriteParams(), "Wrong type!");
return mValue.mWriteParams.Value();
}
inline WriteParams const &
GetAsWriteParams() const
{
MOZ_RELEASE_ASSERT(IsWriteParams(), "Wrong type!");
return mValue.mWriteParams.Value();
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> value, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> value, const char* sourceDescription = "Value", bool passedToJSImpl = false);
void
Uninit();
bool
ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;
void
TraceUnion(JSTracer* trc);
OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams&
operator=(OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8StringOrWriteParams&& aOther);
inline Type
GetType() const
{
MOZ_RELEASE_ASSERT(mType != eUninitialized);
return static_cast<Type>(mType);
}
private:
bool
TrySetToArrayBufferView(BindingCallContext& cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
bool
TrySetToArrayBufferView(JSContext* cx_, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
void
DestroyArrayBufferView();
bool
TrySetToArrayBuffer(BindingCallContext& cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
bool
TrySetToArrayBuffer(JSContext* cx_, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
void
DestroyArrayBuffer();
bool
TrySetToBlob(BindingCallContext& cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
bool
TrySetToBlob(JSContext* cx_, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
void
DestroyBlob();
bool
TrySetToUTF8String(JSContext* cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
void
DestroyUTF8String();
bool
TrySetToWriteParams(BindingCallContext& cx, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
bool
TrySetToWriteParams(JSContext* cx_, JS::Handle<JS::Value> value, bool& tryNext, bool passedToJSImpl = false);
void
DestroyWriteParams();
};
namespace FileSystemWritableFileStream_Binding {
typedef mozilla::dom::FileSystemWritableFileStream NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::dom::FileSystemWritableFileStream* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
template <class T>
inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
{
JS::Rooted<JSObject*> reflector(aCx);
return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
}
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::FileSystemWritableFileStream,
&CreateInterfaceObjects,
DefineInterfaceProperty::Always);
}
} // namespace FileSystemWritableFileStream_Binding
} // namespace dom
template <>
struct MaxContiguousEnumValue<dom::WriteCommandType>
{
static constexpr dom::WriteCommandType value = dom::WriteCommandType::Truncate;
static_assert(static_cast<uint8_t>(dom::WriteCommandType::Write) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(std::size(dom::binding_detail::EnumStrings<dom::WriteCommandType>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
} // namespace mozilla
#endif // DOM_FILESYSTEMWRITABLEFILESTREAMBINDING_H_