| 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. | 5 // This file has been auto-generated by code_generator_v8.py. |
| 6 // DO NOT MODIFY! | 6 // DO NOT MODIFY! |
| 7 | 7 |
| 8 // This file has been generated from the Jinja2 template in | 8 // This file has been generated from the Jinja2 template in |
| 9 // third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl | 9 // third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl |
| 10 | 10 |
| 11 // clang-format off | 11 // clang-format off |
| 12 #include "V8TestInterface5.h" | 12 #include "V8TestInterface5.h" |
| 13 | 13 |
| 14 #include "bindings/core/v8/ExceptionState.h" | 14 #include "bindings/core/v8/ExceptionState.h" |
| 15 #include "bindings/core/v8/GeneratedCodeHelper.h" | 15 #include "bindings/core/v8/GeneratedCodeHelper.h" |
| 16 #include "bindings/core/v8/ScriptState.h" | |
| 17 #include "bindings/core/v8/ScriptValue.h" | |
| 18 #include "bindings/core/v8/V8DOMConfiguration.h" | 16 #include "bindings/core/v8/V8DOMConfiguration.h" |
| 19 #include "bindings/core/v8/V8Iterator.h" | |
| 20 #include "bindings/core/v8/V8ObjectConstructor.h" | 17 #include "bindings/core/v8/V8ObjectConstructor.h" |
| 21 #include "bindings/core/v8/V8TestInterfaceEmpty.h" | 18 #include "bindings/core/v8/V8TestInterfaceEmpty.h" |
| 22 #include "bindings/modules/v8/BooleanOrString.h" | 19 #include "bindings/modules/v8/BooleanOrString.h" |
| 23 #include "bindings/modules/v8/DoubleOrString.h" | 20 #include "bindings/modules/v8/DoubleOrString.h" |
| 24 #include "bindings/modules/v8/V8TestInterface5.h" | 21 #include "bindings/modules/v8/V8TestInterface5.h" |
| 25 #include "bindings/modules/v8/VoidCallbackFunctionModules.h" | 22 #include "bindings/modules/v8/VoidCallbackFunctionModules.h" |
| 26 #include "core/dom/Document.h" | 23 #include "core/dom/Document.h" |
| 27 #include "platform/RuntimeEnabledFeatures.h" | 24 #include "platform/RuntimeEnabledFeatures.h" |
| 28 #include "wtf/GetPtr.h" | 25 #include "wtf/GetPtr.h" |
| 29 #include "wtf/RefPtr.h" | 26 #include "wtf/RefPtr.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 178 |
| 182 static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
onst v8::FunctionCallbackInfo<v8::Value>& info) { | 179 static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
onst v8::FunctionCallbackInfo<v8::Value>& info) { |
| 183 // Prepare the value to be set. | 180 // Prepare the value to be set. |
| 184 V8StringResource<> cppValue = v8Value; | 181 V8StringResource<> cppValue = v8Value; |
| 185 if (!cppValue.prepare()) | 182 if (!cppValue.prepare()) |
| 186 return; | 183 return; |
| 187 | 184 |
| 188 TestInterface5Implementation::setStaticStringAttribute(cppValue); | 185 TestInterface5Implementation::setStaticStringAttribute(cppValue); |
| 189 } | 186 } |
| 190 | 187 |
| 188 static void lengthAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& inf
o) { |
| 189 v8::Local<v8::Object> holder = info.Holder(); |
| 190 |
| 191 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 192 |
| 193 v8SetReturnValueUnsigned(info, impl->length()); |
| 194 } |
| 195 |
| 191 static void alwaysExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) { | 196 static void alwaysExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo
<v8::Value>& info) { |
| 192 v8::Local<v8::Object> holder = info.Holder(); | 197 v8::Local<v8::Object> holder = info.Holder(); |
| 193 | 198 |
| 194 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); | 199 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); |
| 195 | 200 |
| 196 v8SetReturnValueInt(info, impl->alwaysExposedAttribute()); | 201 v8SetReturnValueInt(info, impl->alwaysExposedAttribute()); |
| 197 } | 202 } |
| 198 | 203 |
| 199 static void alwaysExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) { | 204 static void alwaysExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 200 v8::Local<v8::Object> holder = info.Holder(); | 205 v8::Local<v8::Object> holder = info.Holder(); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 if (!(info[0]->IsObject() && v8::Local<v8::Object>::Cast(info[0])->IsCallable(
))) { | 439 if (!(info[0]->IsObject() && v8::Local<v8::Object>::Cast(info[0])->IsCallable(
))) { |
| 435 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodVoidCallbackFunctionModulesArg", "TestInterface5", "The ca
llback provided as parameter 1 is not a function.")); | 440 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile
dToExecute("voidMethodVoidCallbackFunctionModulesArg", "TestInterface5", "The ca
llback provided as parameter 1 is not a function.")); |
| 436 | 441 |
| 437 return; | 442 return; |
| 438 } | 443 } |
| 439 arg = VoidCallbackFunctionModules::create(ScriptState::current(info.GetIsolate
()), info[0]); | 444 arg = VoidCallbackFunctionModules::create(ScriptState::current(info.GetIsolate
()), info[0]); |
| 440 | 445 |
| 441 impl->voidMethodVoidCallbackFunctionModulesArg(arg); | 446 impl->voidMethodVoidCallbackFunctionModulesArg(arg); |
| 442 } | 447 } |
| 443 | 448 |
| 444 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { | |
| 445 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "keys"); | |
| 446 | |
| 447 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | |
| 448 | |
| 449 ScriptState* scriptState = ScriptState::forReceiverObject(info); | |
| 450 | |
| 451 Iterator* result = impl->keysForBinding(scriptState, exceptionState); | |
| 452 if (exceptionState.hadException()) { | |
| 453 return; | |
| 454 } | |
| 455 v8SetReturnValue(info, result); | |
| 456 } | |
| 457 | |
| 458 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { | |
| 459 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "values"); | |
| 460 | |
| 461 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | |
| 462 | |
| 463 ScriptState* scriptState = ScriptState::forReceiverObject(info); | |
| 464 | |
| 465 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); | |
| 466 if (exceptionState.hadException()) { | |
| 467 return; | |
| 468 } | |
| 469 v8SetReturnValue(info, result); | |
| 470 } | |
| 471 | |
| 472 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { | |
| 473 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "entries"); | |
| 474 | |
| 475 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | |
| 476 | |
| 477 ScriptState* scriptState = ScriptState::forReceiverObject(info); | |
| 478 | |
| 479 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); | |
| 480 if (exceptionState.hadException()) { | |
| 481 return; | |
| 482 } | |
| 483 v8SetReturnValue(info, result); | |
| 484 } | |
| 485 | |
| 486 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { | |
| 487 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "forEach"); | |
| 488 | |
| 489 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | |
| 490 | |
| 491 ScriptState* scriptState = ScriptState::forReceiverObject(info); | |
| 492 | |
| 493 if (UNLIKELY(info.Length() < 1)) { | |
| 494 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.
Length())); | |
| 495 return; | |
| 496 } | |
| 497 | |
| 498 ScriptValue callback; | |
| 499 ScriptValue thisArg; | |
| 500 if (!(info[0]->IsObject() && v8::Local<v8::Object>::Cast(info[0])->IsCallable(
))) { | |
| 501 exceptionState.throwTypeError("The callback provided as parameter 1 is not a
function."); | |
| 502 | |
| 503 return; | |
| 504 } | |
| 505 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]); | |
| 506 | |
| 507 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]); | |
| 508 | |
| 509 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder()),
callback, thisArg, exceptionState); | |
| 510 if (exceptionState.hadException()) { | |
| 511 return; | |
| 512 } | |
| 513 } | |
| 514 | |
| 515 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { | 449 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 516 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 450 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 517 | 451 |
| 518 v8SetReturnValueString(info, impl->toString(), info.GetIsolate()); | 452 v8SetReturnValueString(info, impl->toString(), info.GetIsolate()); |
| 519 } | 453 } |
| 520 | 454 |
| 521 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { | |
| 522 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont
ext, "TestInterface5", "iterator"); | |
| 523 | |
| 524 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | |
| 525 | |
| 526 ScriptState* scriptState = ScriptState::forReceiverObject(info); | |
| 527 | |
| 528 Iterator* result = impl->iterator(scriptState, exceptionState); | |
| 529 if (exceptionState.hadException()) { | |
| 530 return; | |
| 531 } | |
| 532 v8SetReturnValue(info, result); | |
| 533 } | |
| 534 | |
| 535 static void namedPropertyGetter(const AtomicString& name, const v8::PropertyCall
backInfo<v8::Value>& info) { | 455 static void namedPropertyGetter(const AtomicString& name, const v8::PropertyCall
backInfo<v8::Value>& info) { |
| 536 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 456 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| 537 String result = impl->anonymousNamedGetter(name); | 457 String result = impl->anonymousNamedGetter(name); |
| 538 if (result.isNull()) | 458 if (result.isNull()) |
| 539 return; | 459 return; |
| 540 v8SetReturnValueString(info, result, info.GetIsolate()); | 460 v8SetReturnValueString(info, result, info.GetIsolate()); |
| 541 } | 461 } |
| 542 | 462 |
| 543 static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { | 463 static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 544 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); | 464 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 void V8TestInterface5::staticStringAttributeAttributeGetterCallback(const v8::Fu
nctionCallbackInfo<v8::Value>& info) { | 595 void V8TestInterface5::staticStringAttributeAttributeGetterCallback(const v8::Fu
nctionCallbackInfo<v8::Value>& info) { |
| 676 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeGetter(i
nfo); | 596 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeGetter(i
nfo); |
| 677 } | 597 } |
| 678 | 598 |
| 679 void V8TestInterface5::staticStringAttributeAttributeSetterCallback(const v8::Fu
nctionCallbackInfo<v8::Value>& info) { | 599 void V8TestInterface5::staticStringAttributeAttributeSetterCallback(const v8::Fu
nctionCallbackInfo<v8::Value>& info) { |
| 680 v8::Local<v8::Value> v8Value = info[0]; | 600 v8::Local<v8::Value> v8Value = info[0]; |
| 681 | 601 |
| 682 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeSetter(v
8Value, info); | 602 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeSetter(v
8Value, info); |
| 683 } | 603 } |
| 684 | 604 |
| 605 void V8TestInterface5::lengthAttributeGetterCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) { |
| 606 TestInterface5ImplementationV8Internal::lengthAttributeGetter(info); |
| 607 } |
| 608 |
| 685 void V8TestInterface5::alwaysExposedAttributeAttributeGetterCallback(const v8::F
unctionCallbackInfo<v8::Value>& info) { | 609 void V8TestInterface5::alwaysExposedAttributeAttributeGetterCallback(const v8::F
unctionCallbackInfo<v8::Value>& info) { |
| 686 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeGetter(
info); | 610 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeGetter(
info); |
| 687 } | 611 } |
| 688 | 612 |
| 689 void V8TestInterface5::alwaysExposedAttributeAttributeSetterCallback(const v8::F
unctionCallbackInfo<v8::Value>& info) { | 613 void V8TestInterface5::alwaysExposedAttributeAttributeSetterCallback(const v8::F
unctionCallbackInfo<v8::Value>& info) { |
| 690 v8::Local<v8::Value> v8Value = info[0]; | 614 v8::Local<v8::Value> v8Value = info[0]; |
| 691 | 615 |
| 692 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeSetter(
v8Value, info); | 616 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeSetter(
v8Value, info); |
| 693 } | 617 } |
| 694 | 618 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 } | 693 } |
| 770 | 694 |
| 771 void V8TestInterface5::voidMethodVoidExperimentalCallbackFunctionMethodCallback(
const v8::FunctionCallbackInfo<v8::Value>& info) { | 695 void V8TestInterface5::voidMethodVoidExperimentalCallbackFunctionMethodCallback(
const v8::FunctionCallbackInfo<v8::Value>& info) { |
| 772 TestInterface5ImplementationV8Internal::voidMethodVoidExperimentalCallbackFunc
tionMethod(info); | 696 TestInterface5ImplementationV8Internal::voidMethodVoidExperimentalCallbackFunc
tionMethod(info); |
| 773 } | 697 } |
| 774 | 698 |
| 775 void V8TestInterface5::voidMethodVoidCallbackFunctionModulesArgMethodCallback(co
nst v8::FunctionCallbackInfo<v8::Value>& info) { | 699 void V8TestInterface5::voidMethodVoidCallbackFunctionModulesArgMethodCallback(co
nst v8::FunctionCallbackInfo<v8::Value>& info) { |
| 776 TestInterface5ImplementationV8Internal::voidMethodVoidCallbackFunctionModulesA
rgMethod(info); | 700 TestInterface5ImplementationV8Internal::voidMethodVoidCallbackFunctionModulesA
rgMethod(info); |
| 777 } | 701 } |
| 778 | 702 |
| 779 void V8TestInterface5::keysMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) { | |
| 780 TestInterface5ImplementationV8Internal::keysMethod(info); | |
| 781 } | |
| 782 | |
| 783 void V8TestInterface5::valuesMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) { | |
| 784 TestInterface5ImplementationV8Internal::valuesMethod(info); | |
| 785 } | |
| 786 | |
| 787 void V8TestInterface5::entriesMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) { | |
| 788 TestInterface5ImplementationV8Internal::entriesMethod(info); | |
| 789 } | |
| 790 | |
| 791 void V8TestInterface5::forEachMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) { | |
| 792 TestInterface5ImplementationV8Internal::forEachMethod(info); | |
| 793 } | |
| 794 | |
| 795 void V8TestInterface5::toStringMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) { | 703 void V8TestInterface5::toStringMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) { |
| 796 TestInterface5ImplementationV8Internal::toStringMethod(info); | 704 TestInterface5ImplementationV8Internal::toStringMethod(info); |
| 797 } | 705 } |
| 798 | 706 |
| 799 void V8TestInterface5::iteratorMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) { | |
| 800 TestInterface5ImplementationV8Internal::iteratorMethod(info); | |
| 801 } | |
| 802 | |
| 803 void V8TestInterface5::namedPropertyGetterCallback(v8::Local<v8::Name> name, con
st v8::PropertyCallbackInfo<v8::Value>& info) { | 707 void V8TestInterface5::namedPropertyGetterCallback(v8::Local<v8::Name> name, con
st v8::PropertyCallbackInfo<v8::Value>& info) { |
| 804 if (!name->IsString()) | 708 if (!name->IsString()) |
| 805 return; | 709 return; |
| 806 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); | 710 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); |
| 807 | 711 |
| 808 TestInterface5ImplementationV8Internal::namedPropertyGetter(propertyName, info
); | 712 TestInterface5ImplementationV8Internal::namedPropertyGetter(propertyName, info
); |
| 809 } | 713 } |
| 810 | 714 |
| 811 void V8TestInterface5::namedPropertySetterCallback(v8::Local<v8::Name> name, v8:
:Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { | 715 void V8TestInterface5::namedPropertySetterCallback(v8::Local<v8::Name> name, v8:
:Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 812 if (!name->IsString()) | 716 if (!name->IsString()) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 #pragma clang diagnostic pop | 765 #pragma clang diagnostic pop |
| 862 #endif | 766 #endif |
| 863 | 767 |
| 864 const V8DOMConfiguration::AccessorConfiguration V8TestInterface5Accessors[] = { | 768 const V8DOMConfiguration::AccessorConfiguration V8TestInterface5Accessors[] = { |
| 865 {"testInterfaceAttribute", V8TestInterface5::testInterfaceAttributeAttribute
GetterCallback, V8TestInterface5::testInterfaceAttributeAttributeSetterCallback,
nullptr, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None
), V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, | 769 {"testInterfaceAttribute", V8TestInterface5::testInterfaceAttributeAttribute
GetterCallback, V8TestInterface5::testInterfaceAttributeAttributeSetterCallback,
nullptr, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None
), V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, |
| 866 {"doubleAttribute", V8TestInterface5::doubleAttributeAttributeGetterCallback
, V8TestInterface5::doubleAttributeAttributeSetterCallback, nullptr, nullptr, nu
llptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration
::OnPrototype, V8DOMConfiguration::CheckHolder}, | 770 {"doubleAttribute", V8TestInterface5::doubleAttributeAttributeGetterCallback
, V8TestInterface5::doubleAttributeAttributeSetterCallback, nullptr, nullptr, nu
llptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration
::OnPrototype, V8DOMConfiguration::CheckHolder}, |
| 867 {"floatAttribute", V8TestInterface5::floatAttributeAttributeGetterCallback,
V8TestInterface5::floatAttributeAttributeSetterCallback, nullptr, nullptr, nullp
tr, nullptr, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::O
nPrototype, V8DOMConfiguration::CheckHolder}, | 771 {"floatAttribute", V8TestInterface5::floatAttributeAttributeGetterCallback,
V8TestInterface5::floatAttributeAttributeSetterCallback, nullptr, nullptr, nullp
tr, nullptr, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::O
nPrototype, V8DOMConfiguration::CheckHolder}, |
| 868 {"unrestrictedDoubleAttribute", V8TestInterface5::unrestrictedDoubleAttribut
eAttributeGetterCallback, V8TestInterface5::unrestrictedDoubleAttributeAttribute
SetterCallback, nullptr, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttr
ibute>(v8::None), V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHold
er}, | 772 {"unrestrictedDoubleAttribute", V8TestInterface5::unrestrictedDoubleAttribut
eAttributeGetterCallback, V8TestInterface5::unrestrictedDoubleAttributeAttribute
SetterCallback, nullptr, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttr
ibute>(v8::None), V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHold
er}, |
| 869 {"unrestrictedFloatAttribute", V8TestInterface5::unrestrictedFloatAttributeA
ttributeGetterCallback, V8TestInterface5::unrestrictedFloatAttributeAttributeSet
terCallback, nullptr, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribu
te>(v8::None), V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}
, | 773 {"unrestrictedFloatAttribute", V8TestInterface5::unrestrictedFloatAttributeA
ttributeGetterCallback, V8TestInterface5::unrestrictedFloatAttributeAttributeSet
terCallback, nullptr, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribu
te>(v8::None), V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}
, |
| 870 {"staticStringAttribute", V8TestInterface5::staticStringAttributeAttributeGe
tterCallback, V8TestInterface5::staticStringAttributeAttributeSetterCallback, nu
llptr, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None),
V8DOMConfiguration::OnInterface, V8DOMConfiguration::CheckHolder}, | 774 {"staticStringAttribute", V8TestInterface5::staticStringAttributeAttributeGe
tterCallback, V8TestInterface5::staticStringAttributeAttributeSetterCallback, nu
llptr, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None),
V8DOMConfiguration::OnInterface, V8DOMConfiguration::CheckHolder}, |
| 775 {"length", V8TestInterface5::lengthAttributeGetterCallback, nullptr, nullptr
, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::ReadOnly), V
8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, |
| 871 {"alwaysExposedAttribute", V8TestInterface5::alwaysExposedAttributeAttribute
GetterCallback, V8TestInterface5::alwaysExposedAttributeAttributeSetterCallback,
nullptr, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None
), V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, | 776 {"alwaysExposedAttribute", V8TestInterface5::alwaysExposedAttributeAttribute
GetterCallback, V8TestInterface5::alwaysExposedAttributeAttributeSetterCallback,
nullptr, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None
), V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, |
| 872 }; | 777 }; |
| 873 | 778 |
| 874 const V8DOMConfiguration::MethodConfiguration V8TestInterface5Methods[] = { | 779 const V8DOMConfiguration::MethodConfiguration V8TestInterface5Methods[] = { |
| 875 {"voidMethodTestInterfaceEmptyArg", V8TestInterface5::voidMethodTestInterfac
eEmptyArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype,
V8DOMConfiguration::CheckHolder}, | 780 {"voidMethodTestInterfaceEmptyArg", V8TestInterface5::voidMethodTestInterfac
eEmptyArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype,
V8DOMConfiguration::CheckHolder}, |
| 876 {"voidMethodDoubleArgFloatArg", V8TestInterface5::voidMethodDoubleArgFloatAr
gMethodCallback, nullptr, 2, v8::None, V8DOMConfiguration::OnPrototype, V8DOMCon
figuration::CheckHolder}, | 781 {"voidMethodDoubleArgFloatArg", V8TestInterface5::voidMethodDoubleArgFloatAr
gMethodCallback, nullptr, 2, v8::None, V8DOMConfiguration::OnPrototype, V8DOMCon
figuration::CheckHolder}, |
| 877 {"voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg", V8TestInterface5::vo
idMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback, nullptr, 2, v8:
:None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, | 782 {"voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg", V8TestInterface5::vo
idMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback, nullptr, 2, v8:
:None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, |
| 878 {"voidMethod", V8TestInterface5::voidMethodMethodCallback, V8TestInterface5:
:voidMethodMethodCallbackForMainWorld, 0, v8::None, V8DOMConfiguration::OnProtot
ype, V8DOMConfiguration::CheckHolder}, | 783 {"voidMethod", V8TestInterface5::voidMethodMethodCallback, V8TestInterface5:
:voidMethodMethodCallbackForMainWorld, 0, v8::None, V8DOMConfiguration::OnProtot
ype, V8DOMConfiguration::CheckHolder}, |
| 879 {"alwaysExposedMethod", V8TestInterface5::alwaysExposedMethodMethodCallback,
nullptr, 0, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::Chec
kHolder}, | 784 {"alwaysExposedMethod", V8TestInterface5::alwaysExposedMethodMethodCallback,
nullptr, 0, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::Chec
kHolder}, |
| 880 {"alwaysExposedStaticMethod", V8TestInterface5::alwaysExposedStaticMethodMet
hodCallback, nullptr, 0, v8::None, V8DOMConfiguration::OnInterface, V8DOMConfigu
ration::CheckHolder}, | 785 {"alwaysExposedStaticMethod", V8TestInterface5::alwaysExposedStaticMethodMet
hodCallback, nullptr, 0, v8::None, V8DOMConfiguration::OnInterface, V8DOMConfigu
ration::CheckHolder}, |
| 881 {"voidMethodBooleanOrDOMStringArg", V8TestInterface5::voidMethodBooleanOrDOM
StringArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype,
V8DOMConfiguration::CheckHolder}, | 786 {"voidMethodBooleanOrDOMStringArg", V8TestInterface5::voidMethodBooleanOrDOM
StringArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype,
V8DOMConfiguration::CheckHolder}, |
| 882 {"voidMethodDoubleOrDOMStringArg", V8TestInterface5::voidMethodDoubleOrDOMSt
ringArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8
DOMConfiguration::CheckHolder}, | 787 {"voidMethodDoubleOrDOMStringArg", V8TestInterface5::voidMethodDoubleOrDOMSt
ringArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8
DOMConfiguration::CheckHolder}, |
| 883 {"voidMethodVoidExperimentalCallbackFunction", V8TestInterface5::voidMethodV
oidExperimentalCallbackFunctionMethodCallback, nullptr, 1, v8::None, V8DOMConfig
uration::OnPrototype, V8DOMConfiguration::CheckHolder}, | 788 {"voidMethodVoidExperimentalCallbackFunction", V8TestInterface5::voidMethodV
oidExperimentalCallbackFunctionMethodCallback, nullptr, 1, v8::None, V8DOMConfig
uration::OnPrototype, V8DOMConfiguration::CheckHolder}, |
| 884 {"voidMethodVoidCallbackFunctionModulesArg", V8TestInterface5::voidMethodVoi
dCallbackFunctionModulesArgMethodCallback, nullptr, 1, v8::None, V8DOMConfigurat
ion::OnPrototype, V8DOMConfiguration::CheckHolder}, | 789 {"voidMethodVoidCallbackFunctionModulesArg", V8TestInterface5::voidMethodVoi
dCallbackFunctionModulesArgMethodCallback, nullptr, 1, v8::None, V8DOMConfigurat
ion::OnPrototype, V8DOMConfiguration::CheckHolder}, |
| 885 {"keys", V8TestInterface5::keysMethodCallback, nullptr, 0, v8::None, V8DOMCo
nfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, | |
| 886 {"values", V8TestInterface5::valuesMethodCallback, nullptr, 0, v8::None, V8D
OMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, | |
| 887 {"entries", V8TestInterface5::entriesMethodCallback, nullptr, 0, v8::None, V
8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, | |
| 888 {"forEach", V8TestInterface5::forEachMethodCallback, nullptr, 1, v8::None, V
8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, | |
| 889 {"toString", V8TestInterface5::toStringMethodCallback, nullptr, 0, static_ca
st<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::OnPrototype, V8DOMC
onfiguration::CheckHolder}, | 790 {"toString", V8TestInterface5::toStringMethodCallback, nullptr, 0, static_ca
st<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::OnPrototype, V8DOMC
onfiguration::CheckHolder}, |
| 890 }; | 791 }; |
| 891 | 792 |
| 892 static void installV8TestInterface5Template(v8::Isolate* isolate, const DOMWrapp
erWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) { | 793 static void installV8TestInterface5Template(v8::Isolate* isolate, const DOMWrapp
erWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) { |
| 893 // Initialize the interface object's template. | 794 // Initialize the interface object's template. |
| 894 V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate,
V8TestInterface5::wrapperTypeInfo.interfaceName, V8TestInterfaceEmpty::domTempl
ate(isolate, world), V8TestInterface5::internalFieldCount); | 795 V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate,
V8TestInterface5::wrapperTypeInfo.interfaceName, V8TestInterfaceEmpty::domTempl
ate(isolate, world), V8TestInterface5::internalFieldCount); |
| 895 | 796 |
| 896 if (!RuntimeEnabledFeatures::featureNameEnabled()) { | 797 if (!RuntimeEnabledFeatures::featureNameEnabled()) { |
| 897 return; | 798 return; |
| 898 } | 799 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 914 V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototy
peTemplate, interfaceTemplate, signature, V8TestInterface5Accessors, WTF_ARRAY_L
ENGTH(V8TestInterface5Accessors)); | 815 V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototy
peTemplate, interfaceTemplate, signature, V8TestInterface5Accessors, WTF_ARRAY_L
ENGTH(V8TestInterface5Accessors)); |
| 915 V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototype
Template, interfaceTemplate, signature, V8TestInterface5Methods, WTF_ARRAY_LENGT
H(V8TestInterface5Methods)); | 816 V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototype
Template, interfaceTemplate, signature, V8TestInterface5Methods, WTF_ARRAY_LENGT
H(V8TestInterface5Methods)); |
| 916 | 817 |
| 917 // Indexed properties | 818 // Indexed properties |
| 918 v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig(V8TestInt
erface5::indexedPropertyGetterCallback, V8TestInterface5::indexedPropertySetterC
allback, nullptr, V8TestInterface5::indexedPropertyDeleterCallback, indexedPrope
rtyEnumerator<TestInterface5Implementation>, v8::Local<v8::Value>(), v8::Propert
yHandlerFlags::kNone); | 819 v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig(V8TestInt
erface5::indexedPropertyGetterCallback, V8TestInterface5::indexedPropertySetterC
allback, nullptr, V8TestInterface5::indexedPropertyDeleterCallback, indexedPrope
rtyEnumerator<TestInterface5Implementation>, v8::Local<v8::Value>(), v8::Propert
yHandlerFlags::kNone); |
| 919 instanceTemplate->SetHandler(indexedPropertyHandlerConfig); | 820 instanceTemplate->SetHandler(indexedPropertyHandlerConfig); |
| 920 // Named properties | 821 // Named properties |
| 921 v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig(V8TestInterfa
ce5::namedPropertyGetterCallback, V8TestInterface5::namedPropertySetterCallback,
V8TestInterface5::namedPropertyQueryCallback, V8TestInterface5::namedPropertyDe
leterCallback, V8TestInterface5::namedPropertyEnumeratorCallback, v8::Local<v8::
Value>(), static_cast<v8::PropertyHandlerFlags>(int(v8::PropertyHandlerFlags::kO
nlyInterceptStrings) | int(v8::PropertyHandlerFlags::kNonMasking))); | 822 v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig(V8TestInterfa
ce5::namedPropertyGetterCallback, V8TestInterface5::namedPropertySetterCallback,
V8TestInterface5::namedPropertyQueryCallback, V8TestInterface5::namedPropertyDe
leterCallback, V8TestInterface5::namedPropertyEnumeratorCallback, v8::Local<v8::
Value>(), static_cast<v8::PropertyHandlerFlags>(int(v8::PropertyHandlerFlags::kO
nlyInterceptStrings) | int(v8::PropertyHandlerFlags::kNonMasking))); |
| 922 instanceTemplate->SetHandler(namedPropertyHandlerConfig); | 823 instanceTemplate->SetHandler(namedPropertyHandlerConfig); |
| 923 | 824 |
| 924 // Iterator (@@iterator) | 825 // Array iterator (@@iterator) |
| 925 const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIteratorCo
nfiguration = { v8::Symbol::GetIterator, V8TestInterface5::iteratorMethodCallbac
k, 0, v8::DontEnum, V8DOMConfiguration::OnPrototype }; | 826 prototypeTemplate->SetIntrinsicDataProperty(v8::Symbol::GetIterator(isolate),
v8::kArrayProto_values, v8::DontEnum); |
| 926 V8DOMConfiguration::installMethod(isolate, world, prototypeTemplate, signature
, symbolKeyedIteratorConfiguration); | 827 // For value iterators, the properties below must originally be set to the cor
responding ones in %ArrayPrototype%. |
| 828 // See https://heycam.github.io/webidl/#es-iterators. |
| 829 prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "entries")
, v8::kArrayProto_entries); |
| 830 prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "forEach")
, v8::kArrayProto_forEach); |
| 831 prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "keys"), v
8::kArrayProto_keys); |
| 832 prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "values"),
v8::kArrayProto_values); |
| 927 | 833 |
| 928 instanceTemplate->SetCallAsFunctionHandler(V8TestInterface5::legacyCallCustom)
; | 834 instanceTemplate->SetCallAsFunctionHandler(V8TestInterface5::legacyCallCustom)
; |
| 929 } | 835 } |
| 930 | 836 |
| 931 v8::Local<v8::FunctionTemplate> V8TestInterface5::domTemplate(v8::Isolate* isola
te, const DOMWrapperWorld& world) { | 837 v8::Local<v8::FunctionTemplate> V8TestInterface5::domTemplate(v8::Isolate* isola
te, const DOMWrapperWorld& world) { |
| 932 return V8DOMConfiguration::domClassTemplate(isolate, world, const_cast<Wrapper
TypeInfo*>(&wrapperTypeInfo), installV8TestInterface5Template); | 838 return V8DOMConfiguration::domClassTemplate(isolate, world, const_cast<Wrapper
TypeInfo*>(&wrapperTypeInfo), installV8TestInterface5Template); |
| 933 } | 839 } |
| 934 | 840 |
| 935 bool V8TestInterface5::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* is
olate) { | 841 bool V8TestInterface5::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* is
olate) { |
| 936 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value)
; | 842 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value)
; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodMetho
dConfiguration = {"windowExposedStaticMethod", V8TestInterface5::windowExposedSt
aticMethodMethodCallback, nullptr, 0, v8::None, V8DOMConfiguration::OnInterface,
V8DOMConfiguration::CheckHolder}; | 881 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodMetho
dConfiguration = {"windowExposedStaticMethod", V8TestInterface5::windowExposedSt
aticMethodMethodCallback, nullptr, 0, v8::None, V8DOMConfiguration::OnInterface,
V8DOMConfiguration::CheckHolder}; |
| 976 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p
rototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodConfi
guration); | 882 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p
rototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodConfi
guration); |
| 977 } | 883 } |
| 978 if (executionContext && (executionContext->isDocument() || executionContext->i
sServiceWorkerGlobalScope())) { | 884 if (executionContext && (executionContext->isDocument() || executionContext->i
sServiceWorkerGlobalScope())) { |
| 979 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExposedM
ethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", V8TestInterfa
ce5::windowAndServiceWorkerExposedMethodMethodCallback, nullptr, 0, v8::None, V8
DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}; | 885 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExposedM
ethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", V8TestInterfa
ce5::windowAndServiceWorkerExposedMethodMethodCallback, nullptr, 0, v8::None, V8
DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}; |
| 980 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p
rototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMethodM
ethodConfiguration); | 886 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p
rototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMethodM
ethodConfiguration); |
| 981 } | 887 } |
| 982 } | 888 } |
| 983 | 889 |
| 984 } // namespace blink | 890 } // namespace blink |
| OLD | NEW |