JSTestSerializedScriptValueInterface.h [plain text]
#ifndef JSTestSerializedScriptValueInterface_h
#define JSTestSerializedScriptValueInterface_h
#if ENABLE(Condition1) || ENABLE(Condition2)
#include "JSDOMWrapper.h"
#include "TestSerializedScriptValueInterface.h"
#include <wtf/NeverDestroyed.h>
namespace WebCore {
class JSTestSerializedScriptValueInterface : public JSDOMWrapper {
public:
typedef JSDOMWrapper Base;
static JSTestSerializedScriptValueInterface* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestSerializedScriptValueInterface>&& impl)
{
JSTestSerializedScriptValueInterface* ptr = new (NotNull, JSC::allocateCell<JSTestSerializedScriptValueInterface>(globalObject->vm().heap)) JSTestSerializedScriptValueInterface(structure, globalObject, WTF::move(impl));
ptr->finishCreation(globalObject->vm());
return ptr;
}
static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
static TestSerializedScriptValueInterface* toWrapped(JSC::JSValue);
static void destroy(JSC::JSCell*);
~JSTestSerializedScriptValueInterface();
DECLARE_INFO;
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
{
return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
}
static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
JSC::WriteBarrier<JSC::Unknown> m_cachedValue;
JSC::WriteBarrier<JSC::Unknown> m_cachedReadonlyValue;
static void visitChildren(JSCell*, JSC::SlotVisitor&);
TestSerializedScriptValueInterface& impl() const { return *m_impl; }
void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
private:
TestSerializedScriptValueInterface* m_impl;
protected:
JSTestSerializedScriptValueInterface(JSC::Structure*, JSDOMGlobalObject*, Ref<TestSerializedScriptValueInterface>&&);
void finishCreation(JSC::VM& vm)
{
Base::finishCreation(vm);
ASSERT(inherits(info()));
}
};
class JSTestSerializedScriptValueInterfaceOwner : public JSC::WeakHandleOwner {
public:
virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
};
inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestSerializedScriptValueInterface*)
{
static NeverDestroyed<JSTestSerializedScriptValueInterfaceOwner> owner;
return &owner.get();
}
JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestSerializedScriptValueInterface*);
inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestSerializedScriptValueInterface& impl) { return toJS(exec, globalObject, &impl); }
}
#endif // ENABLE(Condition1) || ENABLE(Condition2)
#endif