Chromium Code Reviews| 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 {% if is_array_buffer_or_view %} | |
| 13 {% set context_access_check = '0' %} | |
|
jochen (gone - plz use gerrit)
2017/03/15 19:56:13
why this?
adithyas
2017/03/28 20:35:41
Array buffers/views don't call V8DOMWrapper::creat
| |
| 14 {% elif has_access_check_callbacks %} | |
| 15 {% set context_access_check = '&BindingSecurity::securityCheckForClassesWithAc cessCheckCallbacks' %} | |
| 16 {% else %} | |
| 17 {% set context_access_check = '&BindingSecurity::securityCheckForClassesWithou tAccessCheckCallbacks' %} | |
| 18 {% endif %} | |
| 12 {% set parent_wrapper_type_info = '&V8%s::wrapperTypeInfo' % parent_interface | 19 {% set parent_wrapper_type_info = '&V8%s::wrapperTypeInfo' % parent_interface |
| 13 if parent_interface else '0' %} | 20 if parent_interface else '0' %} |
| 14 {% set wrapper_type_prototype = 'WrapperTypeExceptionPrototype' if is_exception else | 21 {% set wrapper_type_prototype = 'WrapperTypeExceptionPrototype' if is_exception else |
| 15 'WrapperTypeObjectPrototype' %} | 22 'WrapperTypeObjectPrototype' %} |
| 16 {% set active_scriptwrappable_inheritance = | 23 {% set active_scriptwrappable_inheritance = |
| 17 'InheritFromActiveScriptWrappable' | 24 'InheritFromActiveScriptWrappable' |
| 18 if active_scriptwrappable else | 25 if active_scriptwrappable else |
| 19 'NotInheritFromActiveScriptWrappable' %} | 26 'NotInheritFromActiveScriptWrappable' %} |
| 20 | 27 |
| 21 {% set wrapper_type_info_const = '' if has_partial_interface else 'const ' %} | 28 {% set wrapper_type_info_const = '' if has_partial_interface else 'const ' %} |
| 22 {% if not is_partial %} | 29 {% if not is_partial %} |
| 23 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv ial | 30 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv ial |
| 24 // and does not depend on another global objects. | 31 // and does not depend on another global objects. |
| 25 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 32 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
| 26 #pragma clang diagnostic push | 33 #pragma clang diagnostic push |
| 27 #pragma clang diagnostic ignored "-Wglobal-constructors" | 34 #pragma clang diagnostic ignored "-Wglobal-constructors" |
| 28 #endif | 35 #endif |
| 29 {{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 or 'nullptr'}}, "{{interface _name}}", {{parent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_prototyp e}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{active_scriptwrap pable_inheritance}}, WrapperTypeInfo::{{lifetime}} }; | 36 {{wrapper_type_info_const}}WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin ::kEmbedderBlink, {{dom_template}}, {{context_access_check}}, {{v8_class}}::trac e, {{v8_class}}::traceWrappers, {{prepare_prototype_and_interface_object_func or 'nullptr'}}, "{{interface_name}}", {{parent_wrapper_type_info}}, WrapperTypeInf o::{{wrapper_type_prototype}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTyp eInfo::{{active_scriptwrappable_inheritance}}, WrapperTypeInfo::{{lifetime}} }; |
|
Yuki
2017/03/16 14:05:55
I'm afraid that this would increase the binary siz
adithyas
2017/03/28 20:35:41
I'm using a function pointer instead of just a bit
| |
| 30 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) | 37 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) |
| 31 #pragma clang diagnostic pop | 38 #pragma clang diagnostic pop |
| 32 #endif | 39 #endif |
| 33 | 40 |
| 34 {% if not is_typed_array_type %} | 41 {% if not is_typed_array_type %} |
| 35 // 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. |
| 36 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | 43 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in |
| 37 // bindings/core/v8/ScriptWrappable.h. | 44 // bindings/core/v8/ScriptWrappable.h. |
| 38 const WrapperTypeInfo& {{cpp_class}}::s_wrapperTypeInfo = {{v8_class}}::wrapperT ypeInfo; | 45 const WrapperTypeInfo& {{cpp_class}}::s_wrapperTypeInfo = {{v8_class}}::wrapperT ypeInfo; |
| 39 {% endif %} | 46 {% endif %} |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 738 {% endif %} | 745 {% endif %} |
| 739 } | 746 } |
| 740 {% endif %} | 747 {% endif %} |
| 741 | 748 |
| 742 {% endblock %} | 749 {% endblock %} |
| 743 {##############################################################################} | 750 {##############################################################################} |
| 744 {% block partial_interface %}{% endblock %} | 751 {% block partial_interface %}{% endblock %} |
| 745 } // namespace blink | 752 } // namespace blink |
| 746 | 753 |
| 747 {% endfilter %}{# format_blink_cpp_source_code #} | 754 {% endfilter %}{# format_blink_cpp_source_code #} |
| OLD | NEW |