#ifndef JSNPMethod_h
#define JSNPMethod_h
#include <JavaScriptCore/FunctionPrototype.h>
#include <JavaScriptCore/InternalFunction.h>
#include <JavaScriptCore/JSGlobalObject.h>
typedef void* NPIdentifier;
namespace WebKit {
class JSNPMethod : public JSC::InternalFunction {
public:
typedef JSC::InternalFunction Base;
static JSNPMethod* create(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject, const JSC::Identifier& name, NPIdentifier npIdent)
{
JSC::Structure* structure = createStructure(exec->globalData(), globalObject, globalObject->functionPrototype());
JSNPMethod* method = new (JSC::allocateCell<JSNPMethod>(*exec->heap())) JSNPMethod(globalObject, structure, npIdent);
method->finishCreation(exec->globalData(), name);
return method;
}
static const JSC::ClassInfo s_info;
NPIdentifier npIdentifier() const { return m_npIdentifier; }
protected:
void finishCreation(JSC::JSGlobalData&, const JSC::Identifier& name);
private:
JSNPMethod(JSC::JSGlobalObject*, JSC::Structure*, NPIdentifier);
static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
{
return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
}
static JSC::CallType getCallData(JSC::JSCell*, JSC::CallData&);
NPIdentifier m_npIdentifier;
};
}
#endif // JSNPMethod_h