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

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

Issue 2045453002: Refactor WrapperTypeInfo.traceWrappers to WrapperTypeInfo.getHeader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use nicer name Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 {% include 'copyright_block.txt' %} 1 {% include 'copyright_block.txt' %}
2 #include "{{v8_class_or_partial}}.h" 2 #include "{{v8_class_or_partial}}.h"
3 3
4 {% for filename in cpp_includes if filename != '%s.h' % cpp_class_or_partial %} 4 {% for filename in cpp_includes if filename != '%s.h' % cpp_class_or_partial %}
5 #include "{{filename}}" 5 #include "{{filename}}"
6 {% endfor %} 6 {% endfor %}
7 7
8 namespace blink { 8 namespace blink {
9 {% set to_active_scriptwrappable = '%s::toActiveScriptWrappable' % v8_class 9 {% set to_active_scriptwrappable = '%s::toActiveScriptWrappable' % v8_class
10 if active_scriptwrappable else '0' %} 10 if active_scriptwrappable else '0' %}
11 {% set visit_dom_wrapper = '%s::visitDOMWrapper' % v8_class 11 {% set visit_dom_wrapper = '%s::visitDOMWrapper' % v8_class
12 if has_visit_dom_wrapper else '0' %} 12 if has_visit_dom_wrapper else '0' %}
13 {% set parent_wrapper_type_info = '&V8%s::wrapperTypeInfo' % parent_interface 13 {% set parent_wrapper_type_info = '&V8%s::wrapperTypeInfo' % parent_interface
14 if parent_interface else '0' %} 14 if parent_interface else '0' %}
15 {% set wrapper_type_prototype = 'WrapperTypeExceptionPrototype' if is_exception else 15 {% set wrapper_type_prototype = 'WrapperTypeExceptionPrototype' if is_exception else
16 'WrapperTypeObjectPrototype' %} 16 'WrapperTypeObjectPrototype' %}
17 {% set dom_template = '%s::domTemplate' % v8_class if not is_array_buffer_or_vie w else '0' %} 17 {% set dom_template = '%s::domTemplate' % v8_class if not is_array_buffer_or_vie w else '0' %}
18 18
19 {% set wrapper_type_info_const = '' if has_partial_interface else 'const ' %} 19 {% set wrapper_type_info_const = '' if has_partial_interface else 'const ' %}
20 {% if not is_partial %} 20 {% if not is_partial %}
21 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv ial 21 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv ial
22 // and does not depend on another global objects. 22 // and does not depend on another global objects.
23 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) 23 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
24 #pragma clang diagnostic push 24 #pragma clang diagnostic push
25 #pragma clang diagnostic ignored "-Wglobal-constructors" 25 #pragma clang diagnostic ignored "-Wglobal-constructors"
26 #endif 26 #endif
27 {{wrapper_type_info_const}}WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin ::kEmbedderBlink, {{dom_template}}, {{v8_class}}::trace, {{v8_class}}::traceWrap pers, {{to_active_scriptwrappable}}, {{visit_dom_wrapper}}, {{v8_class}}::prepar ePrototypeAndInterfaceObject,{% if has_conditional_attributes %} {{v8_class}}::i nstallConditionallyEnabledProperties{% else %} nullptr{% endif %}, "{{interface_ name}}", {{parent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_prototype }}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{event_target_inher itance}}, WrapperTypeInfo::{{lifetime}} }; 27 {{wrapper_type_info_const}}WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin ::kEmbedderBlink, {{dom_template}}, {{v8_class}}::getHeapObjectHeader, {{v8_clas s}}::trace, {{to_active_scriptwrappable}}, {{visit_dom_wrapper}}, {{v8_class}}:: preparePrototypeAndInterfaceObject,{% if has_conditional_attributes %} {{v8_clas s}}::installConditionallyEnabledProperties{% else %} nullptr{% endif %}, "{{inte rface_name}}", {{parent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_pro totype}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{event_target _inheritance}}, WrapperTypeInfo::{{lifetime}} };
28 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) 28 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
29 #pragma clang diagnostic pop 29 #pragma clang diagnostic pop
30 #endif 30 #endif
31 31
32 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in {{cpp_class} }.h. 32 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in {{cpp_class} }.h.
33 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 33 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
34 // bindings/core/v8/ScriptWrappable.h. 34 // bindings/core/v8/ScriptWrappable.h.
35 {% if not is_typed_array_type %} 35 {% if not is_typed_array_type %}
36 const WrapperTypeInfo& {{cpp_class}}::s_wrapperTypeInfo = {{v8_class}}::wrapperT ypeInfo; 36 const WrapperTypeInfo& {{cpp_class}}::s_wrapperTypeInfo = {{v8_class}}::wrapperT ypeInfo;
37 {% endif %} 37 {% endif %}
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 {{method_implemented_in_private_script(method)}} 402 {{method_implemented_in_private_script(method)}}
403 {% endfor %} 403 {% endfor %}
404 {% for attribute in attributes if attribute.is_implemented_in_private_script %} 404 {% for attribute in attributes if attribute.is_implemented_in_private_script %}
405 {{attribute_getter_implemented_in_private_script(attribute)}} 405 {{attribute_getter_implemented_in_private_script(attribute)}}
406 {% if attribute.has_setter %} 406 {% if attribute.has_setter %}
407 {{attribute_setter_implemented_in_private_script(attribute)}} 407 {{attribute_setter_implemented_in_private_script(attribute)}}
408 {% endif %} 408 {% endif %}
409 {% endfor %} 409 {% endfor %}
410 {% block partial_interface %}{% endblock %} 410 {% block partial_interface %}{% endblock %}
411 } // namespace blink 411 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698