V8HTMLPlugInElementCustom.cpp [plain text]
#include "config.h"
#include "HTMLPlugInElement.h"
#include "ScriptInstance.h"
#include "V8Binding.h"
#include "V8CustomBinding.h"
#include "V8Proxy.h"
#include "v8_npobject.h"
namespace WebCore {
NAMED_PROPERTY_GETTER(HTMLPlugInElement)
{
INC_STATS("DOM.HTMLPlugInElement.NamedPropertyGetter");
HTMLPlugInElement* imp = V8Proxy::DOMWrapperToNode<HTMLPlugInElement>(info.Holder());
ScriptInstance scriptInstance = imp->getInstance();
if (!scriptInstance)
return notHandledByInterceptor();
v8::Local<v8::Object> instance = v8::Local<v8::Object>::New(scriptInstance->instance());
if (instance.IsEmpty())
return notHandledByInterceptor();
return NPObjectGetNamedProperty(instance, name);
}
NAMED_PROPERTY_SETTER(HTMLPlugInElement)
{
INC_STATS("DOM.HTMLPlugInElement.NamedPropertySetter");
HTMLPlugInElement* imp = V8Proxy::DOMWrapperToNode<HTMLPlugInElement>(info.Holder());
ScriptInstance scriptInstance = imp->getInstance();
if (!scriptInstance)
return notHandledByInterceptor();
v8::Local<v8::Object> instance = v8::Local<v8::Object>::New(scriptInstance->instance());
if (instance.IsEmpty())
return notHandledByInterceptor();
return NPObjectSetNamedProperty(instance, name, value);
}
CALLBACK_FUNC_DECL(HTMLPlugInElement)
{
INC_STATS("DOM.HTMLPluginElement()");
return NPObjectInvokeDefaultHandler(args);
}
INDEXED_PROPERTY_GETTER(HTMLPlugInElement)
{
INC_STATS("DOM.HTMLPlugInElement.IndexedPropertyGetter");
HTMLPlugInElement* imp = V8Proxy::DOMWrapperToNode<HTMLPlugInElement>(info.Holder());
ScriptInstance scriptInstance = imp->getInstance();
if (!scriptInstance)
return notHandledByInterceptor();
v8::Local<v8::Object> instance = v8::Local<v8::Object>::New(scriptInstance->instance());
if (instance.IsEmpty())
return notHandledByInterceptor();
return NPObjectGetIndexedProperty(instance, index);
}
INDEXED_PROPERTY_SETTER(HTMLPlugInElement)
{
INC_STATS("DOM.HTMLPlugInElement.IndexedPropertySetter");
HTMLPlugInElement* imp = V8Proxy::DOMWrapperToNode<HTMLPlugInElement>(info.Holder());
ScriptInstance scriptInstance = imp->getInstance();
if (!scriptInstance)
return notHandledByInterceptor();
v8::Local<v8::Object> instance = v8::Local<v8::Object>::New(scriptInstance->instance());
if (instance.IsEmpty())
return notHandledByInterceptor();
return NPObjectSetIndexedProperty(instance, index, value);
}
}