Copy as Markdown
Other Tools
/* THIS FILE IS AUTOGENERATED FROM ExtensionPort.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_EXTENSIONPORTBINDING_H_
#define DOM_EXTENSIONPORTBINDING_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 ExtensionPortDescriptorAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;
} // namespace dom
namespace extensions {
class ExtensionPort;
} // namespace extensions
} // namespace mozilla
namespace mozilla::dom {
struct ExtensionPortDescriptor : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR nsString mName;
MOZ_INIT_OUTSIDE_CTOR nsString mPortId;
ExtensionPortDescriptor();
explicit inline ExtensionPortDescriptor(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
ExtensionPortDescriptor(ExtensionPortDescriptor&& aOther) = default;
explicit inline ExtensionPortDescriptor(const ExtensionPortDescriptor& 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);
ExtensionPortDescriptor&
operator=(const ExtensionPortDescriptor& aOther);
private:
static bool
InitIds(JSContext* cx, ExtensionPortDescriptorAtoms* atomsCache);
};
namespace binding_detail {
struct FastExtensionPortDescriptor : public ExtensionPortDescriptor
{
inline FastExtensionPortDescriptor()
: ExtensionPortDescriptor(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace ExtensionPort_Binding {
typedef mozilla::extensions::ExtensionPort NativeType;
bool
Wrap(JSContext* aCx, mozilla::extensions::ExtensionPort* 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);
} // namespace ExtensionPort_Binding
} // namespace mozilla::dom
#endif // DOM_EXTENSIONPORTBINDING_H_