Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(702)

Unified Diff: third_party/WebKit/Source/bindings/templates/constants.cpp

Issue 1531443003: [bindings] Implement an ExperimentEnabled IDL extended attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Install interfaces/attributes/methods unconditionally. Use the generated ExperimentalFeature functi… Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/templates/constants.cpp
diff --git a/third_party/WebKit/Source/bindings/templates/constants.cpp b/third_party/WebKit/Source/bindings/templates/constants.cpp
index bac23ca38f6fa129543b54c134c7c6d3b8336fa0..a7c4b7c65557502c131e4fb8e392795701dcd543 100644
--- a/third_party/WebKit/Source/bindings/templates/constants.cpp
+++ b/third_party/WebKit/Source/bindings/templates/constants.cpp
@@ -1,3 +1,5 @@
+{% from 'api_experiment.cpp' import check_api_experiment %}
+
{##############################################################################}
{% macro constant_getter_callback(constant) %}
{% filter conditional(constant.conditional_string) %}
@@ -10,6 +12,9 @@ static void {{constant.name}}ConstantGetterCallback(v8::Local<v8::Name>, const v
{% if constant.measure_as %}
UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()), UseCounter::{{constant.measure_as('ConstantGetter')}});
{% endif %}
+ {% filter trim %}
+ {{check_api_experiment(constant) | indent}}
+ {% endfilter %}
{% if constant.idl_type in ('Double', 'Float') %}
v8SetReturnValue(info, {{constant.value}});
{% elif constant.idl_type == 'String' %}
@@ -44,7 +49,7 @@ V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate
{% endfor %}
{% endfilter %}
{% endfor %}
-{# Constants with [DeprecateAs] or [MeasureAs] #}
+{# Constants with [DeprecateAs] or [MeasureAs] or [APIExperimentEnabled] #}
{% for constant in special_getter_constants %}
V8DOMConfiguration::installConstantWithGetter(isolate, functionTemplate, prototypeTemplate, "{{constant.name}}", {{cpp_class}}V8Internal::{{constant.name}}ConstantGetterCallback);
{% endfor %}

Powered by Google App Engine
This is Rietveld 408576698