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 22102d8796868d8ad8c07e5265562e0feb5022a6..b7c0b601af447556d656108112b01887c7525a89 100644 |
--- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp |
+++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp |
@@ -300,10 +300,20 @@ static void install{{v8_class}}Template(v8::Local<v8::FunctionTemplate> function |
{% if runtime_enabled_function %} |
if (!{{runtime_enabled_function}}()) |
defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "{{interface_name}}", {{parent_template}}, {{v8_class}}::internalFieldCount, 0, 0, 0, 0, 0, 0); |
- else |
+ else { |
{% endif %} |
{% set runtime_enabled_indent = 4 if runtime_enabled_function else 0 %} |
{% filter indent(runtime_enabled_indent, true) %} |
+ {% if api_experiment_name %} |
+ ExecutionContext* ec = currentExecutionContext(isolate); |
+ ALLOW_UNUSED_LOCAL(ec); |
+ if (!Experiments::isApiEnabledWithoutMessage(ec, "{{api_experiment_name}}")) { |
+ defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "{{interface_name}}", {{parent_template}}, {{v8_class}}::internalFieldCount, 0, 0, 0, 0, 0, 0); |
+ } |
+ else |
+ {% endif %} |
+ {% set api_experiment_enabled_indent = 4 if api_experiment_name else runtime_enabled_indent %} |
+ {% filter indent(api_experiment_enabled_indent, true) %} |
defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "{{interface_name}}", {{parent_template}}, {{v8_class}}::internalFieldCount, |
{# Test needed as size 0 arrays definitions are not allowed per standard |
(so objects have distinct addresses), which is enforced by MSVC. |
@@ -326,7 +336,12 @@ static void install{{v8_class}}Template(v8::Local<v8::FunctionTemplate> function |
{{attributes_name}}, {{attributes_length}}, |
{{accessors_name}}, {{accessors_length}}, |
{{methods_name}}, {{methods_length}}); |
- {% endfilter %} |
+ {% endfilter %}{# api_experiment_enabled_indent #} |
+ {% endfilter %}{# runtime_enabled_indent #} |
+ {% if runtime_enabled_function %} |
+ |
+ } |
+ {% endif %} |
{% if constructors or has_custom_constructor or has_event_constructor %} |
functionTemplate->SetCallHandler({{v8_class}}::constructorCallback); |
@@ -353,6 +368,7 @@ static void install{{v8_class}}Template(v8::Local<v8::FunctionTemplate> function |
{% endfilter %}{# runtime_enabled() #} |
{% endif %} |
{% set runtime_enabled_features = dict() %} |
+ {% set api_experiment_enabled_features = dict() %} |
{% for attribute in attributes |
if attribute.runtime_enabled_function and |
not attribute.exposed_test %} |
@@ -394,8 +410,10 @@ static void install{{v8_class}}Template(v8::Local<v8::FunctionTemplate> function |
{% if iterator_method %} |
{% filter exposed(iterator_method.exposed_test) %} |
{% filter runtime_enabled(iterator_method.runtime_enabled_function) %} |
+ {% filter api_experiment_enabled(iterator_method.api_experiment_name) %} |
const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIteratorConfiguration = { v8::Symbol::GetIterator, {{cpp_class_or_partial}}V8Internal::iteratorMethodCallback, 0, v8::DontDelete, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype }; |
V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSignature, symbolKeyedIteratorConfiguration); |
+ {% endfilter %}{# api_experiment_enabled() #} |
{% endfilter %}{# runtime_enabled() #} |
{% endfilter %}{# exposed() #} |
{% endif %} |
@@ -416,12 +434,16 @@ static void install{{v8_class}}Template(v8::Local<v8::FunctionTemplate> function |
{% filter runtime_enabled(method.overloads.runtime_enabled_function_all |
if method.overloads else |
method.runtime_enabled_function) %} |
+ {% filter api_experiment_enabled(method.overloads.api_experiment_name_all |
+ if method.overloads else |
+ method.api_experiment_name) %} |
{% if method.is_do_not_check_security %} |
{{install_do_not_check_security_method(method, '', 'instanceTemplate', 'prototypeTemplate') | indent}} |
{% else %}{# is_do_not_check_security #} |
{% set signature = 'v8::Local<v8::Signature>()' if method.is_do_not_check_signature else 'defaultSignature' %} |
{{install_custom_signature(method, 'instanceTemplate', 'prototypeTemplate', 'functionTemplate', signature) | indent}} |
{% endif %}{# is_do_not_check_security #} |
+ {% endfilter %}{# api_experiment_enabled() #} |
{% endfilter %}{# runtime_enabled() #} |
{% endfilter %}{# exposed() #} |
{% endfilter %}{# conditional() #} |