Chromium Code Reviews| 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 7e559ae43d0eb6d0757b276e027fb41cf0a6ff5f..25e85241bf65d7aa0860bb1c68a900212058c7cd 100644 |
| --- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp |
| +++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp |
| @@ -365,13 +365,13 @@ static void install{{v8_class}}Template(v8::Isolate* isolate, const DOMWrapperWo |
| {##############################################################################} |
| {% block origin_trials %} |
| {% from 'attributes.cpp' import attribute_configuration with context %} |
| -{% for group in attributes|origin_trial_enabled_attributes|groupby('origin_trial_feature_name') %}{{newline}} |
| -void {{v8_class_or_partial}}::install{{group.grouper}}(ScriptState* scriptState, v8::Local<v8::Object> instance) |
| +{% from 'constants.cpp' import constant_configuration with context %} |
| +{% for origin_trial_feature_name in origin_trial_feature_names %}{{newline}} |
| +void {{v8_class_or_partial}}::install{{origin_trial_feature_name}}(ScriptState* scriptState, v8::Local<v8::Object> instance) |
| { |
| v8::Local<v8::Object> prototype = instance->GetPrototype()->ToObject(scriptState->isolate()); |
| - v8::Local<v8::Signature> signature; |
| - ALLOW_UNUSED_LOCAL(signature); |
| - {% for attribute in group.list | unique_by('name') | sort %} |
| + {# Origin-Trial-enabled attributes #} |
| + {% for attribute in attributes | for_origin_trial_feature(origin_trial_feature_name) | unique_by('name') | sort %} |
| {% if attribute.is_data_type_property %} |
| const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.name}}Configuration = \ |
| {{attribute_configuration(attribute)}}; |
| @@ -379,9 +379,18 @@ void {{v8_class_or_partial}}::install{{group.grouper}}(ScriptState* scriptState, |
| {% else %} |
| const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.name}}Configuration = \ |
| {{attribute_configuration(attribute)}}; |
| + v8::Local<v8::FunctionTemplate> interfaceTemplate = {{v8_class}}::wrapperTypeInfo.domTemplate(scriptState->isolate(), scriptState->world()); |
|
Yuki
2016/06/16 08:01:08
I'm very sorry, I should have recommended the foll
iclelland
2016/06/16 22:55:37
I'm happy to switch it to this way. Thanks, Yuki!
|
| + v8::Local<v8::Signature> signature = v8::Signature::New(scriptState->isolate(), interfaceTemplate); |
| V8DOMConfiguration::installAccessor(scriptState->isolate(), scriptState->world(), instance, prototype, v8::Local<v8::Function>(), signature, accessor{{attribute.name}}Configuration); |
| {% endif %} |
| {% endfor %} |
| + |
| + {# Origin-Trial-enabled constants #} |
| + {% for constant in constants | for_origin_trial_feature(origin_trial_feature_name) | unique_by('name') | sort %} |
| + {% set constant_name = constant.name.title().replace('_', '') %} |
| + const V8DOMConfiguration::ConstantConfiguration constant{{constant_name}}Configuration = {{constant_configuration(constant)}}; |
| + V8DOMConfiguration::installConstant(scriptState->isolate(), prototype, constant{{constant_name}}Configuration, &{{v8_class}}::wrapperTypeInfo); |
| + {% endfor %} |
| } |
| {% endfor %} |
| {% endblock %} |