V8TestActiveDOMObject.h [plain text]
#ifndef V8TestActiveDOMObject_h
#define V8TestActiveDOMObject_h
#include "TestActiveDOMObject.h"
#include "V8DOMWrapper.h"
#include "WrapperTypeInfo.h"
#include <v8.h>
#include <wtf/HashMap.h>
#include <wtf/text/StringHash.h>
namespace WebCore {
class V8TestActiveDOMObject {
public:
static const bool hasDependentLifetime = false;
static bool HasInstance(v8::Handle<v8::Value>);
static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
static v8::Persistent<v8::FunctionTemplate> GetTemplate();
static TestActiveDOMObject* toNative(v8::Handle<v8::Object> object)
{
return reinterpret_cast<TestActiveDOMObject*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
}
inline static v8::Handle<v8::Object> wrap(TestActiveDOMObject*, v8::Isolate* = 0);
static void derefObject(void*);
static WrapperTypeInfo info;
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
static bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType, v8::Local<v8::Value> data);
static bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType, v8::Local<v8::Value> data);
private:
static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestActiveDOMObject>, v8::Isolate*);
};
v8::Handle<v8::Object> V8TestActiveDOMObject::wrap(TestActiveDOMObject* impl, v8::Isolate* isolate)
{
v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
if (!wrapper.IsEmpty())
return wrapper;
return V8TestActiveDOMObject::wrapSlow(impl, isolate);
}
inline v8::Handle<v8::Value> toV8(TestActiveDOMObject* impl, v8::Isolate* isolate = 0)
{
if (!impl)
return v8::Null();
return V8TestActiveDOMObject::wrap(impl, isolate);
}
inline v8::Handle<v8::Value> toV8(PassRefPtr< TestActiveDOMObject > impl, v8::Isolate* isolate = 0)
{
return toV8(impl.get(), isolate);
}
}
#endif // V8TestActiveDOMObject_h