| 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 "V8TestInterface.h" | 7 #include "V8TestInterface.h" |
| 8 | 8 |
| 9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
| 10 #include "bindings/core/v8/PrivateScriptRunner.h" | 10 #include "bindings/core/v8/PrivateScriptRunner.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "wtf/RefPtr.h" | 37 #include "wtf/RefPtr.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv
ial | 41 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv
ial |
| 42 // and does not depend on another global objects. | 42 // and does not depend on another global objects. |
| 43 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 43 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
| 44 #pragma clang diagnostic push | 44 #pragma clang diagnostic push |
| 45 #pragma clang diagnostic ignored "-Wglobal-constructors" | 45 #pragma clang diagnostic ignored "-Wglobal-constructors" |
| 46 #endif | 46 #endif |
| 47 WrapperTypeInfo V8TestInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8Test
Interface::domTemplate, V8TestInterface::refObject, V8TestInterface::derefObject
, V8TestInterface::trace, V8TestInterface::toActiveScriptWrappable, V8TestInterf
ace::visitDOMWrapper, V8TestInterface::preparePrototypeAndInterfaceObject, V8Tes
tInterface::installConditionallyEnabledProperties, "TestInterface", &V8TestInter
faceEmpty::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, Wrapper
TypeInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperType
Info::Dependent, WrapperTypeInfo::RefCountedObject }; | 47 WrapperTypeInfo V8TestInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8Test
Interface::domTemplate, V8TestInterface::trace, V8TestInterface::toActiveScriptW
rappable, V8TestInterface::visitDOMWrapper, V8TestInterface::preparePrototypeAnd
InterfaceObject, V8TestInterface::installConditionallyEnabledProperties, "TestIn
terface", &V8TestInterfaceEmpty::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeOb
jectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEv
entTarget, WrapperTypeInfo::Dependent }; |
| 48 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 48 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
| 49 #pragma clang diagnostic pop | 49 #pragma clang diagnostic pop |
| 50 #endif | 50 #endif |
| 51 | 51 |
| 52 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eImplementation.h. | 52 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac
eImplementation.h. |
| 53 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | 53 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
| 54 // bindings/core/v8/ScriptWrappable.h. | 54 // bindings/core/v8/ScriptWrappable.h. |
| 55 const WrapperTypeInfo& TestInterfaceImplementation::s_wrapperTypeInfo = V8TestIn
terface::wrapperTypeInfo; | 55 const WrapperTypeInfo& TestInterfaceImplementation::s_wrapperTypeInfo = V8TestIn
terface::wrapperTypeInfo; |
| 56 | 56 |
| 57 namespace TestInterfaceImplementationV8Internal { | 57 namespace TestInterfaceImplementationV8Internal { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 79 { | 79 { |
| 80 v8::Local<v8::Object> holder = info.Holder(); | 80 v8::Local<v8::Object> holder = info.Holder(); |
| 81 ExceptionState exceptionState(ExceptionState::SetterContext, "testInterfaceA
ttribute", "TestInterface", holder, info.GetIsolate()); | 81 ExceptionState exceptionState(ExceptionState::SetterContext, "testInterfaceA
ttribute", "TestInterface", holder, info.GetIsolate()); |
| 82 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); | 82 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
| 83 TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck
(info.GetIsolate(), v8Value); | 83 TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck
(info.GetIsolate(), v8Value); |
| 84 if (!cppValue) { | 84 if (!cppValue) { |
| 85 exceptionState.throwTypeError("The provided value is not of type 'TestIn
terface'."); | 85 exceptionState.throwTypeError("The provided value is not of type 'TestIn
terface'."); |
| 86 exceptionState.throwIfNeeded(); | 86 exceptionState.throwIfNeeded(); |
| 87 return; | 87 return; |
| 88 } | 88 } |
| 89 impl->setTestInterfaceAttribute(WTF::getPtr(cppValue)); | 89 impl->setTestInterfaceAttribute(cppValue); |
| 90 } | 90 } |
| 91 | 91 |
| 92 static void testInterfaceAttributeAttributeSetterCallback(const v8::FunctionCall
backInfo<v8::Value>& info) | 92 static void testInterfaceAttributeAttributeSetterCallback(const v8::FunctionCall
backInfo<v8::Value>& info) |
| 93 { | 93 { |
| 94 v8::Local<v8::Value> v8Value = info[0]; | 94 v8::Local<v8::Value> v8Value = info[0]; |
| 95 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte
xt(info.GetIsolate()), UseCounter::V8TestInterface_TestInterfaceAttribute_Attrib
uteSetter); | 95 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte
xt(info.GetIsolate()), UseCounter::V8TestInterface_TestInterfaceAttribute_Attrib
uteSetter); |
| 96 TestInterfaceImplementationV8Internal::testInterfaceAttributeAttributeSetter
(v8Value, info); | 96 TestInterfaceImplementationV8Internal::testInterfaceAttributeAttributeSetter
(v8Value, info); |
| 97 } | 97 } |
| 98 | 98 |
| 99 static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 99 static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 } | 343 } |
| 344 | 344 |
| 345 static void staticStringAttributeAttributeSetterCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 345 static void staticStringAttributeAttributeSetterCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
| 346 { | 346 { |
| 347 v8::Local<v8::Value> v8Value = info[0]; | 347 v8::Local<v8::Value> v8Value = info[0]; |
| 348 TestInterfaceImplementationV8Internal::staticStringAttributeAttributeSetter(
v8Value, info); | 348 TestInterfaceImplementationV8Internal::staticStringAttributeAttributeSetter(
v8Value, info); |
| 349 } | 349 } |
| 350 | 350 |
| 351 static void staticReturnDOMWrapperAttributeAttributeGetter(const v8::FunctionCal
lbackInfo<v8::Value>& info) | 351 static void staticReturnDOMWrapperAttributeAttributeGetter(const v8::FunctionCal
lbackInfo<v8::Value>& info) |
| 352 { | 352 { |
| 353 v8SetReturnValue(info, TestInterfaceImplementation::staticReturnDOMWrapperAt
tribute(), info.GetIsolate()->GetCurrentContext()->Global()); | 353 v8SetReturnValue(info, WTF::getPtr(TestInterfaceImplementation::staticReturn
DOMWrapperAttribute()), info.GetIsolate()->GetCurrentContext()->Global()); |
| 354 } | 354 } |
| 355 | 355 |
| 356 static void staticReturnDOMWrapperAttributeAttributeGetterCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) | 356 static void staticReturnDOMWrapperAttributeAttributeGetterCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) |
| 357 { | 357 { |
| 358 TestInterfaceImplementationV8Internal::staticReturnDOMWrapperAttributeAttrib
uteGetter(info); | 358 TestInterfaceImplementationV8Internal::staticReturnDOMWrapperAttributeAttrib
uteGetter(info); |
| 359 } | 359 } |
| 360 | 360 |
| 361 static void staticReturnDOMWrapperAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) | 361 static void staticReturnDOMWrapperAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
| 362 { | 362 { |
| 363 v8::Local<v8::Object> holder = info.Holder(); | 363 v8::Local<v8::Object> holder = info.Holder(); |
| 364 ExceptionState exceptionState(ExceptionState::SetterContext, "staticReturnDO
MWrapperAttribute", "TestInterface", holder, info.GetIsolate()); | 364 ExceptionState exceptionState(ExceptionState::SetterContext, "staticReturnDO
MWrapperAttribute", "TestInterface", holder, info.GetIsolate()); |
| 365 TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck
(info.GetIsolate(), v8Value); | 365 TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck
(info.GetIsolate(), v8Value); |
| 366 if (!cppValue) { | 366 if (!cppValue) { |
| 367 exceptionState.throwTypeError("The provided value is not of type 'TestIn
terface'."); | 367 exceptionState.throwTypeError("The provided value is not of type 'TestIn
terface'."); |
| 368 exceptionState.throwIfNeeded(); | 368 exceptionState.throwIfNeeded(); |
| 369 return; | 369 return; |
| 370 } | 370 } |
| 371 TestInterfaceImplementation::setStaticReturnDOMWrapperAttribute(WTF::getPtr(
cppValue)); | 371 TestInterfaceImplementation::setStaticReturnDOMWrapperAttribute(cppValue); |
| 372 } | 372 } |
| 373 | 373 |
| 374 static void staticReturnDOMWrapperAttributeAttributeSetterCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) | 374 static void staticReturnDOMWrapperAttributeAttributeSetterCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) |
| 375 { | 375 { |
| 376 v8::Local<v8::Value> v8Value = info[0]; | 376 v8::Local<v8::Value> v8Value = info[0]; |
| 377 TestInterfaceImplementationV8Internal::staticReturnDOMWrapperAttributeAttrib
uteSetter(v8Value, info); | 377 TestInterfaceImplementationV8Internal::staticReturnDOMWrapperAttributeAttrib
uteSetter(v8Value, info); |
| 378 } | 378 } |
| 379 | 379 |
| 380 static void staticReadOnlyStringAttributeAttributeGetter(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 380 static void staticReadOnlyStringAttributeAttributeGetter(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
| 381 { | 381 { |
| 382 v8SetReturnValueString(info, TestInterfaceImplementation::staticReadOnlyStri
ngAttribute(), info.GetIsolate()); | 382 v8SetReturnValueString(info, TestInterfaceImplementation::staticReadOnlyStri
ngAttribute(), info.GetIsolate()); |
| 383 } | 383 } |
| 384 | 384 |
| 385 static void staticReadOnlyStringAttributeAttributeGetterCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) | 385 static void staticReadOnlyStringAttributeAttributeGetterCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
| 386 { | 386 { |
| 387 TestInterfaceImplementationV8Internal::staticReadOnlyStringAttributeAttribut
eGetter(info); | 387 TestInterfaceImplementationV8Internal::staticReadOnlyStringAttributeAttribut
eGetter(info); |
| 388 } | 388 } |
| 389 | 389 |
| 390 static void staticReadOnlyReturnDOMWrapperAttributeAttributeGetter(const v8::Fun
ctionCallbackInfo<v8::Value>& info) | 390 static void staticReadOnlyReturnDOMWrapperAttributeAttributeGetter(const v8::Fun
ctionCallbackInfo<v8::Value>& info) |
| 391 { | 391 { |
| 392 RefPtr<TestInterfaceImplementation> cppValue(TestInterfaceImplementation::st
aticReadOnlyReturnDOMWrapperAttribute()); | 392 TestInterfaceImplementation* cppValue(WTF::getPtr(TestInterfaceImplementatio
n::staticReadOnlyReturnDOMWrapperAttribute())); |
| 393 if (cppValue && DOMDataStore::setReturnValue(info.GetReturnValue(), cppValue
.get())) | 393 if (cppValue && DOMDataStore::setReturnValue(info.GetReturnValue(), cppValue
)) |
| 394 return; | 394 return; |
| 395 v8::Local<v8::Value> v8Value(toV8(cppValue.get(), holder, info.GetIsolate())
); | 395 v8::Local<v8::Value> v8Value(toV8(cppValue, holder, info.GetIsolate())); |
| 396 if (!v8Value.IsEmpty()) { | 396 if (!v8Value.IsEmpty()) { |
| 397 V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), h
older, v8AtomicString(info.GetIsolate(), "staticReadOnlyReturnDOMWrapperAttribut
e"), v8Value); | 397 V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), h
older, v8AtomicString(info.GetIsolate(), "staticReadOnlyReturnDOMWrapperAttribut
e"), v8Value); |
| 398 v8SetReturnValue(info, v8Value); | 398 v8SetReturnValue(info, v8Value); |
| 399 } | 399 } |
| 400 } | 400 } |
| 401 | 401 |
| 402 static void staticReadOnlyReturnDOMWrapperAttributeAttributeGetterCallback(const
v8::FunctionCallbackInfo<v8::Value>& info) | 402 static void staticReadOnlyReturnDOMWrapperAttributeAttributeGetterCallback(const
v8::FunctionCallbackInfo<v8::Value>& info) |
| 403 { | 403 { |
| 404 TestInterfaceImplementationV8Internal::staticReadOnlyReturnDOMWrapperAttribu
teAttributeGetter(info); | 404 TestInterfaceImplementationV8Internal::staticReadOnlyReturnDOMWrapperAttribu
teAttributeGetter(info); |
| 405 } | 405 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 424 static void legacyInterfaceTypeCheckingAttributeAttributeGetterCallback(const v8
::FunctionCallbackInfo<v8::Value>& info) | 424 static void legacyInterfaceTypeCheckingAttributeAttributeGetterCallback(const v8
::FunctionCallbackInfo<v8::Value>& info) |
| 425 { | 425 { |
| 426 TestInterfaceImplementationV8Internal::legacyInterfaceTypeCheckingAttributeA
ttributeGetter(info); | 426 TestInterfaceImplementationV8Internal::legacyInterfaceTypeCheckingAttributeA
ttributeGetter(info); |
| 427 } | 427 } |
| 428 | 428 |
| 429 static void legacyInterfaceTypeCheckingAttributeAttributeSetter(v8::Local<v8::Va
lue> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) | 429 static void legacyInterfaceTypeCheckingAttributeAttributeSetter(v8::Local<v8::Va
lue> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
| 430 { | 430 { |
| 431 v8::Local<v8::Object> holder = info.Holder(); | 431 v8::Local<v8::Object> holder = info.Holder(); |
| 432 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); | 432 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
| 433 TestInterfaceEmpty* cppValue = V8TestInterfaceEmpty::toImplWithTypeCheck(inf
o.GetIsolate(), v8Value); | 433 TestInterfaceEmpty* cppValue = V8TestInterfaceEmpty::toImplWithTypeCheck(inf
o.GetIsolate(), v8Value); |
| 434 impl->setLegacyInterfaceTypeCheckingAttribute(WTF::getPtr(cppValue)); | 434 impl->setLegacyInterfaceTypeCheckingAttribute(cppValue); |
| 435 } | 435 } |
| 436 | 436 |
| 437 static void legacyInterfaceTypeCheckingAttributeAttributeSetterCallback(const v8
::FunctionCallbackInfo<v8::Value>& info) | 437 static void legacyInterfaceTypeCheckingAttributeAttributeSetterCallback(const v8
::FunctionCallbackInfo<v8::Value>& info) |
| 438 { | 438 { |
| 439 v8::Local<v8::Value> v8Value = info[0]; | 439 v8::Local<v8::Value> v8Value = info[0]; |
| 440 TestInterfaceImplementationV8Internal::legacyInterfaceTypeCheckingAttributeA
ttributeSetter(v8Value, info); | 440 TestInterfaceImplementationV8Internal::legacyInterfaceTypeCheckingAttributeA
ttributeSetter(v8Value, info); |
| 441 } | 441 } |
| 442 | 442 |
| 443 static void alwaysExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) | 443 static void alwaysExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) |
| 444 { | 444 { |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 { | 647 { |
| 648 v8::Local<v8::Object> holder = info.Holder(); | 648 v8::Local<v8::Object> holder = info.Holder(); |
| 649 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsNode
Attribute", "TestInterface", holder, info.GetIsolate()); | 649 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsNode
Attribute", "TestInterface", holder, info.GetIsolate()); |
| 650 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); | 650 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
| 651 Node* cppValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value); | 651 Node* cppValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value); |
| 652 if (!cppValue) { | 652 if (!cppValue) { |
| 653 exceptionState.throwTypeError("The provided value is not of type 'Node'.
"); | 653 exceptionState.throwTypeError("The provided value is not of type 'Node'.
"); |
| 654 exceptionState.throwIfNeeded(); | 654 exceptionState.throwIfNeeded(); |
| 655 return; | 655 return; |
| 656 } | 656 } |
| 657 impl->setImplementsNodeAttribute(WTF::getPtr(cppValue)); | 657 impl->setImplementsNodeAttribute(cppValue); |
| 658 } | 658 } |
| 659 | 659 |
| 660 static void implementsNodeAttributeAttributeSetterCallback(const v8::FunctionCal
lbackInfo<v8::Value>& info) | 660 static void implementsNodeAttributeAttributeSetterCallback(const v8::FunctionCal
lbackInfo<v8::Value>& info) |
| 661 { | 661 { |
| 662 v8::Local<v8::Value> v8Value = info[0]; | 662 v8::Local<v8::Value> v8Value = info[0]; |
| 663 TestInterfaceImplementationV8Internal::implementsNodeAttributeAttributeSette
r(v8Value, info); | 663 TestInterfaceImplementationV8Internal::implementsNodeAttributeAttributeSette
r(v8Value, info); |
| 664 } | 664 } |
| 665 | 665 |
| 666 static void implementsEventHandlerAttributeAttributeGetter(const v8::FunctionCal
lbackInfo<v8::Value>& info) | 666 static void implementsEventHandlerAttributeAttributeGetter(const v8::FunctionCal
lbackInfo<v8::Value>& info) |
| 667 { | 667 { |
| 668 v8::Local<v8::Object> holder = info.Holder(); | 668 v8::Local<v8::Object> holder = info.Holder(); |
| 669 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); | 669 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
| 670 EventListener* cppValue(impl->implementsEventHandlerAttribute()); | 670 EventListener* cppValue(WTF::getPtr(impl->implementsEventHandlerAttribute())
); |
| 671 v8SetReturnValue(info, cppValue ? v8::Local<v8::Value>(V8AbstractEventListen
er::cast(cppValue)->getListenerObject(impl->getExecutionContext())) : v8::Local<
v8::Value>(v8::Null(info.GetIsolate()))); | 671 v8SetReturnValue(info, cppValue ? v8::Local<v8::Value>(V8AbstractEventListen
er::cast(cppValue)->getListenerObject(impl->getExecutionContext())) : v8::Local<
v8::Value>(v8::Null(info.GetIsolate()))); |
| 672 } | 672 } |
| 673 | 673 |
| 674 static void implementsEventHandlerAttributeAttributeGetterCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) | 674 static void implementsEventHandlerAttributeAttributeGetterCallback(const v8::Fun
ctionCallbackInfo<v8::Value>& info) |
| 675 { | 675 { |
| 676 TestInterfaceImplementationV8Internal::implementsEventHandlerAttributeAttrib
uteGetter(info); | 676 TestInterfaceImplementationV8Internal::implementsEventHandlerAttributeAttrib
uteGetter(info); |
| 677 } | 677 } |
| 678 | 678 |
| 679 static void implementsEventHandlerAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) | 679 static void implementsEventHandlerAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
| 680 { | 680 { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 706 { | 706 { |
| 707 v8::Local<v8::Object> holder = info.Holder(); | 707 v8::Local<v8::Object> holder = info.Holder(); |
| 708 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsRunt
imeEnabledNodeAttribute", "TestInterface", holder, info.GetIsolate()); | 708 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsRunt
imeEnabledNodeAttribute", "TestInterface", holder, info.GetIsolate()); |
| 709 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); | 709 TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
| 710 Node* cppValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value); | 710 Node* cppValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value); |
| 711 if (!cppValue) { | 711 if (!cppValue) { |
| 712 exceptionState.throwTypeError("The provided value is not of type 'Node'.
"); | 712 exceptionState.throwTypeError("The provided value is not of type 'Node'.
"); |
| 713 exceptionState.throwIfNeeded(); | 713 exceptionState.throwIfNeeded(); |
| 714 return; | 714 return; |
| 715 } | 715 } |
| 716 impl->setImplementsRuntimeEnabledNodeAttribute(WTF::getPtr(cppValue)); | 716 impl->setImplementsRuntimeEnabledNodeAttribute(cppValue); |
| 717 } | 717 } |
| 718 | 718 |
| 719 static void implementsRuntimeEnabledNodeAttributeAttributeSetterCallback(const v
8::FunctionCallbackInfo<v8::Value>& info) | 719 static void implementsRuntimeEnabledNodeAttributeAttributeSetterCallback(const v
8::FunctionCallbackInfo<v8::Value>& info) |
| 720 { | 720 { |
| 721 v8::Local<v8::Value> v8Value = info[0]; | 721 v8::Local<v8::Value> v8Value = info[0]; |
| 722 TestInterfaceImplementationV8Internal::implementsRuntimeEnabledNodeAttribute
AttributeSetter(v8Value, info); | 722 TestInterfaceImplementationV8Internal::implementsRuntimeEnabledNodeAttribute
AttributeSetter(v8Value, info); |
| 723 } | 723 } |
| 724 | 724 |
| 725 static void implements2StaticStringAttributeAttributeGetter(const v8::FunctionCa
llbackInfo<v8::Value>& info) | 725 static void implements2StaticStringAttributeAttributeGetter(const v8::FunctionCa
llbackInfo<v8::Value>& info) |
| 726 { | 726 { |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1451 if (!strArg.prepare()) | 1451 if (!strArg.prepare()) |
| 1452 return; | 1452 return; |
| 1453 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G
etIsolate(), info[1]); | 1453 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G
etIsolate(), info[1]); |
| 1454 if (!testInterfaceEmptyArg) { | 1454 if (!testInterfaceEmptyArg) { |
| 1455 exceptionState.throwTypeError("parameter 2 is not of type 'TestInter
faceEmpty'."); | 1455 exceptionState.throwTypeError("parameter 2 is not of type 'TestInter
faceEmpty'."); |
| 1456 exceptionState.throwIfNeeded(); | 1456 exceptionState.throwIfNeeded(); |
| 1457 return; | 1457 return; |
| 1458 } | 1458 } |
| 1459 } | 1459 } |
| 1460 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | 1460 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); |
| 1461 RefPtr<TestInterfaceEmpty> result = impl->implementsComplexMethod(executionC
ontext, strArg, testInterfaceEmptyArg, exceptionState); | 1461 TestInterfaceEmpty* result = impl->implementsComplexMethod(executionContext,
strArg, testInterfaceEmptyArg, exceptionState); |
| 1462 if (exceptionState.hadException()) { | 1462 if (exceptionState.hadException()) { |
| 1463 exceptionState.throwIfNeeded(); | 1463 exceptionState.throwIfNeeded(); |
| 1464 return; | 1464 return; |
| 1465 } | 1465 } |
| 1466 v8SetReturnValue(info, result.release()); | 1466 v8SetReturnValue(info, result); |
| 1467 } | 1467 } |
| 1468 | 1468 |
| 1469 static void implementsComplexMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 1469 static void implementsComplexMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
| 1470 { | 1470 { |
| 1471 TestInterfaceImplementationV8Internal::implementsComplexMethodMethod(info); | 1471 TestInterfaceImplementationV8Internal::implementsComplexMethodMethod(info); |
| 1472 } | 1472 } |
| 1473 | 1473 |
| 1474 static void implementsCustomVoidMethodMethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 1474 static void implementsCustomVoidMethodMethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
| 1475 { | 1475 { |
| 1476 V8TestInterface::implementsCustomVoidMethodMethodCustom(info); | 1476 V8TestInterface::implementsCustomVoidMethodMethodCustom(info); |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1810 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 1810 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 1811 { | 1811 { |
| 1812 TestInterfaceImplementationV8Internal::toStringMethod(info); | 1812 TestInterfaceImplementationV8Internal::toStringMethod(info); |
| 1813 } | 1813 } |
| 1814 | 1814 |
| 1815 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 1815 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 1816 { | 1816 { |
| 1817 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator",
"TestInterface", info.Holder(), info.GetIsolate()); | 1817 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator",
"TestInterface", info.Holder(), info.GetIsolate()); |
| 1818 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1818 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| 1819 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); | 1819 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); |
| 1820 RawPtr<Iterator> result = impl->iterator(scriptState, exceptionState); | 1820 Iterator* result = impl->iterator(scriptState, exceptionState); |
| 1821 if (exceptionState.hadException()) { | 1821 if (exceptionState.hadException()) { |
| 1822 exceptionState.throwIfNeeded(); | 1822 exceptionState.throwIfNeeded(); |
| 1823 return; | 1823 return; |
| 1824 } | 1824 } |
| 1825 v8SetReturnValue(info, result.release()); | 1825 v8SetReturnValue(info, result); |
| 1826 } | 1826 } |
| 1827 | 1827 |
| 1828 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 1828 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 1829 { | 1829 { |
| 1830 TestInterfaceImplementationV8Internal::iteratorMethod(info); | 1830 TestInterfaceImplementationV8Internal::iteratorMethod(info); |
| 1831 } | 1831 } |
| 1832 | 1832 |
| 1833 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | 1833 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) |
| 1834 { | 1834 { |
| 1835 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); | 1835 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2237 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExpo
sedMethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", TestInter
faceImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback,
0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::On
Prototype}; | 2237 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExpo
sedMethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", TestInter
faceImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback,
0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::On
Prototype}; |
| 2238 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prot
otypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMethodMeth
odConfiguration); | 2238 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prot
otypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMethodMeth
odConfiguration); |
| 2239 } | 2239 } |
| 2240 } | 2240 } |
| 2241 | 2241 |
| 2242 ActiveScriptWrappable* V8TestInterface::toActiveScriptWrappable(v8::Local<v8::Ob
ject> wrapper) | 2242 ActiveScriptWrappable* V8TestInterface::toActiveScriptWrappable(v8::Local<v8::Ob
ject> wrapper) |
| 2243 { | 2243 { |
| 2244 return toImpl(wrapper); | 2244 return toImpl(wrapper); |
| 2245 } | 2245 } |
| 2246 | 2246 |
| 2247 void V8TestInterface::refObject(ScriptWrappable* scriptWrappable) | |
| 2248 { | |
| 2249 scriptWrappable->toImpl<TestInterfaceImplementation>()->ref(); | |
| 2250 } | |
| 2251 | |
| 2252 void V8TestInterface::derefObject(ScriptWrappable* scriptWrappable) | |
| 2253 { | |
| 2254 scriptWrappable->toImpl<TestInterfaceImplementation>()->deref(); | |
| 2255 } | |
| 2256 | |
| 2257 bool V8TestInterface::PrivateScript::shortMethodWithShortArgumentImplementedInPr
ivateScriptMethod(LocalFrame* frame, TestInterface* holderImpl, int value, int*
result) | 2247 bool V8TestInterface::PrivateScript::shortMethodWithShortArgumentImplementedInPr
ivateScriptMethod(LocalFrame* frame, TestInterface* holderImpl, int value, int*
result) |
| 2258 { | 2248 { |
| 2259 if (!frame) | 2249 if (!frame) |
| 2260 return false; | 2250 return false; |
| 2261 v8::HandleScope handleScope(toIsolate(frame)); | 2251 v8::HandleScope handleScope(toIsolate(frame)); |
| 2262 ScriptForbiddenScope::AllowUserAgentScript script; | 2252 ScriptForbiddenScope::AllowUserAgentScript script; |
| 2263 ScriptState* scriptState = ScriptState::forWorld(frame, DOMWrapperWorld::pri
vateScriptIsolatedWorld()); | 2253 ScriptState* scriptState = ScriptState::forWorld(frame, DOMWrapperWorld::pri
vateScriptIsolatedWorld()); |
| 2264 if (!scriptState) | 2254 if (!scriptState) |
| 2265 return false; | 2255 return false; |
| 2266 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 2256 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2372 { | 2362 { |
| 2373 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt
erface = method; | 2363 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt
erface = method; |
| 2374 } | 2364 } |
| 2375 | 2365 |
| 2376 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface(
void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) | 2366 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface(
void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) |
| 2377 { | 2367 { |
| 2378 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart
ialInterface = method; | 2368 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart
ialInterface = method; |
| 2379 } | 2369 } |
| 2380 | 2370 |
| 2381 } // namespace blink | 2371 } // namespace blink |
| OLD | NEW |