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

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

Issue 1873323002: Have bindings layer assume and insist that all interface types are GCed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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}}::refObject, {{v8_class}}::deref Object, {{v8_class}}::trace, {{to_active_scriptwrappable}}, {{visit_dom_wrapper} }, {{v8_class}}::preparePrototypeAndInterfaceObject, {{v8_class}}::installCondit ionallyEnabledProperties, "{{interface_name}}", {{parent_wrapper_type_info}}, Wr apperTypeInfo::{{wrapper_type_prototype}}, WrapperTypeInfo::{{wrapper_class_id}} , WrapperTypeInfo::{{event_target_inheritance}}, WrapperTypeInfo::{{lifetime}}, WrapperTypeInfo::{{gc_type}} }; 27 {{wrapper_type_info_const}}WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin ::kEmbedderBlink, {{dom_template}}, {{v8_class}}::trace, {{to_active_scriptwrapp able}}, {{visit_dom_wrapper}}, {{v8_class}}::preparePrototypeAndInterfaceObject, {{v8_class}}::installConditionallyEnabledProperties, "{{interface_name}}", {{pa rent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_prototype}}, WrapperTy peInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{event_target_inheritance}}, Wra pperTypeInfo::{{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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 {% block get_dom_template %}{% endblock %} 390 {% block get_dom_template %}{% endblock %}
391 {% block get_dom_template_for_named_properties_object %}{% endblock %} 391 {% block get_dom_template_for_named_properties_object %}{% endblock %}
392 {% block has_instance %}{% endblock %} 392 {% block has_instance %}{% endblock %}
393 {% block to_impl %}{% endblock %} 393 {% block to_impl %}{% endblock %}
394 {% block to_impl_with_type_check %}{% endblock %} 394 {% block to_impl_with_type_check %}{% endblock %}
395 {% block install_conditional_attributes %}{% endblock %} 395 {% block install_conditional_attributes %}{% endblock %}
396 {##############################################################################} 396 {##############################################################################}
397 {% block prepare_prototype_and_interface_object %}{% endblock %} 397 {% block prepare_prototype_and_interface_object %}{% endblock %}
398 {##############################################################################} 398 {##############################################################################}
399 {% block to_active_scriptwrappable %}{% endblock %} 399 {% block to_active_scriptwrappable %}{% endblock %}
400 {% block ref_object_and_deref_object %}{% endblock %}
401 {% for method in methods if method.is_implemented_in_private_script and method.v isible %} 400 {% for method in methods if method.is_implemented_in_private_script and method.v isible %}
402 {{method_implemented_in_private_script(method)}} 401 {{method_implemented_in_private_script(method)}}
403 {% endfor %} 402 {% endfor %}
404 {% for attribute in attributes if attribute.is_implemented_in_private_script %} 403 {% for attribute in attributes if attribute.is_implemented_in_private_script %}
405 {{attribute_getter_implemented_in_private_script(attribute)}} 404 {{attribute_getter_implemented_in_private_script(attribute)}}
406 {% if attribute.has_setter %} 405 {% if attribute.has_setter %}
407 {{attribute_setter_implemented_in_private_script(attribute)}} 406 {{attribute_setter_implemented_in_private_script(attribute)}}
408 {% endif %} 407 {% endif %}
409 {% endfor %} 408 {% endfor %}
410 {% block partial_interface %}{% endblock %} 409 {% block partial_interface %}{% endblock %}
411 } // namespace blink 410 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/templates/interface.cpp ('k') | third_party/WebKit/Source/bindings/templates/methods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698