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 "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, {{v8_class}}::domTemplate, {{v8_class}}::refObject, {{v8_class}}::derefObject, {{v8_class}}::createPersistentHandle, {{to_active_dom_object}}, {{to_event_target}}, {{visit_dom_wrapper}}, {{v8_class}}::installConditionallyEnabledMethods, {{v8_class}}::installConditionallyEnabledProperties, {{parent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_prototype}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{lifetime}}, WrapperTypeInfo::{{gc_type}} }; 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}}::wrapperTypeInfo; 34 35 {% endif %} 36 namespace {{cpp_class}}V8Internal { 37 38 template <typename T> void V8_USE(T) { } 39 40 {# Constants #} 41 {% from 'constants.cpp' import constant_getter_callback 42 with context %} 43 {% for constant in special_getter_constants %} 44 {{constant_getter_callback(constant)}} 45 {% endfor %} 46 {# Attributes #} 47 {% from 'attributes.cpp' import constructor_getter_callback, 48 attribute_getter, attribute_getter_callback, 49 attribute_setter, attribute_setter_callback, 50 attribute_getter_implemented_in_private_script, 51 attribute_setter_implemented_in_private_script 52 with context %} 53 {% for attribute in attributes if not attribute.constructor_type %} 54 {% if attribute.should_be_exposed_to_script %} 55 {% for world_suffix in attribute.world_suffixes %} 56 {% if not attribute.has_custom_getter %} 57 {{attribute_getter(attribute, world_suffix)}} 58 {% endif %} 59 {{attribute_getter_callback(attribute, world_suffix)}} 60 {% if not attribute.is_read_only or attribute.put_forwards %} 61 {% if not attribute.has_custom_setter %} 62 {{attribute_setter(attribute, world_suffix)}} 63 {% endif %} 64 {{attribute_setter_callback(attribute, world_suffix)}} 65 {% endif %} 66 {% endfor %} 67 {% endif %} 68 {% endfor %} 69 {% block constructor_getter %}{% endblock %} 70 {% for attribute in attributes if attribute.needs_constructor_getter_callback %} 71 {% for world_suffix in attribute.world_suffixes %} 72 {{constructor_getter_callback(attribute, world_suffix)}} 73 {% endfor %} 74 {% endfor %} 75 {% block replaceable_attribute_setter_and_callback %}{% endblock %} 76 {% block security_check_functions %}{% endblock %} 77 {# Methods #} 78 {% from 'methods.cpp' import generate_method, overload_resolution_method, 79 method_callback, origin_safe_method_getter, generate_constructor, 80 method_implemented_in_private_script 81 with context %} 82 {% for method in methods %} 83 {% if method.should_be_exposed_to_script %} 84 {% for world_suffix in method.world_suffixes %} 85 {% if not method.is_custom %} 86 {{generate_method(method, world_suffix)}} 87 {% endif %} 88 {% if method.overloads %} 89 {{overload_resolution_method(method.overloads, world_suffix)}} 90 {% endif %} 91 {% if not method.overload_index or method.overloads %} 92 {# A single callback is generated for overloaded methods #} 93 {{method_callback(method, world_suffix)}} 94 {% endif %} 95 {% if method.is_do_not_check_security %} 96 {{origin_safe_method_getter(method, world_suffix)}} 97 {% endif %} 98 {% endfor %} 99 {% endif %} 100 {% endfor %} 101 {% if iterator_method %} 102 {{generate_method(iterator_method)}} 103 {{method_callback(iterator_method)}} 104 {% endif %} 105 {% block origin_safe_method_setter %}{% endblock %} 106 {# Constructors #} 107 {% for constructor in constructors %} 108 {{generate_constructor(constructor)}} 109 {% endfor %} 110 {% block overloaded_constructor %}{% endblock %} 111 {% block event_constructor %}{% endblock %} 112 {# Special operations (methods) #} 113 {% block indexed_property_getter %}{% endblock %} 114 {% block indexed_property_getter_callback %}{% endblock %} 115 {% block indexed_property_setter %}{% endblock %} 116 {% block indexed_property_setter_callback %}{% endblock %} 117 {% block indexed_property_deleter %}{% endblock %} 118 {% block indexed_property_deleter_callback %}{% endblock %} 119 {% block named_property_getter %}{% endblock %} 120 {% block named_property_getter_callback %}{% endblock %} 121 {% block named_property_setter %}{% endblock %} 122 {% block named_property_setter_callback %}{% endblock %} 123 {% block named_property_query %}{% endblock %} 124 {% block named_property_query_callback %}{% endblock %} 125 {% block named_property_deleter %}{% endblock %} 126 {% block named_property_deleter_callback %}{% endblock %} 127 {% block named_property_enumerator %}{% endblock %} 128 {% block named_property_enumerator_callback %}{% endblock %} 129 } // namespace {{cpp_class}}V8Internal 130 131 {% block visit_dom_wrapper %}{% endblock %} 132 {% block shadow_attributes %}{% endblock %} 133 {% block install_attributes %}{% endblock %} 134 {% block install_accessors %}{% endblock %} 135 {% block install_methods %}{% endblock %} 136 {% block named_constructor %}{% endblock %} 137 {% block initialize_event %}{% endblock %} 138 {% block constructor_callback %}{% endblock %} 139 {% block configure_shadow_object_template %}{% endblock %} 140 {% block install_dom_template %}{% endblock %} 141 {% block get_dom_template %}{% endblock %} 142 {% block has_instance %}{% endblock %} 143 {% block to_native_with_type_check %}{% endblock %} 144 {% block install_conditional_attributes %}{% endblock %} 145 {% block install_conditional_methods %}{% endblock %} 146 {% block to_active_dom_object %}{% endblock %} 147 {% block to_event_target %}{% endblock %} 148 {% block get_shadow_object_template %}{% endblock %} 149 {% block wrap %}{% endblock %} 150 {% block create_wrapper %}{% endblock %} 151 {% block deref_object_and_to_v8_no_inline %}{% endblock %} 152 {% for method in methods if method.is_implemented_in_private_script %} 153 {{method_implemented_in_private_script(method)}} 154 {% endfor %} 155 {% for attribute in attributes if attribute.is_implemented_in_private_script %} 156 {{attribute_getter_implemented_in_private_script(attribute)}} 157 {% if not attribute.is_read_only or attribute.put_forwards %} 158 {{attribute_setter_implemented_in_private_script(attribute)}} 159 {% endif %} 160 {% endfor %} 161 } // namespace blink 162 {% endfilter %} 163