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

Side by Side Diff: third_party/WebKit/Source/build/scripts/templates/ExperimentalFeatures.cpp.tmpl

Issue 1541983003: Force all experiment enabled checks to use ExperimentalFeatures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 {% from 'macros.tmpl' import license %} 1 {% from 'macros.tmpl' import license %}
2 {{license()}} 2 {{license()}}
3 3
4 #include "core/experiments/ExperimentalFeatures.h" 4 #include "core/experiments/ExperimentalFeatures.h"
5 5
6 #include "core/experiments/Experiments.h" 6 #include "core/experiments/Experiments.h"
7 #include "platform/RuntimeEnabledFeatures.h" 7 #include "platform/RuntimeEnabledFeatures.h"
8 8
9 namespace blink { 9 namespace blink {
10 {% for feature in features %} 10 {% for feature in features %}
11 {% if feature.api_name %} 11 {% if feature.api_name %}
12 12
13 // static 13 // static
14 bool ExperimentalFeatures::{{feature.first_lowered_name}}Enabled(ExecutionContex t* executionContext, String& errorMessage) { 14 bool ExperimentalFeatures::{{feature.first_lowered_name}}Enabled(ExecutionContex t* executionContext, String& errorMessage) {
15 if (RuntimeEnabledFeatures::{{feature.first_lowered_name}}Enabled()) 15 return {{feature.first_lowered_name}}EnabledImpl(executionContext, &errorMes sage);
16 return true; 16 }
17 return Experiments::isApiEnabled(executionContext, "{{feature.api_name}}", e rrorMessage); 17
18 // static
19 bool ExperimentalFeatures::{{feature.first_lowered_name}}Enabled(ExecutionContex t* executionContext) {
20 return {{feature.first_lowered_name}}EnabledImpl(executionContext, nullptr);
18 } 21 }
19 {% endif %} 22 {% endif %}
20 {% endfor %} 23 {% endfor %}
24
25 {% for feature in features %}
26 {% if feature.api_name %}
27
28 // static
29 bool ExperimentalFeatures::{{feature.first_lowered_name}}EnabledImpl(ExecutionCo ntext* executionContext, String* errorMessage) {
30 if (RuntimeEnabledFeatures::{{feature.first_lowered_name}}Enabled())
31 return true;
32 if (errorMessage) {
iclelland 2015/12/23 03:56:12 See the comment in Experiments.cpp -- it seems wro
chasej 2015/12/23 15:58:24 Yes, I agree it would be better to call directly i
33 return Experiments::isApiEnabled(executionContext, "{{feature.api_name}} ", *errorMessage);
34 }
35 return Experiments::isApiEnabled(executionContext, "{{feature.api_name}}");
36 }
37 {% endif %}
38 {% endfor %}
21 39
22 } // namespace blink 40 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698