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

Side by Side Diff: Source/build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl

Issue 890723004: Allow setting runtime-enabled features from a string. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/build/scripts/templates/RuntimeEnabledFeatures.h.tmpl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {% from 'macros.tmpl' import license %} 1 {% from 'macros.tmpl' import license %}
2 {{license()}} 2 {{license()}}
3 3
4 #include "config.h" 4 #include "config.h"
5 #include "platform/RuntimeEnabledFeatures.h" 5 #include "platform/RuntimeEnabledFeatures.h"
6 6
7 #include "wtf/Assertions.h"
8 #include "wtf/text/WTFString.h"
9
7 namespace blink { 10 namespace blink {
8 11
9 {% for feature_set in feature_sets %} 12 {% for feature_set in feature_sets %}
10 void RuntimeEnabledFeatures::set{{feature_set|capitalize}}FeaturesEnabled(bool e nable) 13 void RuntimeEnabledFeatures::set{{feature_set|capitalize}}FeaturesEnabled(bool e nable)
11 { 14 {
12 {% for feature in features if feature.status == feature_set %} 15 {% for feature in features if feature.status == feature_set %}
13 set{{feature.name}}Enabled(enable); 16 set{{feature.name}}Enabled(enable);
14 {% endfor %} 17 {% endfor %}
15 } 18 }
16 19
17 {% endfor %} 20 {% endfor %}
21
22 void RuntimeEnabledFeatures::setFeatureEnabledFromString(const String& name, boo l isEnabled)
23 {
24 {% for feature in features if not feature.custom %}
25 {% filter enable_conditional(feature.condition) %}
26 if (equalIgnoringCase(name, "{{feature.name}}")) {
27 set{{feature.name}}Enabled(isEnabled);
28 return;
29 }
30 {% endfilter %}
31 {% endfor %}
32 WTF_LOG_ERROR("RuntimeEnabledFeature not recognized: %s", name.ascii().data( ));
33 }
34
18 {% for feature in features if not feature.custom %} 35 {% for feature in features if not feature.custom %}
19 {% filter enable_conditional(feature.condition) %} 36 {% filter enable_conditional(feature.condition) %}
20 bool RuntimeEnabledFeatures::is{{feature.name}}Enabled = {{'true' if feature.sta tus == 'stable' else 'false'}}; 37 bool RuntimeEnabledFeatures::is{{feature.name}}Enabled = {{'true' if feature.sta tus == 'stable' else 'false'}};
21 {% endfilter %} 38 {% endfilter %}
22 {% endfor %} 39 {% endfor %}
23 40
24 } // namespace blink 41 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/build/scripts/templates/RuntimeEnabledFeatures.h.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698