Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl

Issue 2573713002: [Bindings][Refactoring] Remove filters for origin trial features (Closed)
Patch Set: Rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 {% endif %} 526 {% endif %}
527 } 527 }
528 528
529 {% endif %}{# not is_array_buffer_or_view #} 529 {% endif %}{# not is_array_buffer_or_view #}
530 {% endblock %} 530 {% endblock %}
531 {##############################################################################} 531 {##############################################################################}
532 {% block origin_trials %} 532 {% block origin_trials %}
533 {% from 'attributes.cpp.tmpl' import attribute_configuration with context %} 533 {% from 'attributes.cpp.tmpl' import attribute_configuration with context %}
534 {% from 'constants.cpp.tmpl' import constant_configuration with context %} 534 {% from 'constants.cpp.tmpl' import constant_configuration with context %}
535 {% from 'methods.cpp.tmpl' import method_configuration with context %} 535 {% from 'methods.cpp.tmpl' import method_configuration with context %}
536 {% for origin_trial_feature in origin_trial_features %} 536 {% for feature in origin_trial_features %}
537 void {{v8_class_or_partial}}::install{{origin_trial_feature.name}}(v8::Isolate* isolate, const DOMWrapperWorld& world, v8::Local<v8::Object> instance, v8::Local <v8::Object> prototype, v8::Local<v8::Function> interface) { 537 void {{v8_class_or_partial}}::install{{feature.name}}(v8::Isolate* isolate, cons t DOMWrapperWorld& world, v8::Local<v8::Object> instance, v8::Local<v8::Object> prototype, v8::Local<v8::Function> interface) {
538 {% if attributes | for_origin_trial_feature(origin_trial_feature.name) or 538 {% if feature.attributes or feature.methods | sort %}
Yuki 2016/12/14 05:35:04 Why do we need "| sort"?
peria 2016/12/14 06:05:30 Not needed. Removed.
539 methods | method_for_origin_trial_feature(origin_trial_feature.name, is_ partial) %}
540 v8::Local<v8::FunctionTemplate> interfaceTemplate = {{v8_class}}::wrapperTypeI nfo.domTemplate(isolate, world); 539 v8::Local<v8::FunctionTemplate> interfaceTemplate = {{v8_class}}::wrapperTypeI nfo.domTemplate(isolate, world);
541 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp late); 540 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp late);
542 ALLOW_UNUSED_LOCAL(signature); 541 ALLOW_UNUSED_LOCAL(signature);
543 {% endif %} 542 {% endif %}
544 {# Origin-Trial-enabled attributes #} 543 {# Origin-Trial-enabled attributes #}
545 {% for attribute in attributes | for_origin_trial_feature(origin_trial_feature .name) | unique_by('name') | sort %} 544 {% for attribute in feature.attributes | sort %}
546 {% if attribute.is_data_type_property %} 545 {% if attribute.is_data_type_property %}
547 const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.name}}Co nfiguration = {{attribute_configuration(attribute)}}; 546 const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.name}}Co nfiguration = {{attribute_configuration(attribute)}};
548 V8DOMConfiguration::installAttribute(isolate, world, instance, prototype, attr ibute{{attribute.name}}Configuration); 547 V8DOMConfiguration::installAttribute(isolate, world, instance, prototype, attr ibute{{attribute.name}}Configuration);
549 {% else %} 548 {% else %}
550 const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.name}}Conf iguration = {{attribute_configuration(attribute)}}; 549 const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.name}}Conf iguration = {{attribute_configuration(attribute)}};
551 V8DOMConfiguration::installAccessor(isolate, world, instance, prototype, inter face, signature, accessor{{attribute.name}}Configuration); 550 V8DOMConfiguration::installAccessor(isolate, world, instance, prototype, inter face, signature, accessor{{attribute.name}}Configuration);
552 {% endif %} 551 {% endif %}
553 {% endfor %} 552 {% endfor %}
554 {# Origin-Trial-enabled constants #} 553 {# Origin-Trial-enabled constants #}
555 {% for constant in constants | for_origin_trial_feature(origin_trial_feature.n ame) | unique_by('name') | sort %} 554 {% for constant in feature.constants | sort %}
556 {% set constant_name = constant.name.title().replace('_', '') %} 555 {% set constant_name = constant.name.title().replace('_', '') %}
557 const V8DOMConfiguration::ConstantConfiguration constant{{constant_name}}Confi guration = {{constant_configuration(constant)}}; 556 const V8DOMConfiguration::ConstantConfiguration constant{{constant_name}}Confi guration = {{constant_configuration(constant)}};
558 V8DOMConfiguration::installConstant(isolate, interface, prototype, constant{{c onstant_name}}Configuration); 557 V8DOMConfiguration::installConstant(isolate, interface, prototype, constant{{c onstant_name}}Configuration);
559 {% endfor %} 558 {% endfor %}
560 {# Origin-Trial-enabled methods (no overloads) #} 559 {# Origin-Trial-enabled methods (no overloads) #}
561 {% for method in methods | method_for_origin_trial_feature(origin_trial_featur e.name, is_partial) | unique_by('name') | sort %} 560 {% for method in feature.methods | sort %}
562 {% set method_name = method.name.title().replace('_', '') %} 561 {% set method_name = method.name.title().replace('_', '') %}
563 const V8DOMConfiguration::MethodConfiguration method{{method_name}}Configurati on = {{method_configuration(method)}}; 562 const V8DOMConfiguration::MethodConfiguration method{{method_name}}Configurati on = {{method_configuration(method)}};
564 V8DOMConfiguration::installMethod(isolate, world, instance, prototype, interfa ce, signature, method{{method_name}}Configuration); 563 V8DOMConfiguration::installMethod(isolate, world, instance, prototype, interfa ce, signature, method{{method_name}}Configuration);
565 {% endfor %} 564 {% endfor %}
566 } 565 }
567 566
568 void {{v8_class_or_partial}}::install{{origin_trial_feature.name}}(ScriptState* scriptState, v8::Local<v8::Object> instance) { 567 void {{v8_class_or_partial}}::install{{feature.name}}(ScriptState* scriptState, v8::Local<v8::Object> instance) {
569 V8PerContextData* perContextData = V8PerContextData::from(scriptState->context ()); 568 V8PerContextData* perContextData = V8PerContextData::from(scriptState->context ());
570 v8::Local<v8::Object> prototype = perContextData->prototypeForType(&{{v8_class }}::wrapperTypeInfo); 569 v8::Local<v8::Object> prototype = perContextData->prototypeForType(&{{v8_class }}::wrapperTypeInfo);
571 v8::Local<v8::Function> interface = perContextData->constructorForType(&{{v8_c lass}}::wrapperTypeInfo); 570 v8::Local<v8::Function> interface = perContextData->constructorForType(&{{v8_c lass}}::wrapperTypeInfo);
572 ALLOW_UNUSED_LOCAL(interface); 571 ALLOW_UNUSED_LOCAL(interface);
573 install{{origin_trial_feature.name}}(scriptState->isolate(), scriptState->worl d(), instance, prototype, interface); 572 install{{feature.name}}(scriptState->isolate(), scriptState->world(), instance , prototype, interface);
574 } 573 }
575 {% if not origin_trial_feature.needs_instance %} 574 {% if not feature.needs_instance %}
576 575
577 void {{v8_class_or_partial}}::install{{origin_trial_feature.name}}(ScriptState* scriptState) { 576 void {{v8_class_or_partial}}::install{{feature.name}}(ScriptState* scriptState) {
578 install{{origin_trial_feature.name}}(scriptState, v8::Local<v8::Object>()); 577 install{{feature.name}}(scriptState, v8::Local<v8::Object>());
579 } 578 }
580 {% endif %} 579 {% endif %}
581 580
582 {% endfor %} 581 {% endfor %}{# feature #}
583 {% endblock %} 582 {% endblock %}
584 {##############################################################################} 583 {##############################################################################}
585 {% block get_dom_template %}{% endblock %} 584 {% block get_dom_template %}{% endblock %}
586 {% block get_dom_template_for_named_properties_object %}{% endblock %} 585 {% block get_dom_template_for_named_properties_object %}{% endblock %}
587 {% block has_instance %}{% endblock %} 586 {% block has_instance %}{% endblock %}
588 {% block to_impl %}{% endblock %} 587 {% block to_impl %}{% endblock %}
589 {% block to_impl_with_type_check %}{% endblock %} 588 {% block to_impl_with_type_check %}{% endblock %}
590 {##############################################################################} 589 {##############################################################################}
591 {% block prepare_prototype_and_interface_object %}{% endblock %} 590 {% block prepare_prototype_and_interface_object %}{% endblock %}
592 {##############################################################################} 591 {##############################################################################}
593 {% for method in methods if method.is_implemented_in_private_script and method.v isible %} 592 {% for method in methods if method.is_implemented_in_private_script and method.v isible %}
594 {{method_implemented_in_private_script(method)}} 593 {{method_implemented_in_private_script(method)}}
595 {% endfor %} 594 {% endfor %}
596 {% for attribute in attributes if attribute.is_implemented_in_private_script %} 595 {% for attribute in attributes if attribute.is_implemented_in_private_script %}
597 {{attribute_getter_implemented_in_private_script(attribute)}} 596 {{attribute_getter_implemented_in_private_script(attribute)}}
598 {% if attribute.has_setter %} 597 {% if attribute.has_setter %}
599 {{attribute_setter_implemented_in_private_script(attribute)}} 598 {{attribute_setter_implemented_in_private_script(attribute)}}
600 {% endif %} 599 {% endif %}
601 {% endfor %} 600 {% endfor %}
602 {% block partial_interface %}{% endblock %} 601 {% block partial_interface %}{% endblock %}
603 } // namespace blink 602 } // namespace blink
604 603
605 {% endfilter %}{# format_blink_cpp_source_code #} 604 {% endfilter %}{# format_blink_cpp_source_code #}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698