Copy as Markdown
Other Tools
/* THIS FILE IS AUTOGENERATED FROM TextDecoder.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_TEXTDECODERBINDING_H_
#define DOM_TEXTDECODERBINDING_H_
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PrototypeList.h"
namespace mozilla {
namespace dom {
struct NativePropertyHooks;
class ProtoAndIfaceCache;
struct TextDecodeOptionsAtoms;
class TextDecoder;
struct TextDecoderOptionsAtoms;
} // namespace dom
} // namespace mozilla
namespace mozilla::dom {
struct TextDecodeOptions : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR bool mStream;
TextDecodeOptions();
explicit inline TextDecodeOptions(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
TextDecodeOptions(TextDecodeOptions&& aOther) = default;
explicit inline TextDecodeOptions(const TextDecodeOptions& 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);
void
TraceDictionary(JSTracer* trc);
TextDecodeOptions&
operator=(const TextDecodeOptions& aOther);
private:
static bool
InitIds(JSContext* cx, TextDecodeOptionsAtoms* atomsCache);
};
namespace binding_detail {
struct FastTextDecodeOptions : public TextDecodeOptions
{
inline FastTextDecodeOptions()
: TextDecodeOptions(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct TextDecoderOptions : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR bool mFatal;
MOZ_INIT_OUTSIDE_CTOR bool mIgnoreBOM;
TextDecoderOptions();
explicit inline TextDecoderOptions(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
TextDecoderOptions(TextDecoderOptions&& aOther) = default;
explicit inline TextDecoderOptions(const TextDecoderOptions& 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);
void
TraceDictionary(JSTracer* trc);
TextDecoderOptions&
operator=(const TextDecoderOptions& aOther);
private:
static bool
InitIds(JSContext* cx, TextDecoderOptionsAtoms* atomsCache);
};
namespace binding_detail {
struct FastTextDecoderOptions : public TextDecoderOptions
{
inline FastTextDecoderOptions()
: TextDecoderOptions(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace TextDecoder_Binding {
typedef mozilla::dom::TextDecoder NativeType;
bool
Wrap(JSContext* aCx, mozilla::dom::TextDecoder* aObject, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
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::TextDecoder,
&CreateInterfaceObjects,
DefineInterfaceProperty::Always);
}
} // namespace TextDecoder_Binding
} // namespace mozilla::dom
#endif // DOM_TEXTDECODERBINDING_H_