OLD | NEW |
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 |
| 10 if requires_finalizer else '0' %} |
9 {% set visit_dom_wrapper = '%s::visitDOMWrapper' % v8_class | 11 {% set visit_dom_wrapper = '%s::visitDOMWrapper' % v8_class |
10 if has_visit_dom_wrapper else '0' %} | 12 if has_visit_dom_wrapper else '0' %} |
11 {% set parent_wrapper_type_info = '&V8%s::wrapperTypeInfo' % parent_interface | 13 {% set parent_wrapper_type_info = '&V8%s::wrapperTypeInfo' % parent_interface |
12 if parent_interface else '0' %} | 14 if parent_interface else '0' %} |
13 {% set wrapper_type_prototype = 'WrapperTypeExceptionPrototype' if is_exception
else | 15 {% set wrapper_type_prototype = 'WrapperTypeExceptionPrototype' if is_exception
else |
14 'WrapperTypeObjectPrototype' %} | 16 'WrapperTypeObjectPrototype' %} |
15 {% 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' %} |
16 | 18 |
17 {% set wrapper_type_info_const = '' if has_partial_interface else 'const ' %} | 19 {% set wrapper_type_info_const = '' if has_partial_interface else 'const ' %} |
18 {% if not is_partial %} | 20 {% if not is_partial %} |
19 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv
ial | 21 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv
ial |
20 // and does not depend on another global objects. | 22 // and does not depend on another global objects. |
21 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 23 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
22 #pragma clang diagnostic push | 24 #pragma clang diagnostic push |
23 #pragma clang diagnostic ignored "-Wglobal-constructors" | 25 #pragma clang diagnostic ignored "-Wglobal-constructors" |
24 #endif | 26 #endif |
25 {{wrapper_type_info_const}}WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin
::kEmbedderBlink, {{dom_template}}, {{v8_class}}::refObject, {{v8_class}}::deref
Object, {{v8_class}}::trace, {{visit_dom_wrapper}}, {{v8_class}}::preparePrototy
peAndInterfaceObject, {{v8_class}}::installConditionallyEnabledProperties, "{{in
terface_name}}", {{parent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_p
rototype}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{event_targ
et_inheritance}}, WrapperTypeInfo::{{lifetime}}, WrapperTypeInfo::{{gc_type}} }; | 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}} }; |
26 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 28 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
27 #pragma clang diagnostic pop | 29 #pragma clang diagnostic pop |
28 #endif | 30 #endif |
29 | 31 |
30 // 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. |
31 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | 33 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
32 // bindings/core/v8/ScriptWrappable.h. | 34 // bindings/core/v8/ScriptWrappable.h. |
33 {% if not is_typed_array_type %} | 35 {% if not is_typed_array_type %} |
34 const WrapperTypeInfo& {{cpp_class}}::s_wrapperTypeInfo = {{v8_class}}::wrapperT
ypeInfo; | 36 const WrapperTypeInfo& {{cpp_class}}::s_wrapperTypeInfo = {{v8_class}}::wrapperT
ypeInfo; |
35 {% endif %} | 37 {% endif %} |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 {##############################################################################} | 390 {##############################################################################} |
389 {% block get_dom_template %}{% endblock %} | 391 {% block get_dom_template %}{% endblock %} |
390 {% block get_dom_template_for_named_properties_object %}{% endblock %} | 392 {% block get_dom_template_for_named_properties_object %}{% endblock %} |
391 {% block has_instance %}{% endblock %} | 393 {% block has_instance %}{% endblock %} |
392 {% block to_impl %}{% endblock %} | 394 {% block to_impl %}{% endblock %} |
393 {% block to_impl_with_type_check %}{% endblock %} | 395 {% block to_impl_with_type_check %}{% endblock %} |
394 {% block install_conditional_attributes %}{% endblock %} | 396 {% block install_conditional_attributes %}{% endblock %} |
395 {##############################################################################} | 397 {##############################################################################} |
396 {% block prepare_prototype_and_interface_object %}{% endblock %} | 398 {% block prepare_prototype_and_interface_object %}{% endblock %} |
397 {##############################################################################} | 399 {##############################################################################} |
| 400 {% block to_active_scriptwrappable %}{% endblock %} |
398 {% block ref_object_and_deref_object %}{% endblock %} | 401 {% block ref_object_and_deref_object %}{% endblock %} |
399 {% for method in methods if method.is_implemented_in_private_script and method.v
isible %} | 402 {% for method in methods if method.is_implemented_in_private_script and method.v
isible %} |
400 {{method_implemented_in_private_script(method)}} | 403 {{method_implemented_in_private_script(method)}} |
401 {% endfor %} | 404 {% endfor %} |
402 {% for attribute in attributes if attribute.is_implemented_in_private_script %} | 405 {% for attribute in attributes if attribute.is_implemented_in_private_script %} |
403 {{attribute_getter_implemented_in_private_script(attribute)}} | 406 {{attribute_getter_implemented_in_private_script(attribute)}} |
404 {% if attribute.has_setter %} | 407 {% if attribute.has_setter %} |
405 {{attribute_setter_implemented_in_private_script(attribute)}} | 408 {{attribute_setter_implemented_in_private_script(attribute)}} |
406 {% endif %} | 409 {% endif %} |
407 {% endfor %} | 410 {% endfor %} |
408 {% block partial_interface %}{% endblock %} | 411 {% block partial_interface %}{% endblock %} |
409 } // namespace blink | 412 } // namespace blink |
OLD | NEW |