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

Unified Diff: third_party/WebKit/Source/bindings/templates/interface_base.cpp

Issue 2296573003: binding: Reduces the binary size of binding's generated code. (Closed)
Patch Set: Created 4 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/templates/interface_base.cpp
diff --git a/third_party/WebKit/Source/bindings/templates/interface_base.cpp b/third_party/WebKit/Source/bindings/templates/interface_base.cpp
index 6a1dff399597bd22069eab2057a29d8e1076a2a5..ca2292685012d3055909508d4941c42fb2a6fedf 100644
--- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp
+++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp
@@ -11,6 +11,13 @@ namespace blink {
{% set dom_template = '%s::domTemplate' % v8_class if not is_array_buffer_or_view else '0' %}
{% set visit_dom_wrapper = '%s::visitDOMWrapper' % v8_class
if has_visit_dom_wrapper else '0' %}
+{% set has_prepare_prototype_and_interface_object =
+ unscopeables or has_conditional_attributes_on_prototype or
+ methods | conditionally_exposed(is_partial) %}
+{% set prepare_prototype_and_interface_object_func =
+ '%s::preparePrototypeAndInterfaceObject' % v8_class
+ if has_prepare_prototype_and_interface_object
+ else 'nullptr' %}
{% set parent_wrapper_type_info = '&V8%s::wrapperTypeInfo' % parent_interface
if parent_interface else '0' %}
{% set wrapper_type_prototype = 'WrapperTypeExceptionPrototype' if is_exception else
@@ -28,7 +35,7 @@ namespace blink {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wglobal-constructors"
#endif
-{{wrapper_type_info_const}}WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin::kEmbedderBlink, {{dom_template}}, {{v8_class}}::trace, {{v8_class}}::traceWrappers, {{visit_dom_wrapper}}, {{v8_class}}::preparePrototypeAndInterfaceObject,{% if has_conditional_attributes %} {{v8_class}}::installConditionallyEnabledProperties{% else %} nullptr{% endif %}, "{{interface_name}}", {{parent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_prototype}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{active_scriptwrappable_inheritance}}, WrapperTypeInfo::{{event_target_inheritance}}, WrapperTypeInfo::{{lifetime}} };
+{{wrapper_type_info_const}}WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin::kEmbedderBlink, {{dom_template}}, {{v8_class}}::trace, {{v8_class}}::traceWrappers, {{visit_dom_wrapper}}, {{prepare_prototype_and_interface_object_func}}, "{{interface_name}}", {{parent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_prototype}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{active_scriptwrappable_inheritance}}, WrapperTypeInfo::{{event_target_inheritance}}, WrapperTypeInfo::{{lifetime}} };
#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
#pragma clang diagnostic pop
#endif
@@ -441,7 +448,6 @@ void {{v8_class_or_partial}}::install{{origin_trial_feature.name}}(ScriptState*
{% block has_instance %}{% endblock %}
{% block to_impl %}{% endblock %}
{% block to_impl_with_type_check %}{% endblock %}
-{% block install_conditional_attributes %}{% endblock %}
{##############################################################################}
{% block prepare_prototype_and_interface_object %}{% endblock %}
{##############################################################################}

Powered by Google App Engine
This is Rietveld 408576698