| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | |
| 6 | |
| 7 #include "config.h" | |
| 8 #include "V8TestInterfaceNode.h" | |
| 9 | |
| 10 #include "bindings/core/v8/ExceptionState.h" | |
| 11 #include "bindings/core/v8/V8AbstractEventListener.h" | |
| 12 #include "bindings/core/v8/V8DOMConfiguration.h" | |
| 13 #include "bindings/core/v8/V8EventListenerList.h" | |
| 14 #include "bindings/core/v8/V8HiddenValue.h" | |
| 15 #include "bindings/core/v8/V8ObjectConstructor.h" | |
| 16 #include "bindings/tests/v8/V8TestInterfaceEmpty.h" | |
| 17 #include "core/HTMLNames.h" | |
| 18 #include "core/dom/ContextFeatures.h" | |
| 19 #include "core/dom/Document.h" | |
| 20 #include "core/dom/custom/CustomElementProcessingStack.h" | |
| 21 #include "platform/RuntimeEnabledFeatures.h" | |
| 22 #include "platform/TraceEvent.h" | |
| 23 #include "wtf/GetPtr.h" | |
| 24 #include "wtf/RefPtr.h" | |
| 25 | |
| 26 namespace blink { | |
| 27 | |
| 28 const WrapperTypeInfo V8TestInterfaceNode::wrapperTypeInfo = { gin::kEmbedderBli
nk, V8TestInterfaceNode::domTemplate, V8TestInterfaceNode::refObject, V8TestInte
rfaceNode::derefObject, V8TestInterfaceNode::createPersistentHandle, 0, V8TestIn
terfaceNode::toEventTarget, 0, V8TestInterfaceNode::installConditionallyEnabledM
ethods, V8TestInterfaceNode::installConditionallyEnabledProperties, &V8Node::wra
pperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::Node
ClassId, WrapperTypeInfo::Dependent, WrapperTypeInfo::WillBeGarbageCollectedObje
ct }; | |
| 29 | |
| 30 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eNode.h. | |
| 31 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | |
| 32 // bindings/core/v8/ScriptWrappable.h. | |
| 33 const WrapperTypeInfo& TestInterfaceNode::s_wrapperTypeInfo = V8TestInterfaceNod
e::wrapperTypeInfo; | |
| 34 | |
| 35 namespace TestInterfaceNodeV8Internal { | |
| 36 | |
| 37 template <typename T> void V8_USE(T) { } | |
| 38 | |
| 39 static void stringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Va
lue>& info) | |
| 40 { | |
| 41 v8::Handle<v8::Object> holder = info.Holder(); | |
| 42 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | |
| 43 v8SetReturnValueString(info, impl->stringAttribute(), info.GetIsolate()); | |
| 44 } | |
| 45 | |
| 46 static void stringAttributeAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | |
| 47 { | |
| 48 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | |
| 49 TestInterfaceNodeV8Internal::stringAttributeAttributeGetter(info); | |
| 50 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 51 } | |
| 52 | |
| 53 static void stringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v
8::PropertyCallbackInfo<void>& info) | |
| 54 { | |
| 55 v8::Handle<v8::Object> holder = info.Holder(); | |
| 56 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | |
| 57 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); | |
| 58 impl->setStringAttribute(cppValue); | |
| 59 } | |
| 60 | |
| 61 static void stringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Lo
cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
| 62 { | |
| 63 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | |
| 64 TestInterfaceNodeV8Internal::stringAttributeAttributeSetter(v8Value, info); | |
| 65 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 66 } | |
| 67 | |
| 68 static void readonlyTestInterfaceEmptyAttributeAttributeGetter(const v8::Propert
yCallbackInfo<v8::Value>& info) | |
| 69 { | |
| 70 v8::Handle<v8::Object> holder = info.Holder(); | |
| 71 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | |
| 72 v8SetReturnValueFast(info, WTF::getPtr(impl->readonlyTestInterfaceEmptyAttri
bute()), impl); | |
| 73 } | |
| 74 | |
| 75 static void readonlyTestInterfaceEmptyAttributeAttributeGetterCallback(v8::Local
<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | |
| 76 { | |
| 77 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | |
| 78 TestInterfaceNodeV8Internal::readonlyTestInterfaceEmptyAttributeAttributeGet
ter(info); | |
| 79 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 80 } | |
| 81 | |
| 82 static void eventHandlerAttributeAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) | |
| 83 { | |
| 84 v8::Handle<v8::Object> holder = info.Holder(); | |
| 85 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | |
| 86 EventListener* cppValue(impl->eventHandlerAttribute()); | |
| 87 v8SetReturnValue(info, cppValue ? v8::Handle<v8::Value>(V8AbstractEventListe
ner::cast(cppValue)->getListenerObject(impl->executionContext())) : v8::Handle<v
8::Value>(v8::Null(info.GetIsolate()))); | |
| 88 } | |
| 89 | |
| 90 static void eventHandlerAttributeAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | |
| 91 { | |
| 92 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | |
| 93 TestInterfaceNodeV8Internal::eventHandlerAttributeAttributeGetter(info); | |
| 94 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 95 } | |
| 96 | |
| 97 static void eventHandlerAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
onst v8::PropertyCallbackInfo<void>& info) | |
| 98 { | |
| 99 v8::Handle<v8::Object> holder = info.Holder(); | |
| 100 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | |
| 101 impl->setEventHandlerAttribute(V8EventListenerList::getEventListener(ScriptS
tate::current(info.GetIsolate()), v8Value, true, ListenerFindOrCreate)); | |
| 102 } | |
| 103 | |
| 104 static void eventHandlerAttributeAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
| 105 { | |
| 106 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | |
| 107 TestInterfaceNodeV8Internal::eventHandlerAttributeAttributeSetter(v8Value, i
nfo); | |
| 108 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 109 } | |
| 110 | |
| 111 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetter(c
onst v8::PropertyCallbackInfo<v8::Value>& info) | |
| 112 { | |
| 113 v8::Handle<v8::Object> holder = info.Holder(); | |
| 114 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | |
| 115 v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsReadonlyTestInt
erfaceEmptyAttribute()), impl); | |
| 116 } | |
| 117 | |
| 118 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCa
llback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | |
| 119 { | |
| 120 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | |
| 121 TestInterfaceNodeV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttri
buteAttributeGetter(info); | |
| 122 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 123 } | |
| 124 | |
| 125 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterFo
rMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info) | |
| 126 { | |
| 127 v8::Handle<v8::Object> holder = info.Holder(); | |
| 128 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | |
| 129 v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBindingsReadonl
yTestInterfaceEmptyAttribute())); | |
| 130 } | |
| 131 | |
| 132 static void perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCa
llbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Val
ue>& info) | |
| 133 { | |
| 134 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | |
| 135 TestInterfaceNodeV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyAttri
buteAttributeGetterForMainWorld(info); | |
| 136 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 137 } | |
| 138 | |
| 139 static void reflectStringAttributeAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) | |
| 140 { | |
| 141 v8::Handle<v8::Object> holder = info.Holder(); | |
| 142 Element* impl = V8Element::toImpl(holder); | |
| 143 v8SetReturnValueString(info, impl->fastGetAttribute(HTMLNames::reflectstring
attributeAttr), info.GetIsolate()); | |
| 144 } | |
| 145 | |
| 146 static void reflectStringAttributeAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | |
| 147 { | |
| 148 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | |
| 149 TestInterfaceNodeV8Internal::reflectStringAttributeAttributeGetter(info); | |
| 150 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 151 } | |
| 152 | |
| 153 static void reflectStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<void>& info) | |
| 154 { | |
| 155 v8::Handle<v8::Object> holder = info.Holder(); | |
| 156 Element* impl = V8Element::toImpl(holder); | |
| 157 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); | |
| 158 impl->setAttribute(HTMLNames::reflectstringattributeAttr, cppValue); | |
| 159 } | |
| 160 | |
| 161 static void reflectStringAttributeAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
| 162 { | |
| 163 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | |
| 164 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; | |
| 165 TestInterfaceNodeV8Internal::reflectStringAttributeAttributeSetter(v8Value,
info); | |
| 166 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 167 } | |
| 168 | |
| 169 static void reflectUrlStringAttributeAttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) | |
| 170 { | |
| 171 v8::Handle<v8::Object> holder = info.Holder(); | |
| 172 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | |
| 173 v8SetReturnValueString(info, impl->getURLAttribute(HTMLNames::reflecturlstri
ngattributeAttr), info.GetIsolate()); | |
| 174 } | |
| 175 | |
| 176 static void reflectUrlStringAttributeAttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) | |
| 177 { | |
| 178 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | |
| 179 TestInterfaceNodeV8Internal::reflectUrlStringAttributeAttributeGetter(info); | |
| 180 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 181 } | |
| 182 | |
| 183 static void reflectUrlStringAttributeAttributeSetter(v8::Local<v8::Value> v8Valu
e, const v8::PropertyCallbackInfo<void>& info) | |
| 184 { | |
| 185 v8::Handle<v8::Object> holder = info.Holder(); | |
| 186 Element* impl = V8Element::toImpl(holder); | |
| 187 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); | |
| 188 impl->setAttribute(HTMLNames::reflecturlstringattributeAttr, cppValue); | |
| 189 } | |
| 190 | |
| 191 static void reflectUrlStringAttributeAttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
| 192 { | |
| 193 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | |
| 194 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; | |
| 195 TestInterfaceNodeV8Internal::reflectUrlStringAttributeAttributeSetter(v8Valu
e, info); | |
| 196 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 197 } | |
| 198 | |
| 199 static void testInterfaceEmptyMethodMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | |
| 200 { | |
| 201 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder()); | |
| 202 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceEmptyMethod()), im
pl); | |
| 203 } | |
| 204 | |
| 205 static void testInterfaceEmptyMethodMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | |
| 206 { | |
| 207 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | |
| 208 TestInterfaceNodeV8Internal::testInterfaceEmptyMethodMethod(info); | |
| 209 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 210 } | |
| 211 | |
| 212 static void perWorldBindingsTestInterfaceEmptyMethodMethod(const v8::FunctionCal
lbackInfo<v8::Value>& info) | |
| 213 { | |
| 214 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder()); | |
| 215 v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEm
ptyMethod()), impl); | |
| 216 } | |
| 217 | |
| 218 static void perWorldBindingsTestInterfaceEmptyMethodMethodCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) | |
| 219 { | |
| 220 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | |
| 221 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodMethod(
info); | |
| 222 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 223 } | |
| 224 | |
| 225 static void perWorldBindingsTestInterfaceEmptyMethodMethodForMainWorld(const v8:
:FunctionCallbackInfo<v8::Value>& info) | |
| 226 { | |
| 227 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder()); | |
| 228 v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBindingsTestInt
erfaceEmptyMethod())); | |
| 229 } | |
| 230 | |
| 231 static void perWorldBindingsTestInterfaceEmptyMethodMethodCallbackForMainWorld(c
onst v8::FunctionCallbackInfo<v8::Value>& info) | |
| 232 { | |
| 233 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | |
| 234 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodMethodF
orMainWorld(info); | |
| 235 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 236 } | |
| 237 | |
| 238 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethod(con
st v8::FunctionCallbackInfo<v8::Value>& info) | |
| 239 { | |
| 240 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder()); | |
| 241 bool optionalBooleanArgument; | |
| 242 { | |
| 243 v8::TryCatch block; | |
| 244 V8RethrowTryCatchScope rethrow(block); | |
| 245 if (UNLIKELY(info.Length() <= 0)) { | |
| 246 v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsTestInt
erfaceEmptyMethodOptionalBooleanArg()), impl); | |
| 247 return; | |
| 248 } | |
| 249 TONATIVE_VOID_INTERNAL(optionalBooleanArgument, info[0]->BooleanValue())
; | |
| 250 } | |
| 251 v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEm
ptyMethodOptionalBooleanArg(optionalBooleanArgument)), impl); | |
| 252 } | |
| 253 | |
| 254 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodCall
back(const v8::FunctionCallbackInfo<v8::Value>& info) | |
| 255 { | |
| 256 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | |
| 257 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodOptiona
lBooleanArgMethod(info); | |
| 258 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 259 } | |
| 260 | |
| 261 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodForM
ainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) | |
| 262 { | |
| 263 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder()); | |
| 264 bool optionalBooleanArgument; | |
| 265 { | |
| 266 v8::TryCatch block; | |
| 267 V8RethrowTryCatchScope rethrow(block); | |
| 268 if (UNLIKELY(info.Length() <= 0)) { | |
| 269 v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBinding
sTestInterfaceEmptyMethodOptionalBooleanArg())); | |
| 270 return; | |
| 271 } | |
| 272 TONATIVE_VOID_INTERNAL(optionalBooleanArgument, info[0]->BooleanValue())
; | |
| 273 } | |
| 274 v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBindingsTestInt
erfaceEmptyMethodOptionalBooleanArg(optionalBooleanArgument))); | |
| 275 } | |
| 276 | |
| 277 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodCall
backForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) | |
| 278 { | |
| 279 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | |
| 280 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodOptiona
lBooleanArgMethodForMainWorld(info); | |
| 281 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
| 282 } | |
| 283 | |
| 284 } // namespace TestInterfaceNodeV8Internal | |
| 285 | |
| 286 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceNodeAttri
butes[] = { | |
| 287 {"stringAttribute", TestInterfaceNodeV8Internal::stringAttributeAttributeGet
terCallback, TestInterfaceNodeV8Internal::stringAttributeAttributeSetterCallback
, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Property
Attribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguratio
n::OnInstance}, | |
| 288 {"readonlyTestInterfaceEmptyAttribute", TestInterfaceNodeV8Internal::readonl
yTestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8:
:AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DO
MConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, | |
| 289 {"eventHandlerAttribute", TestInterfaceNodeV8Internal::eventHandlerAttribute
AttributeGetterCallback, TestInterfaceNodeV8Internal::eventHandlerAttributeAttri
buteSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static
_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts,
V8DOMConfiguration::OnInstance}, | |
| 290 {"perWorldBindingsReadonlyTestInterfaceEmptyAttribute", TestInterfaceNodeV8I
nternal::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallb
ack, 0, TestInterfaceNodeV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyA
ttributeAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl
>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration
::ExposedToAllScripts, V8DOMConfiguration::OnInstance}, | |
| 291 {"reflectStringAttribute", TestInterfaceNodeV8Internal::reflectStringAttribu
teAttributeGetterCallback, TestInterfaceNodeV8Internal::reflectStringAttributeAt
tributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), sta
tic_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScrip
ts, V8DOMConfiguration::OnInstance}, | |
| 292 {"reflectUrlStringAttribute", TestInterfaceNodeV8Internal::reflectUrlStringA
ttributeAttributeGetterCallback, TestInterfaceNodeV8Internal::reflectUrlStringAt
tributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFA
ULT), static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedT
oAllScripts, V8DOMConfiguration::OnInstance}, | |
| 293 }; | |
| 294 | |
| 295 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceNodeMethods[
] = { | |
| 296 {"testInterfaceEmptyMethod", TestInterfaceNodeV8Internal::testInterfaceEmpty
MethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, | |
| 297 {"perWorldBindingsTestInterfaceEmptyMethod", TestInterfaceNodeV8Internal::pe
rWorldBindingsTestInterfaceEmptyMethodMethodCallback, TestInterfaceNodeV8Interna
l::perWorldBindingsTestInterfaceEmptyMethodMethodCallbackForMainWorld, 0, V8DOMC
onfiguration::ExposedToAllScripts}, | |
| 298 {"perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg", TestInterface
NodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethod
Callback, TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodO
ptionalBooleanArgMethodCallbackForMainWorld, 0, V8DOMConfiguration::ExposedToAll
Scripts}, | |
| 299 }; | |
| 300 | |
| 301 static void installV8TestInterfaceNodeTemplate(v8::Handle<v8::FunctionTemplate>
functionTemplate, v8::Isolate* isolate) | |
| 302 { | |
| 303 functionTemplate->ReadOnlyPrototype(); | |
| 304 | |
| 305 v8::Local<v8::Signature> defaultSignature; | |
| 306 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceNode", V8Node::domTemplate(isolate), V8TestInterfaceNode::int
ernalFieldCount, | |
| 307 V8TestInterfaceNodeAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceNodeAttri
butes), | |
| 308 0, 0, | |
| 309 V8TestInterfaceNodeMethods, WTF_ARRAY_LENGTH(V8TestInterfaceNodeMethods)
, | |
| 310 isolate); | |
| 311 v8::Local<v8::ObjectTemplate> instanceTemplate ALLOW_UNUSED = functionTempla
te->InstanceTemplate(); | |
| 312 v8::Local<v8::ObjectTemplate> prototypeTemplate ALLOW_UNUSED = functionTempl
ate->PrototypeTemplate(); | |
| 313 | |
| 314 // Custom toString template | |
| 315 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:from(isolate)->toStringTemplate()); | |
| 316 } | |
| 317 | |
| 318 v8::Handle<v8::FunctionTemplate> V8TestInterfaceNode::domTemplate(v8::Isolate* i
solate) | |
| 319 { | |
| 320 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeI
nfo*>(&wrapperTypeInfo), installV8TestInterfaceNodeTemplate); | |
| 321 } | |
| 322 | |
| 323 bool V8TestInterfaceNode::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate
* isolate) | |
| 324 { | |
| 325 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); | |
| 326 } | |
| 327 | |
| 328 v8::Handle<v8::Object> V8TestInterfaceNode::findInstanceInPrototypeChain(v8::Han
dle<v8::Value> v8Value, v8::Isolate* isolate) | |
| 329 { | |
| 330 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | |
| 331 } | |
| 332 | |
| 333 TestInterfaceNode* V8TestInterfaceNode::toImplWithTypeCheck(v8::Isolate* isolate
, v8::Handle<v8::Value> value) | |
| 334 { | |
| 335 return hasInstance(value, isolate) ? blink::toScriptWrappableBase(v8::Handle
<v8::Object>::Cast(value))->toImpl<TestInterfaceNode>() : 0; | |
| 336 } | |
| 337 | |
| 338 EventTarget* V8TestInterfaceNode::toEventTarget(v8::Handle<v8::Object> object) | |
| 339 { | |
| 340 return toImpl(object); | |
| 341 } | |
| 342 | |
| 343 | |
| 344 void V8TestInterfaceNode::refObject(ScriptWrappableBase* internalPointer) | |
| 345 { | |
| 346 #if !ENABLE(OILPAN) | |
| 347 internalPointer->toImpl<TestInterfaceNode>()->ref(); | |
| 348 #endif | |
| 349 } | |
| 350 | |
| 351 void V8TestInterfaceNode::derefObject(ScriptWrappableBase* internalPointer) | |
| 352 { | |
| 353 #if !ENABLE(OILPAN) | |
| 354 internalPointer->toImpl<TestInterfaceNode>()->deref(); | |
| 355 #endif | |
| 356 } | |
| 357 | |
| 358 WrapperPersistentNode* V8TestInterfaceNode::createPersistentHandle(ScriptWrappab
leBase* internalPointer) | |
| 359 { | |
| 360 #if ENABLE(OILPAN) | |
| 361 return WrapperPersistent<TestInterfaceNode>::create(internalPointer->toImpl<
TestInterfaceNode>()); | |
| 362 #else | |
| 363 ASSERT_NOT_REACHED(); | |
| 364 return 0; | |
| 365 #endif | |
| 366 } | |
| 367 | |
| 368 template<> | |
| 369 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNode* impl, v8::Handle<v8::Objec
t> creationContext, v8::Isolate* isolate) | |
| 370 { | |
| 371 return toV8(impl, creationContext, isolate); | |
| 372 } | |
| 373 | |
| 374 } // namespace blink | |
| OLD | NEW |