| 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 { |
| 11 {% set dom_template = '%s::domTemplate' % v8_class if not is_array_buffer_or_vie
w else '0' %} | 11 {% set dom_template = '%s::domTemplate' % v8_class if not is_array_buffer_or_vie
w else '0' %} |
| 12 {% set visit_dom_wrapper = '%s::visitDOMWrapper' % v8_class | |
| 13 if has_visit_dom_wrapper else '0' %} | |
| 14 {% set has_prepare_prototype_and_interface_object = | 12 {% set has_prepare_prototype_and_interface_object = |
| 15 unscopables or has_conditional_attributes_on_prototype or | 13 unscopables or has_conditional_attributes_on_prototype or |
| 16 methods | conditionally_exposed(is_partial) %} | 14 methods | conditionally_exposed(is_partial) %} |
| 17 {% set prepare_prototype_and_interface_object_func = | 15 {% set prepare_prototype_and_interface_object_func = |
| 18 '%s::preparePrototypeAndInterfaceObject' % v8_class | 16 '%s::preparePrototypeAndInterfaceObject' % v8_class |
| 19 if has_prepare_prototype_and_interface_object | 17 if has_prepare_prototype_and_interface_object |
| 20 else 'nullptr' %} | 18 else 'nullptr' %} |
| 21 {% set parent_wrapper_type_info = '&V8%s::wrapperTypeInfo' % parent_interface | 19 {% set parent_wrapper_type_info = '&V8%s::wrapperTypeInfo' % parent_interface |
| 22 if parent_interface else '0' %} | 20 if parent_interface else '0' %} |
| 23 {% set wrapper_type_prototype = 'WrapperTypeExceptionPrototype' if is_exception
else | 21 {% set wrapper_type_prototype = 'WrapperTypeExceptionPrototype' if is_exception
else |
| 24 'WrapperTypeObjectPrototype' %} | 22 'WrapperTypeObjectPrototype' %} |
| 25 {% set active_scriptwrappable_inheritance = | 23 {% set active_scriptwrappable_inheritance = |
| 26 'InheritFromActiveScriptWrappable' | 24 'InheritFromActiveScriptWrappable' |
| 27 if active_scriptwrappable else | 25 if active_scriptwrappable else |
| 28 'NotInheritFromActiveScriptWrappable' %} | 26 'NotInheritFromActiveScriptWrappable' %} |
| 29 | 27 |
| 30 {% set wrapper_type_info_const = '' if has_partial_interface else 'const ' %} | 28 {% set wrapper_type_info_const = '' if has_partial_interface else 'const ' %} |
| 31 {% if not is_partial %} | 29 {% if not is_partial %} |
| 32 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv
ial | 30 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv
ial |
| 33 // and does not depend on another global objects. | 31 // and does not depend on another global objects. |
| 34 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 32 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
| 35 #pragma clang diagnostic push | 33 #pragma clang diagnostic push |
| 36 #pragma clang diagnostic ignored "-Wglobal-constructors" | 34 #pragma clang diagnostic ignored "-Wglobal-constructors" |
| 37 #endif | 35 #endif |
| 38 {{wrapper_type_info_const}}WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin
::kEmbedderBlink, {{dom_template}}, {{v8_class}}::trace, {{v8_class}}::traceWrap
pers, {{visit_dom_wrapper}}, {{prepare_prototype_and_interface_object_func}}, "{
{interface_name}}", {{parent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_typ
e_prototype}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{active_
scriptwrappable_inheritance}}, WrapperTypeInfo::{{event_target_inheritance}}, Wr
apperTypeInfo::{{lifetime}} }; | 36 {{wrapper_type_info_const}}WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin
::kEmbedderBlink, {{dom_template}}, {{v8_class}}::trace, {{v8_class}}::traceWrap
pers, {{prepare_prototype_and_interface_object_func}}, "{{interface_name}}", {{p
arent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_prototype}}, WrapperT
ypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{active_scriptwrappable_inherit
ance}}, WrapperTypeInfo::{{event_target_inheritance}}, WrapperTypeInfo::{{lifeti
me}} }; |
| 39 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 37 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
| 40 #pragma clang diagnostic pop | 38 #pragma clang diagnostic pop |
| 41 #endif | 39 #endif |
| 42 | 40 |
| 43 {% if not is_typed_array_type %} | 41 {% if not is_typed_array_type %} |
| 44 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in {{cpp_class}
}.h. | 42 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in {{cpp_class}
}.h. |
| 45 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | 43 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
| 46 // bindings/core/v8/ScriptWrappable.h. | 44 // bindings/core/v8/ScriptWrappable.h. |
| 47 const WrapperTypeInfo& {{cpp_class}}::s_wrapperTypeInfo = {{v8_class}}::wrapperT
ypeInfo; | 45 const WrapperTypeInfo& {{cpp_class}}::s_wrapperTypeInfo = {{v8_class}}::wrapperT
ypeInfo; |
| 48 {% endif %} | 46 {% endif %} |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 {% block has_instance %}{% endblock %} | 694 {% block has_instance %}{% endblock %} |
| 697 {% block to_impl %}{% endblock %} | 695 {% block to_impl %}{% endblock %} |
| 698 {% block to_impl_with_type_check %}{% endblock %} | 696 {% block to_impl_with_type_check %}{% endblock %} |
| 699 {##############################################################################} | 697 {##############################################################################} |
| 700 {% block prepare_prototype_and_interface_object %}{% endblock %} | 698 {% block prepare_prototype_and_interface_object %}{% endblock %} |
| 701 {##############################################################################} | 699 {##############################################################################} |
| 702 {% block partial_interface %}{% endblock %} | 700 {% block partial_interface %}{% endblock %} |
| 703 } // namespace blink | 701 } // namespace blink |
| 704 | 702 |
| 705 {% endfilter %}{# format_blink_cpp_source_code #} | 703 {% endfilter %}{# format_blink_cpp_source_code #} |
| OLD | NEW |