Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM AudioNode.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_AUDIONODEBINDING_H_
#define DOM_AUDIONODEBINDING_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"
#include "mozilla/dom/PrototypeList.h"
namespace mozilla {
namespace dom {
class AudioNode;
struct AudioNodeOptionsAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
enum class ChannelCountMode : uint8_t {
Max,
Clamped_max,
Explicit,
};
namespace binding_detail {
template <> struct EnumStrings<ChannelCountMode> {
static const nsLiteralCString Values[3];
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, ChannelCountMode aArgument, JS::MutableHandle<JS::Value> aValue);
enum class ChannelInterpretation : uint8_t {
Speakers,
Discrete,
};
namespace binding_detail {
template <> struct EnumStrings<ChannelInterpretation> {
static const nsLiteralCString Values[2];
};
} // namespace binding_detail
bool
ToJSValue(JSContext* aCx, ChannelInterpretation aArgument, JS::MutableHandle<JS::Value> aValue);
struct AudioNodeOptions : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<uint32_t> mChannelCount;
MOZ_INIT_OUTSIDE_CTOR Optional<ChannelCountMode> mChannelCountMode;
MOZ_INIT_OUTSIDE_CTOR Optional<ChannelInterpretation> mChannelInterpretation;
AudioNodeOptions();
explicit inline AudioNodeOptions(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
AudioNodeOptions(AudioNodeOptions&& aOther) = default;
explicit inline AudioNodeOptions(const AudioNodeOptions& aOther)
{
*this = aOther;
}
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);
AudioNodeOptions&
operator=(const AudioNodeOptions& aOther);
private:
static bool
InitIds(JSContext* cx, AudioNodeOptionsAtoms* atomsCache);
};
namespace binding_detail {
struct FastAudioNodeOptions : public AudioNodeOptions
{
inline FastAudioNodeOptions()
: AudioNodeOptions(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace AudioNode_Binding {
typedef mozilla::dom::AudioNode NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
void
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::AudioNode,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
JSObject*
GetProtoObject(JSContext* aCx);
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::AudioNode,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace AudioNode_Binding
} // namespace dom
template <>
struct MaxContiguousEnumValue<dom::ChannelCountMode>
{
static constexpr dom::ChannelCountMode value = dom::ChannelCountMode::Explicit;
static_assert(static_cast<uint8_t>(dom::ChannelCountMode::Max) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(mozilla::ArrayLength(dom::binding_detail::EnumStrings<dom::ChannelCountMode>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
template <>
struct MaxContiguousEnumValue<dom::ChannelInterpretation>
{
static constexpr dom::ChannelInterpretation value = dom::ChannelInterpretation::Discrete;
static_assert(static_cast<uint8_t>(dom::ChannelInterpretation::Speakers) == 0,
"We rely on this in ContiguousEnumValues");
static_assert(mozilla::ArrayLength(dom::binding_detail::EnumStrings<dom::ChannelInterpretation>::Values) - 1 == UnderlyingValue(value),
"Mismatch between enum strings and enum count");
};
} // namespace mozilla
#endif // DOM_AUDIONODEBINDING_H_