| OLD | NEW |
| 1 {% filter format_blink_cpp_source_code %} | 1 {% filter format_blink_cpp_source_code %} |
| 2 | 2 |
| 3 {% include 'copyright_block.txt' %} | 3 {% include 'copyright_block.txt' %} |
| 4 #include "{{v8_class_or_partial}}.h" | 4 #include "{{v8_class_or_partial}}.h" |
| 5 | 5 |
| 6 {% for filename in cpp_includes if filename != '%s.h' % cpp_class_or_partial %} | 6 {% for filename in cpp_includes if filename != '%s.h' % cpp_class_or_partial %} |
| 7 #include "{{filename}}" | 7 #include "{{filename}}" |
| 8 {% endfor %} | 8 {% endfor %} |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 // Global object prototype chain consists of Immutable Prototype Exotic Object
s | 420 // Global object prototype chain consists of Immutable Prototype Exotic Object
s |
| 421 prototypeTemplate->SetImmutableProto(); | 421 prototypeTemplate->SetImmutableProto(); |
| 422 {% endif %} | 422 {% endif %} |
| 423 | 423 |
| 424 {% if is_global %} | 424 {% if is_global %} |
| 425 // Global objects are Immutable Prototype Exotic Objects | 425 // Global objects are Immutable Prototype Exotic Objects |
| 426 instanceTemplate->SetImmutableProto(); | 426 instanceTemplate->SetImmutableProto(); |
| 427 {% endif %} | 427 {% endif %} |
| 428 | 428 |
| 429 // Register DOM constants, attributes and operations. | 429 // Register DOM constants, attributes and operations. |
| 430 {% filter runtime_enabled(runtime_enabled_function) %} | 430 {% filter runtime_enabled(runtime_enabled_feature_name) %} |
| 431 {% if constants %} | 431 {% if constants %} |
| 432 {{install_constants() | indent(2)}} | 432 {{install_constants() | indent(2)}} |
| 433 {% endif %} | 433 {% endif %} |
| 434 {% if data_attributes %} | 434 {% if data_attributes %} |
| 435 V8DOMConfiguration::installAttributes(isolate, world, instanceTemplate, protot
ypeTemplate, {{'%sAttributes' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sAttributes)' %
v8_class}}); | 435 V8DOMConfiguration::installAttributes(isolate, world, instanceTemplate, protot
ypeTemplate, {{'%sAttributes' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sAttributes)' %
v8_class}}); |
| 436 {% endif %} | 436 {% endif %} |
| 437 {% if lazy_data_attributes %} | 437 {% if lazy_data_attributes %} |
| 438 V8DOMConfiguration::installLazyDataAttributes(isolate, world, instanceTemplate
, prototypeTemplate, {{'%sLazyDataAttributes' % v8_class}}, {{'WTF_ARRAY_LENGTH(
%sLazyDataAttributes)' % v8_class}}); | 438 V8DOMConfiguration::installLazyDataAttributes(isolate, world, instanceTemplate
, prototypeTemplate, {{'%sLazyDataAttributes' % v8_class}}, {{'WTF_ARRAY_LENGTH(
%sLazyDataAttributes)' % v8_class}}); |
| 439 {% endif %} | 439 {% endif %} |
| 440 {% if accessors %} | 440 {% if accessors %} |
| 441 V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototy
peTemplate, interfaceTemplate, signature, {{'%sAccessors' % v8_class}}, {{'WTF_A
RRAY_LENGTH(%sAccessors)' % v8_class}}); | 441 V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototy
peTemplate, interfaceTemplate, signature, {{'%sAccessors' % v8_class}}, {{'WTF_A
RRAY_LENGTH(%sAccessors)' % v8_class}}); |
| 442 {% endif %} | 442 {% endif %} |
| 443 {% if methods | has_method_configuration(is_partial) %} | 443 {% if methods | has_method_configuration(is_partial) %} |
| 444 V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototype
Template, interfaceTemplate, signature, {{'%sMethods' % v8_class}}, {{'WTF_ARRAY
_LENGTH(%sMethods)' % v8_class}}); | 444 V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototype
Template, interfaceTemplate, signature, {{'%sMethods' % v8_class}}, {{'WTF_ARRAY
_LENGTH(%sMethods)' % v8_class}}); |
| 445 {% endif %} | 445 {% endif %} |
| 446 {% endfilter %} | 446 {% endfilter %} |
| 447 | 447 |
| 448 {% if has_access_check_callbacks and not is_partial %} | 448 {% if has_access_check_callbacks and not is_partial %} |
| 449 // Cross-origin access check | 449 // Cross-origin access check |
| 450 {% set cross_origin_named_getter = '%sV8Internal::crossOriginNamedGetter' % cp
p_class if has_cross_origin_named_getter else 'nullptr' %} | 450 {% set cross_origin_named_getter = '%sV8Internal::crossOriginNamedGetter' % cp
p_class if has_cross_origin_named_getter else 'nullptr' %} |
| 451 {% set cross_origin_named_setter = '%sV8Internal::crossOriginNamedSetter' % cp
p_class if has_cross_origin_named_setter else 'nullptr' %} | 451 {% set cross_origin_named_setter = '%sV8Internal::crossOriginNamedSetter' % cp
p_class if has_cross_origin_named_setter else 'nullptr' %} |
| 452 {% set cross_origin_named_enumerator = '%sV8Internal::crossOriginNamedEnumerat
or' % cpp_class if has_cross_origin_named_enumerator else 'nullptr' %} | 452 {% set cross_origin_named_enumerator = '%sV8Internal::crossOriginNamedEnumerat
or' % cpp_class if has_cross_origin_named_enumerator else 'nullptr' %} |
| 453 {% set cross_origin_indexed_getter = '%sV8Internal::crossOriginIndexedGetter'
% cpp_class if has_cross_origin_indexed_getter else 'nullptr' %} | 453 {% set cross_origin_indexed_getter = '%sV8Internal::crossOriginIndexedGetter'
% cpp_class if has_cross_origin_indexed_getter else 'nullptr' %} |
| 454 instanceTemplate->SetAccessCheckCallbackAndHandler({{cpp_class}}V8Internal::se
curityCheck, v8::NamedPropertyHandlerConfiguration({{cross_origin_named_getter}}
, {{cross_origin_named_setter}}, nullptr, nullptr, {{cross_origin_named_enumerat
or}}), v8::IndexedPropertyHandlerConfiguration({{cross_origin_indexed_getter}}),
v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&{{v8_class}}::wrapperT
ypeInfo))); | 454 instanceTemplate->SetAccessCheckCallbackAndHandler({{cpp_class}}V8Internal::se
curityCheck, v8::NamedPropertyHandlerConfiguration({{cross_origin_named_getter}}
, {{cross_origin_named_setter}}, nullptr, nullptr, {{cross_origin_named_enumerat
or}}), v8::IndexedPropertyHandlerConfiguration({{cross_origin_indexed_getter}}),
v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&{{v8_class}}::wrapperT
ypeInfo))); |
| 455 {% endif %} | 455 {% endif %} |
| 456 | 456 |
| 457 {% for group in runtime_enabled_attributes | groupby('runtime_feature_name') %
} | 457 {% for group in runtime_enabled_attributes | groupby('runtime_enabled_feature_
name') %} |
| 458 if ({{group.list[0].runtime_enabled_function}}()) { | 458 {% filter runtime_enabled(group.list[0].runtime_enabled_feature_name) %} |
| 459 {% for attribute in group.list | unique_by('name') | sort %} | 459 {% for attribute in group.list | unique_by('name') | sort %} |
| 460 {% if attribute.is_data_type_property %} | 460 {% if attribute.is_data_type_property %} |
| 461 const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.name}}
Configuration = {{attribute_configuration(attribute)}}; | 461 const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.name}}Co
nfiguration = {{attribute_configuration(attribute)}}; |
| 462 V8DOMConfiguration::installAttribute(isolate, world, instanceTemplate, proto
typeTemplate, attribute{{attribute.name}}Configuration); | 462 V8DOMConfiguration::installAttribute(isolate, world, instanceTemplate, prototy
peTemplate, attribute{{attribute.name}}Configuration); |
| 463 {% else %} | 463 {% else %} |
| 464 const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.name}}Co
nfiguration = {{attribute_configuration(attribute)}}; | 464 const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.name}}Conf
iguration = {{attribute_configuration(attribute)}}; |
| 465 V8DOMConfiguration::installAccessor(isolate, world, instanceTemplate, protot
ypeTemplate, interfaceTemplate, signature, accessor{{attribute.name}}Configurati
on); | 465 V8DOMConfiguration::installAccessor(isolate, world, instanceTemplate, prototyp
eTemplate, interfaceTemplate, signature, accessor{{attribute.name}}Configuration
); |
| 466 {% endif %} | 466 {% endif %} |
| 467 {% endfor %} | 467 {% endfor %} |
| 468 } | 468 {% endfilter %} |
| 469 {% endfor %} | 469 {% endfor %} |
| 470 | 470 |
| 471 {% if (indexed_property_getter or named_property_getter) and not is_partial %} | 471 {% if (indexed_property_getter or named_property_getter) and not is_partial %} |
| 472 // Indexed properties | 472 // Indexed properties |
| 473 {{install_indexed_property_handler('instanceTemplate') | indent(2)}} | 473 {{install_indexed_property_handler('instanceTemplate') | indent(2)}} |
| 474 {% endif %} | 474 {% endif %} |
| 475 {% if named_property_getter and not is_partial and not has_named_properties_ob
ject %} | 475 {% if named_property_getter and not is_partial and not has_named_properties_ob
ject %} |
| 476 // Named properties | 476 // Named properties |
| 477 {{install_named_property_handler('instanceTemplate') | indent(2)}} | 477 {{install_named_property_handler('instanceTemplate') | indent(2)}} |
| 478 {% endif %} | 478 {% endif %} |
| 479 | 479 |
| 480 {% if has_array_iterator and not is_partial %} | 480 {% if has_array_iterator and not is_partial %} |
| 481 // Array iterator (@@iterator) | 481 // Array iterator (@@iterator) |
| 482 {%+ if is_global %}instanceTemplate{% else %}prototypeTemplate{% endif %}->Set
IntrinsicDataProperty(v8::Symbol::GetIterator(isolate), v8::kArrayProto_values,
v8::DontEnum); | 482 {%+ if is_global %}instanceTemplate{% else %}prototypeTemplate{% endif %}->Set
IntrinsicDataProperty(v8::Symbol::GetIterator(isolate), v8::kArrayProto_values,
v8::DontEnum); |
| 483 {% endif %} | 483 {% endif %} |
| 484 | 484 |
| 485 {% if iterator_method %} | 485 {% if iterator_method %} |
| 486 {% filter exposed(iterator_method.exposed_test) %} | 486 {% filter exposed(iterator_method.exposed_test) %} |
| 487 {% filter runtime_enabled(iterator_method.runtime_enabled_function) %} | 487 {% filter runtime_enabled(iterator_method.runtime_enabled_feature_name) %} |
| 488 // Iterator (@@iterator) | 488 // Iterator (@@iterator) |
| 489 const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIteratorCo
nfiguration = { v8::Symbol::GetIterator, {{cpp_class_or_partial}}V8Internal::ite
ratorMethodCallback, 0, v8::DontEnum, V8DOMConfiguration::OnPrototype }; | 489 const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIteratorCo
nfiguration = { v8::Symbol::GetIterator, {{cpp_class_or_partial}}V8Internal::ite
ratorMethodCallback, 0, v8::DontEnum, V8DOMConfiguration::OnPrototype }; |
| 490 V8DOMConfiguration::installMethod(isolate, world, prototypeTemplate, signature
, symbolKeyedIteratorConfiguration); | 490 V8DOMConfiguration::installMethod(isolate, world, prototypeTemplate, signature
, symbolKeyedIteratorConfiguration); |
| 491 {% endfilter %} | 491 {% endfilter %} |
| 492 {% endfilter %} | 492 {% endfilter %} |
| 493 {% endif %} | 493 {% endif %} |
| 494 | 494 |
| 495 {% if legacy_caller and not is_partial %} | 495 {% if legacy_caller and not is_partial %} |
| 496 instanceTemplate->SetCallAsFunctionHandler({{cpp_class_or_partial}}V8Internal:
:{{legacy_caller.name}}MethodCallback); | 496 instanceTemplate->SetCallAsFunctionHandler({{cpp_class_or_partial}}V8Internal:
:{{legacy_caller.name}}MethodCallback); |
| 497 {% elif has_custom_legacy_call_as_function and not is_partial %} | 497 {% elif has_custom_legacy_call_as_function and not is_partial %} |
| 498 instanceTemplate->SetCallAsFunctionHandler({{v8_class}}::legacyCallCustom); | 498 instanceTemplate->SetCallAsFunctionHandler({{v8_class}}::legacyCallCustom); |
| 499 {% endif %} | 499 {% endif %} |
| 500 | 500 |
| 501 {% if interface_name == 'HTMLAllCollection' and not is_partial %} | 501 {% if interface_name == 'HTMLAllCollection' and not is_partial %} |
| 502 // Needed for legacy support of document.all | 502 // Needed for legacy support of document.all |
| 503 instanceTemplate->MarkAsUndetectable(); | 503 instanceTemplate->MarkAsUndetectable(); |
| 504 {% endif %} | 504 {% endif %} |
| 505 | 505 |
| 506 {% if methods | custom_registration(is_partial) %} | 506 {% if methods | custom_registration(is_partial) %} |
| 507 {% for method in methods | custom_registration(is_partial) %} | 507 {% for method in methods | custom_registration(is_partial) %} |
| 508 {# install_custom_signature #} | 508 {# install_custom_signature #} |
| 509 {% filter exposed(method.overloads.exposed_test_all | 509 {% filter exposed(method.overloads.exposed_test_all |
| 510 if method.overloads else method.exposed_test) %} | 510 if method.overloads else method.exposed_test) %} |
| 511 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all | 511 {% filter runtime_enabled(method.overloads.runtime_enabled_all |
| 512 if method.overloads else method.runtime_enabled_func
tion) %} | 512 if method.overloads else method.runtime_enabled_feat
ure_name) %} |
| 513 {% if method.is_cross_origin %} | 513 {% if method.is_cross_origin %} |
| 514 {# TODO(dcheng): Currently, bindings must create a function object for each | 514 {# TODO(dcheng): Currently, bindings must create a function object for each |
| 515 realm as a hack to support the incumbent realm. Remove this when Blink | 515 realm as a hack to support the incumbent realm. Remove this when Blink |
| 516 properly supports the incumbent realm. #} | 516 properly supports the incumbent realm. #} |
| 517 {{install_origin_safe_method(method, '', 'instanceTemplate', 'prototypeTemplat
e') | indent(2)}} | 517 {{install_origin_safe_method(method, '', 'instanceTemplate', 'prototypeTemplat
e') | indent(2)}} |
| 518 {% else %} | 518 {% else %} |
| 519 {{install_custom_signature(method, 'instanceTemplate', 'prototypeTemplate', 'i
nterfaceTemplate', 'signature') | indent(2)}} | 519 {{install_custom_signature(method, 'instanceTemplate', 'prototypeTemplate', 'i
nterfaceTemplate', 'signature') | indent(2)}} |
| 520 {% endif %} | 520 {% endif %} |
| 521 {% endfilter %} | 521 {% endfilter %} |
| 522 {% endfilter %} | 522 {% endfilter %} |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 {% block has_instance %}{% endblock %} | 584 {% block has_instance %}{% endblock %} |
| 585 {% block to_impl %}{% endblock %} | 585 {% block to_impl %}{% endblock %} |
| 586 {% block to_impl_with_type_check %}{% endblock %} | 586 {% block to_impl_with_type_check %}{% endblock %} |
| 587 {##############################################################################} | 587 {##############################################################################} |
| 588 {% block prepare_prototype_and_interface_object %}{% endblock %} | 588 {% block prepare_prototype_and_interface_object %}{% endblock %} |
| 589 {##############################################################################} | 589 {##############################################################################} |
| 590 {% block partial_interface %}{% endblock %} | 590 {% block partial_interface %}{% endblock %} |
| 591 } // namespace blink | 591 } // namespace blink |
| 592 | 592 |
| 593 {% endfilter %}{# format_blink_cpp_source_code #} | 593 {% endfilter %}{# format_blink_cpp_source_code #} |
| OLD | NEW |