Index: third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl |
diff --git a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl |
index ce55c9feceb0423b68e06eaeba23bb5742f9b625..4b33269366264e69ac2f8c8508bf0f52f6f1137a 100644 |
--- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl |
+++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl |
@@ -533,16 +533,15 @@ static void install{{v8_class}}Template(v8::Isolate* isolate, const DOMWrapperWo |
{% from 'attributes.cpp.tmpl' import attribute_configuration with context %} |
{% from 'constants.cpp.tmpl' import constant_configuration with context %} |
{% from 'methods.cpp.tmpl' import method_configuration with context %} |
-{% for origin_trial_feature in origin_trial_features %} |
-void {{v8_class_or_partial}}::install{{origin_trial_feature.name}}(v8::Isolate* isolate, const DOMWrapperWorld& world, v8::Local<v8::Object> instance, v8::Local<v8::Object> prototype, v8::Local<v8::Function> interface) { |
- {% if attributes | for_origin_trial_feature(origin_trial_feature.name) or |
- methods | method_for_origin_trial_feature(origin_trial_feature.name, is_partial) %} |
+{% for feature in origin_trial_features %} |
+void {{v8_class_or_partial}}::install{{feature.name}}(v8::Isolate* isolate, const DOMWrapperWorld& world, v8::Local<v8::Object> instance, v8::Local<v8::Object> prototype, v8::Local<v8::Function> interface) { |
+ {% if feature.attributes or feature.methods | sort %} |
Yuki
2016/12/14 05:35:04
Why do we need "| sort"?
peria
2016/12/14 06:05:30
Not needed. Removed.
|
v8::Local<v8::FunctionTemplate> interfaceTemplate = {{v8_class}}::wrapperTypeInfo.domTemplate(isolate, world); |
v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate); |
ALLOW_UNUSED_LOCAL(signature); |
{% endif %} |
{# Origin-Trial-enabled attributes #} |
- {% for attribute in attributes | for_origin_trial_feature(origin_trial_feature.name) | unique_by('name') | sort %} |
+ {% for attribute in feature.attributes | sort %} |
{% if attribute.is_data_type_property %} |
const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.name}}Configuration = {{attribute_configuration(attribute)}}; |
V8DOMConfiguration::installAttribute(isolate, world, instance, prototype, attribute{{attribute.name}}Configuration); |
@@ -552,34 +551,34 @@ void {{v8_class_or_partial}}::install{{origin_trial_feature.name}}(v8::Isolate* |
{% endif %} |
{% endfor %} |
{# Origin-Trial-enabled constants #} |
- {% for constant in constants | for_origin_trial_feature(origin_trial_feature.name) | unique_by('name') | sort %} |
+ {% for constant in feature.constants | sort %} |
{% set constant_name = constant.name.title().replace('_', '') %} |
const V8DOMConfiguration::ConstantConfiguration constant{{constant_name}}Configuration = {{constant_configuration(constant)}}; |
V8DOMConfiguration::installConstant(isolate, interface, prototype, constant{{constant_name}}Configuration); |
{% endfor %} |
{# Origin-Trial-enabled methods (no overloads) #} |
- {% for method in methods | method_for_origin_trial_feature(origin_trial_feature.name, is_partial) | unique_by('name') | sort %} |
+ {% for method in feature.methods | sort %} |
{% set method_name = method.name.title().replace('_', '') %} |
const V8DOMConfiguration::MethodConfiguration method{{method_name}}Configuration = {{method_configuration(method)}}; |
V8DOMConfiguration::installMethod(isolate, world, instance, prototype, interface, signature, method{{method_name}}Configuration); |
{% endfor %} |
} |
-void {{v8_class_or_partial}}::install{{origin_trial_feature.name}}(ScriptState* scriptState, v8::Local<v8::Object> instance) { |
+void {{v8_class_or_partial}}::install{{feature.name}}(ScriptState* scriptState, v8::Local<v8::Object> instance) { |
V8PerContextData* perContextData = V8PerContextData::from(scriptState->context()); |
v8::Local<v8::Object> prototype = perContextData->prototypeForType(&{{v8_class}}::wrapperTypeInfo); |
v8::Local<v8::Function> interface = perContextData->constructorForType(&{{v8_class}}::wrapperTypeInfo); |
ALLOW_UNUSED_LOCAL(interface); |
- install{{origin_trial_feature.name}}(scriptState->isolate(), scriptState->world(), instance, prototype, interface); |
+ install{{feature.name}}(scriptState->isolate(), scriptState->world(), instance, prototype, interface); |
} |
-{% if not origin_trial_feature.needs_instance %} |
+{% if not feature.needs_instance %} |
-void {{v8_class_or_partial}}::install{{origin_trial_feature.name}}(ScriptState* scriptState) { |
- install{{origin_trial_feature.name}}(scriptState, v8::Local<v8::Object>()); |
+void {{v8_class_or_partial}}::install{{feature.name}}(ScriptState* scriptState) { |
+ install{{feature.name}}(scriptState, v8::Local<v8::Object>()); |
} |
{% endif %} |
-{% endfor %} |
+{% endfor %}{# feature #} |
{% endblock %} |
{##############################################################################} |
{% block get_dom_template %}{% endblock %} |