| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
| 6 | 6 |
| 7 #include "V8TestInterfaceNode.h" | 7 #include "V8TestInterfaceNode.h" |
| 8 | 8 |
| 9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
| 10 #include "bindings/core/v8/V8AbstractEventListener.h" | 10 #include "bindings/core/v8/V8AbstractEventListener.h" |
| 11 #include "bindings/core/v8/V8DOMConfiguration.h" | 11 #include "bindings/core/v8/V8DOMConfiguration.h" |
| 12 #include "bindings/core/v8/V8EventListenerList.h" | 12 #include "bindings/core/v8/V8EventListenerList.h" |
| 13 #include "bindings/core/v8/V8ObjectConstructor.h" | 13 #include "bindings/core/v8/V8ObjectConstructor.h" |
| 14 #include "bindings/core/v8/V8TestInterfaceEmpty.h" | 14 #include "bindings/core/v8/V8TestInterfaceEmpty.h" |
| 15 #include "core/HTMLNames.h" | 15 #include "core/HTMLNames.h" |
| 16 #include "core/dom/Document.h" | 16 #include "core/dom/Document.h" |
| 17 #include "core/dom/custom/CustomElementProcessingStack.h" | 17 #include "core/dom/custom/CustomElementProcessingStack.h" |
| 18 #include "wtf/GetPtr.h" | 18 #include "wtf/GetPtr.h" |
| 19 #include "wtf/RefPtr.h" | 19 #include "wtf/RefPtr.h" |
| 20 | 20 |
| 21 namespace blink { | 21 namespace blink { |
| 22 | 22 |
| 23 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv
ial | 23 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv
ial |
| 24 // and does not depend on another global objects. | 24 // and does not depend on another global objects. |
| 25 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 25 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
| 26 #pragma clang diagnostic push | 26 #pragma clang diagnostic push |
| 27 #pragma clang diagnostic ignored "-Wglobal-constructors" | 27 #pragma clang diagnostic ignored "-Wglobal-constructors" |
| 28 #endif | 28 #endif |
| 29 const WrapperTypeInfo V8TestInterfaceNode::wrapperTypeInfo = { gin::kEmbedderBli
nk, V8TestInterfaceNode::domTemplate, V8TestInterfaceNode::refObject, V8TestInte
rfaceNode::derefObject, V8TestInterfaceNode::trace, 0, 0, V8TestInterfaceNode::p
reparePrototypeAndInterfaceObject, V8TestInterfaceNode::installConditionallyEnab
ledProperties, "TestInterfaceNode", &V8Node::wrapperTypeInfo, WrapperTypeInfo::W
rapperTypeObjectPrototype, WrapperTypeInfo::NodeClassId, WrapperTypeInfo::Inheri
tFromEventTarget, WrapperTypeInfo::Dependent, WrapperTypeInfo::GarbageCollectedO
bject }; | 29 const WrapperTypeInfo V8TestInterfaceNode::wrapperTypeInfo = { gin::kEmbedderBli
nk, V8TestInterfaceNode::domTemplate, V8TestInterfaceNode::trace, 0, 0, V8TestIn
terfaceNode::preparePrototypeAndInterfaceObject, V8TestInterfaceNode::installCon
ditionallyEnabledProperties, "TestInterfaceNode", &V8Node::wrapperTypeInfo, Wrap
perTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::NodeClassId, WrapperTy
peInfo::InheritFromEventTarget, WrapperTypeInfo::Dependent }; |
| 30 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 30 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
| 31 #pragma clang diagnostic pop | 31 #pragma clang diagnostic pop |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eNode.h. | 34 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eNode.h. |
| 35 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | 35 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
| 36 // bindings/core/v8/ScriptWrappable.h. | 36 // bindings/core/v8/ScriptWrappable.h. |
| 37 const WrapperTypeInfo& TestInterfaceNode::s_wrapperTypeInfo = V8TestInterfaceNod
e::wrapperTypeInfo; | 37 const WrapperTypeInfo& TestInterfaceNode::s_wrapperTypeInfo = V8TestInterfaceNod
e::wrapperTypeInfo; |
| 38 | 38 |
| 39 namespace TestInterfaceNodeV8Internal { | 39 namespace TestInterfaceNodeV8Internal { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 static void readonlyTestInterfaceEmptyAttributeAttributeGetterCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) | 104 static void readonlyTestInterfaceEmptyAttributeAttributeGetterCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) |
| 105 { | 105 { |
| 106 TestInterfaceNodeV8Internal::readonlyTestInterfaceEmptyAttributeAttributeGet
ter(info); | 106 TestInterfaceNodeV8Internal::readonlyTestInterfaceEmptyAttributeAttributeGet
ter(info); |
| 107 } | 107 } |
| 108 | 108 |
| 109 static void eventHandlerAttributeAttributeGetter(const v8::FunctionCallbackInfo<
v8::Value>& info) | 109 static void eventHandlerAttributeAttributeGetter(const v8::FunctionCallbackInfo<
v8::Value>& info) |
| 110 { | 110 { |
| 111 v8::Local<v8::Object> holder = info.Holder(); | 111 v8::Local<v8::Object> holder = info.Holder(); |
| 112 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); | 112 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); |
| 113 EventListener* cppValue(impl->eventHandlerAttribute()); | 113 EventListener* cppValue(WTF::getPtr(impl->eventHandlerAttribute())); |
| 114 v8SetReturnValue(info, cppValue ? v8::Local<v8::Value>(V8AbstractEventListen
er::cast(cppValue)->getListenerObject(impl->getExecutionContext())) : v8::Local<
v8::Value>(v8::Null(info.GetIsolate()))); | 114 v8SetReturnValue(info, cppValue ? v8::Local<v8::Value>(V8AbstractEventListen
er::cast(cppValue)->getListenerObject(impl->getExecutionContext())) : v8::Local<
v8::Value>(v8::Null(info.GetIsolate()))); |
| 115 } | 115 } |
| 116 | 116 |
| 117 static void eventHandlerAttributeAttributeGetterCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 117 static void eventHandlerAttributeAttributeGetterCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
| 118 { | 118 { |
| 119 TestInterfaceNodeV8Internal::eventHandlerAttributeAttributeGetter(info); | 119 TestInterfaceNodeV8Internal::eventHandlerAttributeAttributeGetter(info); |
| 120 } | 120 } |
| 121 | 121 |
| 122 static void eventHandlerAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
onst v8::FunctionCallbackInfo<v8::Value>& info) | 122 static void eventHandlerAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
onst v8::FunctionCallbackInfo<v8::Value>& info) |
| 123 { | 123 { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 static void reflectUrlStringAttributeAttributeSetterCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) | 210 static void reflectUrlStringAttributeAttributeSetterCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) |
| 211 { | 211 { |
| 212 v8::Local<v8::Value> v8Value = info[0]; | 212 v8::Local<v8::Value> v8Value = info[0]; |
| 213 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; | 213 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; |
| 214 TestInterfaceNodeV8Internal::reflectUrlStringAttributeAttributeSetter(v8Valu
e, info); | 214 TestInterfaceNodeV8Internal::reflectUrlStringAttributeAttributeSetter(v8Valu
e, info); |
| 215 } | 215 } |
| 216 | 216 |
| 217 static void testInterfaceEmptyMethodMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 217 static void testInterfaceEmptyMethodMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
| 218 { | 218 { |
| 219 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder()); | 219 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder()); |
| 220 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceEmptyMethod()), im
pl); | 220 v8SetReturnValueFast(info, impl->testInterfaceEmptyMethod(), impl); |
| 221 } | 221 } |
| 222 | 222 |
| 223 static void testInterfaceEmptyMethodMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 223 static void testInterfaceEmptyMethodMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
| 224 { | 224 { |
| 225 TestInterfaceNodeV8Internal::testInterfaceEmptyMethodMethod(info); | 225 TestInterfaceNodeV8Internal::testInterfaceEmptyMethodMethod(info); |
| 226 } | 226 } |
| 227 | 227 |
| 228 static void perWorldBindingsTestInterfaceEmptyMethodMethod(const v8::FunctionCal
lbackInfo<v8::Value>& info) | 228 static void perWorldBindingsTestInterfaceEmptyMethodMethod(const v8::FunctionCal
lbackInfo<v8::Value>& info) |
| 229 { | 229 { |
| 230 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder()); | 230 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder()); |
| 231 v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEm
ptyMethod()), impl); | 231 v8SetReturnValueFast(info, impl->perWorldBindingsTestInterfaceEmptyMethod(),
impl); |
| 232 } | 232 } |
| 233 | 233 |
| 234 static void perWorldBindingsTestInterfaceEmptyMethodMethodCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) | 234 static void perWorldBindingsTestInterfaceEmptyMethodMethodCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) |
| 235 { | 235 { |
| 236 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodMethod(
info); | 236 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodMethod(
info); |
| 237 } | 237 } |
| 238 | 238 |
| 239 static void perWorldBindingsTestInterfaceEmptyMethodMethodForMainWorld(const v8:
:FunctionCallbackInfo<v8::Value>& info) | 239 static void perWorldBindingsTestInterfaceEmptyMethodMethodForMainWorld(const v8:
:FunctionCallbackInfo<v8::Value>& info) |
| 240 { | 240 { |
| 241 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder()); | 241 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder()); |
| 242 v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBindingsTestInt
erfaceEmptyMethod())); | 242 v8SetReturnValueForMainWorld(info, impl->perWorldBindingsTestInterfaceEmptyM
ethod()); |
| 243 } | 243 } |
| 244 | 244 |
| 245 static void perWorldBindingsTestInterfaceEmptyMethodMethodCallbackForMainWorld(c
onst v8::FunctionCallbackInfo<v8::Value>& info) | 245 static void perWorldBindingsTestInterfaceEmptyMethodMethodCallbackForMainWorld(c
onst v8::FunctionCallbackInfo<v8::Value>& info) |
| 246 { | 246 { |
| 247 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodMethodF
orMainWorld(info); | 247 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodMethodF
orMainWorld(info); |
| 248 } | 248 } |
| 249 | 249 |
| 250 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethod(con
st v8::FunctionCallbackInfo<v8::Value>& info) | 250 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethod(con
st v8::FunctionCallbackInfo<v8::Value>& info) |
| 251 { | 251 { |
| 252 ExceptionState exceptionState(ExceptionState::ExecutionContext, "perWorldBin
dingsTestInterfaceEmptyMethodOptionalBooleanArg", "TestInterfaceNode", info.Hold
er(), info.GetIsolate()); | 252 ExceptionState exceptionState(ExceptionState::ExecutionContext, "perWorldBin
dingsTestInterfaceEmptyMethodOptionalBooleanArg", "TestInterfaceNode", info.Hold
er(), info.GetIsolate()); |
| 253 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder()); | 253 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder()); |
| 254 bool optionalBooleanArgument; | 254 bool optionalBooleanArgument; |
| 255 { | 255 { |
| 256 int numArgsPassed = info.Length(); | 256 int numArgsPassed = info.Length(); |
| 257 while (numArgsPassed > 0) { | 257 while (numArgsPassed > 0) { |
| 258 if (!info[numArgsPassed - 1]->IsUndefined()) | 258 if (!info[numArgsPassed - 1]->IsUndefined()) |
| 259 break; | 259 break; |
| 260 --numArgsPassed; | 260 --numArgsPassed; |
| 261 } | 261 } |
| 262 if (UNLIKELY(numArgsPassed <= 0)) { | 262 if (UNLIKELY(numArgsPassed <= 0)) { |
| 263 v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsTestInt
erfaceEmptyMethodOptionalBooleanArg()), impl); | 263 v8SetReturnValueFast(info, impl->perWorldBindingsTestInterfaceEmptyM
ethodOptionalBooleanArg(), impl); |
| 264 return; | 264 return; |
| 265 } | 265 } |
| 266 optionalBooleanArgument = toBoolean(info.GetIsolate(), info[0], exceptio
nState); | 266 optionalBooleanArgument = toBoolean(info.GetIsolate(), info[0], exceptio
nState); |
| 267 if (exceptionState.throwIfNeeded()) | 267 if (exceptionState.throwIfNeeded()) |
| 268 return; | 268 return; |
| 269 } | 269 } |
| 270 v8SetReturnValueFast(info, WTF::getPtr(impl->perWorldBindingsTestInterfaceEm
ptyMethodOptionalBooleanArg(optionalBooleanArgument)), impl); | 270 v8SetReturnValueFast(info, impl->perWorldBindingsTestInterfaceEmptyMethodOpt
ionalBooleanArg(optionalBooleanArgument), impl); |
| 271 } | 271 } |
| 272 | 272 |
| 273 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodCall
back(const v8::FunctionCallbackInfo<v8::Value>& info) | 273 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodCall
back(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 274 { | 274 { |
| 275 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodOptiona
lBooleanArgMethod(info); | 275 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodOptiona
lBooleanArgMethod(info); |
| 276 } | 276 } |
| 277 | 277 |
| 278 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodForM
ainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) | 278 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodForM
ainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 279 { | 279 { |
| 280 ExceptionState exceptionState(ExceptionState::ExecutionContext, "perWorldBin
dingsTestInterfaceEmptyMethodOptionalBooleanArg", "TestInterfaceNode", info.Hold
er(), info.GetIsolate()); | 280 ExceptionState exceptionState(ExceptionState::ExecutionContext, "perWorldBin
dingsTestInterfaceEmptyMethodOptionalBooleanArg", "TestInterfaceNode", info.Hold
er(), info.GetIsolate()); |
| 281 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder()); | 281 TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(info.Holder()); |
| 282 bool optionalBooleanArgument; | 282 bool optionalBooleanArgument; |
| 283 { | 283 { |
| 284 int numArgsPassed = info.Length(); | 284 int numArgsPassed = info.Length(); |
| 285 while (numArgsPassed > 0) { | 285 while (numArgsPassed > 0) { |
| 286 if (!info[numArgsPassed - 1]->IsUndefined()) | 286 if (!info[numArgsPassed - 1]->IsUndefined()) |
| 287 break; | 287 break; |
| 288 --numArgsPassed; | 288 --numArgsPassed; |
| 289 } | 289 } |
| 290 if (UNLIKELY(numArgsPassed <= 0)) { | 290 if (UNLIKELY(numArgsPassed <= 0)) { |
| 291 v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBinding
sTestInterfaceEmptyMethodOptionalBooleanArg())); | 291 v8SetReturnValueForMainWorld(info, impl->perWorldBindingsTestInterfa
ceEmptyMethodOptionalBooleanArg()); |
| 292 return; | 292 return; |
| 293 } | 293 } |
| 294 optionalBooleanArgument = toBoolean(info.GetIsolate(), info[0], exceptio
nState); | 294 optionalBooleanArgument = toBoolean(info.GetIsolate(), info[0], exceptio
nState); |
| 295 if (exceptionState.throwIfNeeded()) | 295 if (exceptionState.throwIfNeeded()) |
| 296 return; | 296 return; |
| 297 } | 297 } |
| 298 v8SetReturnValueForMainWorld(info, WTF::getPtr(impl->perWorldBindingsTestInt
erfaceEmptyMethodOptionalBooleanArg(optionalBooleanArgument))); | 298 v8SetReturnValueForMainWorld(info, impl->perWorldBindingsTestInterfaceEmptyM
ethodOptionalBooleanArg(optionalBooleanArgument)); |
| 299 } | 299 } |
| 300 | 300 |
| 301 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodCall
backForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) | 301 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodCall
backForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 302 { | 302 { |
| 303 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodOptiona
lBooleanArgMethodForMainWorld(info); | 303 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodOptiona
lBooleanArgMethodForMainWorld(info); |
| 304 } | 304 } |
| 305 | 305 |
| 306 } // namespace TestInterfaceNodeV8Internal | 306 } // namespace TestInterfaceNodeV8Internal |
| 307 | 307 |
| 308 const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceNodeAccessors[] =
{ | 308 const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceNodeAccessors[] =
{ |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 v8::Local<v8::Object> V8TestInterfaceNode::findInstanceInPrototypeChain(v8::Loca
l<v8::Value> v8Value, v8::Isolate* isolate) | 349 v8::Local<v8::Object> V8TestInterfaceNode::findInstanceInPrototypeChain(v8::Loca
l<v8::Value> v8Value, v8::Isolate* isolate) |
| 350 { | 350 { |
| 351 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 351 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
| 352 } | 352 } |
| 353 | 353 |
| 354 TestInterfaceNode* V8TestInterfaceNode::toImplWithTypeCheck(v8::Isolate* isolate
, v8::Local<v8::Value> value) | 354 TestInterfaceNode* V8TestInterfaceNode::toImplWithTypeCheck(v8::Isolate* isolate
, v8::Local<v8::Value> value) |
| 355 { | 355 { |
| 356 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : 0; | 356 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : 0; |
| 357 } | 357 } |
| 358 | 358 |
| 359 void V8TestInterfaceNode::refObject(ScriptWrappable* scriptWrappable) | |
| 360 { | |
| 361 } | |
| 362 | |
| 363 void V8TestInterfaceNode::derefObject(ScriptWrappable* scriptWrappable) | |
| 364 { | |
| 365 } | |
| 366 | |
| 367 } // namespace blink | 359 } // namespace blink |
| OLD | NEW |