| Index: third_party/WebKit/Source/bindings/templates/interface_base.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/templates/interface_base.cpp b/third_party/WebKit/Source/bindings/templates/interface_base.cpp
|
| index eff97964b0ce25a8bf059b030654c4f6d08937ed..2148f2ef133c53b82284d6748f82069d78001bff 100644
|
| --- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp
|
| +++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp
|
| @@ -244,58 +244,66 @@ static void install{{v8_class}}Template(v8::Local<v8::FunctionTemplate> interfac
|
| {% endif %}
|
| {
|
| {% set newline = '' %}
|
| - // Initialize the interface object's template.
|
| - {% if is_partial %}
|
| - {{v8_class}}::install{{v8_class}}Template(interfaceTemplate, isolate);
|
| - {% else %}
|
| {% set parent_interface_template =
|
| '%s::domTemplateForNamedPropertiesObject(isolate)' % v8_class
|
| if has_named_properties_object else
|
| 'V8%s::domTemplate(isolate)' % parent_interface
|
| if parent_interface else
|
| 'v8::Local<v8::FunctionTemplate>()' %}
|
| - V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, {{v8_class}}::wrapperTypeInfo.interfaceName, {{parent_interface_template}}, {{v8_class}}::internalFieldCount);
|
| - {% if constructors or has_custom_constructor or has_event_constructor %}
|
| - interfaceTemplate->SetCallHandler({{v8_class}}::constructorCallback);
|
| - interfaceTemplate->SetLength({{interface_length}});
|
| - {% endif %}
|
| - {% endif %}{# is_partial #}
|
| + {% set attribute_conf_array, attribute_conf_count =
|
| + ('%sAttributes' % v8_class, 'WTF_ARRAY_LENGTH(%sAttributes)' % v8_class)
|
| + if has_attribute_configuration else ('nullptr', 0) %}
|
| + {% set accessor_conf_array, accessor_conf_count =
|
| + ('%sAccessors' % v8_class, 'WTF_ARRAY_LENGTH(%sAccessors)' % v8_class)
|
| + if has_accessor_configuration else ('nullptr', 0) %}
|
| + {% set method_conf_array, method_conf_count =
|
| + ('%sMethods' % v8_class, 'WTF_ARRAY_LENGTH(%sMethods)' % v8_class)
|
| + if method_configuration_methods else ('nullptr', 0) %}
|
| + // Initialize the interface object's template.
|
| v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate);
|
| - ALLOW_UNUSED_LOCAL(signature);
|
| v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->InstanceTemplate();
|
| - ALLOW_UNUSED_LOCAL(instanceTemplate);
|
| v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->PrototypeTemplate();
|
| - ALLOW_UNUSED_LOCAL(prototypeTemplate);
|
| -
|
| - {%- if not is_partial %}
|
| - {% if interface_name == 'Window' %}{{newline}}
|
| - prototypeTemplate->SetInternalFieldCount(V8Window::internalFieldCount);
|
| - {% endif %}
|
| - {% if is_global %}{{newline}}
|
| - interfaceTemplate->SetHiddenPrototype(true);
|
| - {% endif %}
|
| - {% endif %}
|
| -
|
| - // Register DOM constants, attributes and operations.
|
| + {% if is_partial %}
|
| + {{v8_class}}::install{{v8_class}}Template(interfaceTemplate, isolate);
|
| {% if runtime_enabled_function %}
|
| if ({{runtime_enabled_function}}()) {
|
| {% endif %}
|
| {% filter indent(4 if runtime_enabled_function else 0, true) %}
|
| + V8DOMConfiguration::installProperties(isolate, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, {{attribute_conf_array}}, {{attribute_conf_count}}, {{accessor_conf_array}}, {{accessor_conf_count}}, {{method_conf_array}}, {{method_conf_count}});
|
| {% if constants %}
|
| {{install_constants() | indent}}
|
| {% endif %}
|
| - {% if has_attribute_configuration %}
|
| - V8DOMConfiguration::installAttributes(isolate, instanceTemplate, prototypeTemplate, {{'%sAttributes' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sAttributes)' % v8_class}});
|
| + {% endfilter %}{{newline}}
|
| + {% if runtime_enabled_function %}
|
| + }
|
| {% endif %}
|
| - {% if has_accessor_configuration %}
|
| - V8DOMConfiguration::installAccessors(isolate, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, {{'%sAccessors' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sAccessors)' % v8_class}});
|
| + {% elif runtime_enabled_function %}{# if is_partial #}
|
| + V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, {{v8_class}}::wrapperTypeInfo.interfaceName, {{parent_interface_template}}, instanceTemplate, prototypeTemplate, {{v8_class}}::internalFieldCount);
|
| + if ({{runtime_enabled_function}}()) {
|
| + {% if constants %}
|
| + {{install_constants() | indent}}
|
| + {% endif %}
|
| + V8DOMConfiguration::installProperties(isolate, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, {{attribute_conf_array}}, {{attribute_conf_count}}, {{accessor_conf_array}}, {{accessor_conf_count}}, {{method_conf_array}}, {{method_conf_count}});
|
| + }
|
| + {% else %}{# if is_partial #}
|
| + V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, {{v8_class}}::wrapperTypeInfo.interfaceName, {{parent_interface_template}}, instanceTemplate, prototypeTemplate, {{v8_class}}::internalFieldCount, signature, {{attribute_conf_array}}, {{attribute_conf_count}}, {{accessor_conf_array}}, {{accessor_conf_count}}, {{method_conf_array}}, {{method_conf_count}});
|
| + {% if constants %}
|
| + {{install_constants() | indent}}
|
| {% endif %}
|
| - {% if method_configuration_methods %}
|
| - V8DOMConfiguration::installMethods(isolate, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, {{'%sMethods' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sMethods)' % v8_class}});
|
| + {% endif %}{# is_partial #}
|
| +
|
| + {%- if not is_partial and (constructors or has_custom_constructor or has_event_constructor) %}{{newline}}
|
| + interfaceTemplate->SetCallHandler({{v8_class}}::constructorCallback);
|
| + interfaceTemplate->SetLength({{interface_length}});
|
| + {% endif %}
|
| +
|
| + {%- if not is_partial %}
|
| + {% if interface_name == 'Window' %}{{newline}}
|
| + prototypeTemplate->SetInternalFieldCount(V8Window::internalFieldCount);
|
| + {% endif %}
|
| + {% if is_global %}{{newline}}
|
| + interfaceTemplate->SetHiddenPrototype(true);
|
| {% endif %}
|
| - {% endfilter %}{{newline}}
|
| - {% if runtime_enabled_function %}
|
| - } // if ({{runtime_enabled_function}}())
|
| {% endif %}
|
|
|
| {%- if has_access_check_callbacks %}{{newline}}
|
|
|