#ifndef JSNPMethod_h
#define JSNPMethod_h
#if ENABLE(NETSCAPE_PLUGIN_API)
#include <JavaScriptCore/FunctionPrototype.h>
#include <JavaScriptCore/InternalFunction.h>
#include <JavaScriptCore/JSGlobalObject.h>
typedef void* NPIdentifier;
namespace WebKit {
class JSNPMethod final : public JSC::InternalFunction {
public:
using Base = JSC::InternalFunction;
template<typename CellType, JSC::SubspaceAccess>
static JSC::IsoSubspace* subspaceFor(JSC::VM& vm)
{
return subspaceForImpl(vm);
}
static JSNPMethod* create(JSC::JSGlobalObject* globalObject, const String& name, NPIdentifier npIdent)
{
JSC::VM& vm = globalObject->vm();
JSC::Structure* structure = createStructure(globalObject->vm(), globalObject, globalObject->functionPrototype());
JSNPMethod* method = new (JSC::allocateCell<JSNPMethod>(vm.heap)) JSNPMethod(globalObject, structure, npIdent);
method->finishCreation(vm, name);
return method;
}
DECLARE_INFO;
NPIdentifier npIdentifier() const { return m_npIdentifier; }
private:
static JSC::IsoSubspace* subspaceForImpl(JSC::VM&);
JSNPMethod(JSC::JSGlobalObject*, JSC::Structure*, NPIdentifier);
void finishCreation(JSC::VM&, const String& name);
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
{
return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::InternalFunctionType, StructureFlags), info());
}
NPIdentifier m_npIdentifier;
};
}
#endif // ENABLE(NETSCAPE_PLUGIN_API)
#endif // JSNPMethod_h