OLD | NEW |
1 {% extends 'interface_base.cpp.tmpl' %} | 1 {% extends 'interface_base.cpp.tmpl' %} |
2 | 2 |
3 {% set has_prepare_prototype_and_interface_object = | 3 {% set has_prepare_prototype_and_interface_object = |
4 unscopables or has_conditional_attributes_on_prototype or | 4 unscopables or has_conditional_attributes_on_prototype or |
5 methods | conditionally_exposed(is_partial) %} | 5 methods | conditionally_exposed(is_partial) %} |
6 {% set prepare_prototype_and_interface_object_func = | 6 {% set prepare_prototype_and_interface_object_func = |
7 '%s::preparePrototypeAndInterfaceObject' % v8_class | 7 '%s::preparePrototypeAndInterfaceObject' % v8_class |
8 if has_prepare_prototype_and_interface_object | 8 if has_prepare_prototype_and_interface_object |
9 else 'nullptr' %} | 9 else 'nullptr' %} |
10 | 10 |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 | 626 |
627 {% endif %} | 627 {% endif %} |
628 {% endblock %} | 628 {% endblock %} |
629 | 629 |
630 | 630 |
631 {##############################################################################} | 631 {##############################################################################} |
632 {% block constructor_callback %} | 632 {% block constructor_callback %} |
633 {% if constructors or has_custom_constructor or has_event_constructor or has_htm
l_constructor %} | 633 {% if constructors or has_custom_constructor or has_event_constructor or has_htm
l_constructor %} |
634 void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) { | 634 void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) { |
635 {% if measure_as %} | 635 {% if measure_as %} |
636 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionContext
(info.GetIsolate()), UseCounter::{{measure_as('Constructor')}}); | 636 UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::{{me
asure_as('Constructor')}}); |
637 {% endif %} | 637 {% endif %} |
638 if (!info.IsConstructCall()) { | 638 if (!info.IsConstructCall()) { |
639 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::const
ructorNotCallableAsFunction("{{interface_name}}")); | 639 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::const
ructorNotCallableAsFunction("{{interface_name}}")); |
640 return; | 640 return; |
641 } | 641 } |
642 | 642 |
643 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExisti
ngObject) { | 643 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExisti
ngObject) { |
644 v8SetReturnValue(info, info.Holder()); | 644 v8SetReturnValue(info, info.Holder()); |
645 return; | 645 return; |
646 } | 646 } |
(...skipping 27 matching lines...) Expand all Loading... |
674 {% set getter_callback_for_main_world = '%sForMainWorld' % getter_callback %} | 674 {% set getter_callback_for_main_world = '%sForMainWorld' % getter_callback %} |
675 {% set setter_callback_for_main_world = '%sForMainWorld' % setter_callback | 675 {% set setter_callback_for_main_world = '%sForMainWorld' % setter_callback |
676 if not method.is_unforgeable else '0' %} | 676 if not method.is_unforgeable else '0' %} |
677 {% else %} | 677 {% else %} |
678 {% set getter_callback_for_main_world = '0' %} | 678 {% set getter_callback_for_main_world = '0' %} |
679 {% set setter_callback_for_main_world = '0' %} | 679 {% set setter_callback_for_main_world = '0' %} |
680 {% endif %} | 680 {% endif %} |
681 {% set property_attribute = | 681 {% set property_attribute = |
682 'static_cast<v8::PropertyAttribute>(%s)' % | 682 'static_cast<v8::PropertyAttribute>(%s)' % |
683 ' | '.join(method.property_attributes or ['v8::None']) %} | 683 ' | '.join(method.property_attributes or ['v8::None']) %} |
684 {% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivat
eScript' if method.only_exposed_to_private_script else 'V8DOMConfiguration::Expo
sedToAllScripts' %} | |
685 {% set holder_check = 'V8DOMConfiguration::CheckHolder' %} | 684 {% set holder_check = 'V8DOMConfiguration::CheckHolder' %} |
686 const V8DOMConfiguration::AttributeConfiguration {{method.name}}OriginSafeAttrib
uteConfiguration = { | 685 const V8DOMConfiguration::AttributeConfiguration {{method.name}}OriginSafeAttrib
uteConfiguration = { |
687 "{{method.name}}", {{getter_callback}}, {{setter_callback}}, {{getter_callba
ck_for_main_world}}, {{setter_callback_for_main_world}}, nullptr, &{{v8_class}}:
:wrapperTypeInfo, v8::DEFAULT, {{property_attribute}}, {{only_exposed_to_private
_script}}, {{property_location(method)}}, {{holder_check}}, | 686 "{{method.name}}", {{getter_callback}}, {{setter_callback}}, {{getter_callba
ck_for_main_world}}, {{setter_callback_for_main_world}}, nullptr, &{{v8_class}}:
:wrapperTypeInfo, v8::DEFAULT, {{property_attribute}}, {{property_location(metho
d)}}, {{holder_check}} |
688 }; | 687 }; |
689 V8DOMConfiguration::installAttribute(isolate, world, {{instance_template}}, {{pr
ototype_template}}, {{method.name}}OriginSafeAttributeConfiguration); | 688 V8DOMConfiguration::installAttribute(isolate, world, {{instance_template}}, {{pr
ototype_template}}, {{method.name}}OriginSafeAttributeConfiguration); |
690 {%- endmacro %} | 689 {%- endmacro %} |
691 | 690 |
692 | 691 |
693 {##############################################################################} | 692 {##############################################################################} |
694 {% macro install_indexed_property_handler(target) %} | 693 {% macro install_indexed_property_handler(target) %} |
695 {% set indexed_property_getter_callback = | 694 {% set indexed_property_getter_callback = |
696 '%sV8Internal::indexedPropertyGetterCallback' % cpp_class %} | 695 '%sV8Internal::indexedPropertyGetterCallback' % cpp_class %} |
697 {% set indexed_property_setter_callback = | 696 {% set indexed_property_setter_callback = |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 } | 956 } |
958 | 957 |
959 {% for method in methods if method.overloads and method.overloads.has_partial_ov
erloads %} | 958 {% for method in methods if method.overloads and method.overloads.has_partial_ov
erloads %} |
960 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt
erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) { | 959 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt
erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) { |
961 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; | 960 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; |
962 } | 961 } |
963 | 962 |
964 {% endfor %} | 963 {% endfor %} |
965 {% endif %} | 964 {% endif %} |
966 {% endblock %} | 965 {% endblock %} |
OLD | NEW |