Chromium Code Reviews| 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 f57a236adea40be7d879a36661d1f522ec1c3918..b8fc57a66b78de4383022590774d5a3e0788871a 100644 |
| --- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl |
| +++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl |
| @@ -704,8 +704,13 @@ void {{v8_class_or_partial}}::install{{feature.name}}(v8::Isolate* isolate, cons |
| v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate); |
| ALLOW_UNUSED_LOCAL(signature); |
| {% endif %} |
| + {% if feature.needs_secure_context %} |
| + ExecutionContext* executionContext = ToExecutionContext(isolate->GetCurrentContext()); |
| + bool isSecureContext = (executionContext && executionContext->IsSecureContext()); |
| + {% endif %}{# needs secure context #} |
| {# Origin-Trial-enabled attributes #} |
| {% for attribute in feature.attributes %} |
| + {% filter secure_context_cached(attribute.secure_context_test) %} |
| {% if attribute.is_data_type_property %} |
| static const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.name}}Configuration[] = { |
| {{attribute_configuration(attribute) | indent(2)}} |
| @@ -719,6 +724,7 @@ void {{v8_class_or_partial}}::install{{feature.name}}(v8::Isolate* isolate, cons |
| for (const auto& accessorConfig : accessor{{attribute.name}}Configuration) |
| V8DOMConfiguration::InstallAccessor(isolate, world, instance, prototype, interface, signature, accessorConfig); |
| {% endif %} |
| + {% endfilter %}{# secure_context #} |
|
Yuki
2017/05/12 09:10:05
nit: secure_context_cached
chasej
2017/05/16 02:21:39
Removed secure_context_cached (as suggested above)
|
| {% endfor %} |
| {# Origin-Trial-enabled constants #} |
| {% for constant in feature.constants %} |
| @@ -728,12 +734,14 @@ void {{v8_class_or_partial}}::install{{feature.name}}(v8::Isolate* isolate, cons |
| {% endfor %} |
| {# Origin-Trial-enabled methods (no overloads) #} |
| {% for method in feature.methods %} |
| + {% filter secure_context_cached(method.secure_context_test) %} |
| {% set method_name = method.name.title().replace('_', '') %} |
| static const V8DOMConfiguration::MethodConfiguration method{{method_name}}Configuration[] = { |
| {{method_configuration(method) | indent(2)}} |
| }; |
| for (const auto& methodConfig : method{{method_name}}Configuration) |
| V8DOMConfiguration::InstallMethod(isolate, world, instance, prototype, interface, signature, methodConfig); |
| + {% endfilter %}{# secure_context #} |
|
Yuki
2017/05/12 09:10:05
nit: secure_context_cached
chasej
2017/05/16 02:21:39
Removed secure_context_cached (as suggested above)
|
| {% endfor %} |
| } |
| @@ -771,7 +779,7 @@ void {{v8_class_or_partial}}::preparePrototypeAndInterfaceObject(v8::Local<v8::C |
| {% endif %} |
| v8::Isolate* isolate = context->GetIsolate(); |
| - {% if has_conditional_attributes_on_prototype or methods | conditionally_exposed(is_partial) %} |
| + {% if has_conditional_attributes_on_prototype or has_conditional_methods %} |
| v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate); |
| ExecutionContext* executionContext = ToExecutionContext(context); |
| DCHECK(executionContext); |
| @@ -794,7 +802,7 @@ void {{v8_class_or_partial}}::preparePrototypeAndInterfaceObject(v8::Local<v8::C |
| {% if has_conditional_attributes_on_prototype %} |
| {{install_conditionally_enabled_attributes_on_prototype() | indent(2)}} |
| {% endif %} |
| -{% if methods | conditionally_exposed(is_partial) %} |
| +{% if has_conditional_methods %} |
| {{install_conditionally_enabled_methods() | indent(2)}} |
| {% endif %} |
| } |