| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // This file has been auto-generated by {{code_generator}}. DO NOT MODIFY! | |
| 6 | |
| 7 #include "sky/engine/config.h" | |
| 8 {% filter conditional(conditional_string) %} | |
| 9 #include "{{v8_class}}.h" | |
| 10 | |
| 11 {% for filename in cpp_includes if filename != '%s.h' % v8_class %} | |
| 12 #include "{{filename}}" | |
| 13 {% endfor %} | |
| 14 | |
| 15 namespace blink { | |
| 16 {% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class | |
| 17 if is_active_dom_object else '0' %} | |
| 18 {% set to_event_target = '%s::toEventTarget' % v8_class | |
| 19 if is_event_target else '0' %} | |
| 20 {% set visit_dom_wrapper = '%s::visitDOMWrapper' % v8_class | |
| 21 if has_visit_dom_wrapper else '0' %} | |
| 22 {% set parent_wrapper_type_info = '&V8%s::wrapperTypeInfo' % parent_interface | |
| 23 if parent_interface else '0' %} | |
| 24 {% set wrapper_type_prototype = 'WrapperTypeExceptionPrototype' if is_exception
else | |
| 25 'WrapperTypeObjectPrototype' %} | |
| 26 | |
| 27 const WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin::kEmbedderBlink, {{v
8_class}}::domTemplate, {{v8_class}}::refObject, {{v8_class}}::derefObject, {{to
_active_dom_object}}, {{to_event_target}}, {{visit_dom_wrapper}}, {{v8_class}}::
installConditionallyEnabledMethods, {{v8_class}}::installConditionallyEnabledPro
perties, {{parent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_prototype
}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{lifetime}} }; | |
| 28 | |
| 29 {% if is_script_wrappable %} | |
| 30 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in {{cpp_class}
}.h. | |
| 31 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in | |
| 32 // bindings/core/v8/ScriptWrappable.h. | |
| 33 const WrapperTypeInfo& {{cpp_class}}::s_wrapperTypeInfo = {{v8_class}}::wrapperT
ypeInfo; | |
| 34 | |
| 35 {% endif %} | |
| 36 namespace {{cpp_class}}V8Internal { | |
| 37 | |
| 38 template <typename T> void V8_USE(T) { } | |
| 39 | |
| 40 {# Attributes #} | |
| 41 {% from 'attributes.cpp' import constructor_getter_callback, | |
| 42 attribute_getter, attribute_getter_callback, | |
| 43 attribute_setter, attribute_setter_callback, | |
| 44 attribute_getter_implemented_in_private_script, | |
| 45 attribute_setter_implemented_in_private_script | |
| 46 with context %} | |
| 47 {% for attribute in attributes if not attribute.constructor_type %} | |
| 48 {% if attribute.should_be_exposed_to_script %} | |
| 49 {% for world_suffix in attribute.world_suffixes %} | |
| 50 {% if not attribute.has_custom_getter %} | |
| 51 {{attribute_getter(attribute, world_suffix)}} | |
| 52 {% endif %} | |
| 53 {{attribute_getter_callback(attribute, world_suffix)}} | |
| 54 {% if not attribute.is_read_only or attribute.put_forwards %} | |
| 55 {% if not attribute.has_custom_setter %} | |
| 56 {{attribute_setter(attribute, world_suffix)}} | |
| 57 {% endif %} | |
| 58 {{attribute_setter_callback(attribute, world_suffix)}} | |
| 59 {% endif %} | |
| 60 {% endfor %} | |
| 61 {% endif %} | |
| 62 {% endfor %} | |
| 63 {% block constructor_getter %}{% endblock %} | |
| 64 {% for attribute in attributes if attribute.needs_constructor_getter_callback %} | |
| 65 {% for world_suffix in attribute.world_suffixes %} | |
| 66 {{constructor_getter_callback(attribute, world_suffix)}} | |
| 67 {% endfor %} | |
| 68 {% endfor %} | |
| 69 {% block replaceable_attribute_setter_and_callback %}{% endblock %} | |
| 70 {% block security_check_functions %}{% endblock %} | |
| 71 {# Methods #} | |
| 72 {% from 'methods.cpp' import generate_method, overload_resolution_method, | |
| 73 method_callback, origin_safe_method_getter, generate_constructor, | |
| 74 method_implemented_in_private_script | |
| 75 with context %} | |
| 76 {% for method in methods %} | |
| 77 {% if method.should_be_exposed_to_script %} | |
| 78 {% for world_suffix in method.world_suffixes %} | |
| 79 {% if not method.is_custom %} | |
| 80 {{generate_method(method, world_suffix)}} | |
| 81 {% endif %} | |
| 82 {% if method.overloads %} | |
| 83 {{overload_resolution_method(method.overloads, world_suffix)}} | |
| 84 {% endif %} | |
| 85 {% if not method.overload_index or method.overloads %} | |
| 86 {# A single callback is generated for overloaded methods #} | |
| 87 {{method_callback(method, world_suffix)}} | |
| 88 {% endif %} | |
| 89 {% if method.is_do_not_check_security %} | |
| 90 {{origin_safe_method_getter(method, world_suffix)}} | |
| 91 {% endif %} | |
| 92 {% endfor %} | |
| 93 {% endif %} | |
| 94 {% endfor %} | |
| 95 {% if iterator_method %} | |
| 96 {{generate_method(iterator_method)}} | |
| 97 {{method_callback(iterator_method)}} | |
| 98 {% endif %} | |
| 99 {% block origin_safe_method_setter %}{% endblock %} | |
| 100 {# Constructors #} | |
| 101 {% for constructor in constructors %} | |
| 102 {{generate_constructor(constructor)}} | |
| 103 {% endfor %} | |
| 104 {% block overloaded_constructor %}{% endblock %} | |
| 105 {% block event_constructor %}{% endblock %} | |
| 106 {# Special operations (methods) #} | |
| 107 {% block indexed_property_getter %}{% endblock %} | |
| 108 {% block indexed_property_getter_callback %}{% endblock %} | |
| 109 {% block indexed_property_setter %}{% endblock %} | |
| 110 {% block indexed_property_setter_callback %}{% endblock %} | |
| 111 {% block indexed_property_deleter %}{% endblock %} | |
| 112 {% block indexed_property_deleter_callback %}{% endblock %} | |
| 113 {% block named_property_getter %}{% endblock %} | |
| 114 {% block named_property_getter_callback %}{% endblock %} | |
| 115 {% block named_property_setter %}{% endblock %} | |
| 116 {% block named_property_setter_callback %}{% endblock %} | |
| 117 {% block named_property_query %}{% endblock %} | |
| 118 {% block named_property_query_callback %}{% endblock %} | |
| 119 {% block named_property_deleter %}{% endblock %} | |
| 120 {% block named_property_deleter_callback %}{% endblock %} | |
| 121 {% block named_property_enumerator %}{% endblock %} | |
| 122 {% block named_property_enumerator_callback %}{% endblock %} | |
| 123 } // namespace {{cpp_class}}V8Internal | |
| 124 | |
| 125 {% block visit_dom_wrapper %}{% endblock %} | |
| 126 {% block shadow_attributes %}{% endblock %} | |
| 127 {% block install_attributes %}{% endblock %} | |
| 128 {% block install_accessors %}{% endblock %} | |
| 129 {% block install_methods %}{% endblock %} | |
| 130 {% block named_constructor %}{% endblock %} | |
| 131 {% block initialize_event %}{% endblock %} | |
| 132 {% block constructor_callback %}{% endblock %} | |
| 133 {% block configure_shadow_object_template %}{% endblock %} | |
| 134 {% block install_dom_template %}{% endblock %} | |
| 135 {% block get_dom_template %}{% endblock %} | |
| 136 {% block has_instance %}{% endblock %} | |
| 137 {% block to_native_with_type_check %}{% endblock %} | |
| 138 {% block install_conditional_attributes %}{% endblock %} | |
| 139 {% block install_conditional_methods %}{% endblock %} | |
| 140 {% block to_active_dom_object %}{% endblock %} | |
| 141 {% block to_event_target %}{% endblock %} | |
| 142 {% block get_shadow_object_template %}{% endblock %} | |
| 143 {% block wrap %}{% endblock %} | |
| 144 {% block create_wrapper %}{% endblock %} | |
| 145 {% block deref_object_and_to_v8_no_inline %}{% endblock %} | |
| 146 {% for method in methods if method.is_implemented_in_private_script %} | |
| 147 {{method_implemented_in_private_script(method)}} | |
| 148 {% endfor %} | |
| 149 {% for attribute in attributes if attribute.is_implemented_in_private_script %} | |
| 150 {{attribute_getter_implemented_in_private_script(attribute)}} | |
| 151 {% if not attribute.is_read_only or attribute.put_forwards %} | |
| 152 {{attribute_setter_implemented_in_private_script(attribute)}} | |
| 153 {% endif %} | |
| 154 {% endfor %} | |
| 155 } // namespace blink | |
| 156 {% endfilter %} | |
| OLD | NEW |