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

Side by Side Diff: Source/build/scripts/templates/RuntimeEnabledFeatures.h.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
OLDNEW
1 {% from 'macros.tmpl' import license %} 1 {% from 'macros.tmpl' import license %}
2 {{license()}} 2 {{license()}}
3 3
4 #ifndef RuntimeEnabledFeatures_h 4 #ifndef RuntimeEnabledFeatures_h
5 #define RuntimeEnabledFeatures_h 5 #define RuntimeEnabledFeatures_h
6 6
7 #include "platform/PlatformExport.h" 7 #include "platform/PlatformExport.h"
8 #include "wtf/Forward.h"
8 9
9 namespace blink { 10 namespace blink {
10 11
11 // A class that stores static enablers for all experimental features. 12 // A class that stores static enablers for all experimental features.
12 13
13 class PLATFORM_EXPORT RuntimeEnabledFeatures { 14 class PLATFORM_EXPORT RuntimeEnabledFeatures {
14 public: 15 public:
15 {% for feature_set in feature_sets %} 16 {% for feature_set in feature_sets %}
16 static void set{{feature_set|capitalize}}FeaturesEnabled(bool); 17 static void set{{feature_set|capitalize}}FeaturesEnabled(bool);
17 {% endfor %} 18 {% endfor %}
18 19
20 static void setFeatureEnabledFromString(const WTF::String& name, bool isEnab led);
19 21
20 {% for feature in features %} 22 {% for feature in features %}
21 {% if feature.custom %} 23 {% if feature.custom %}
22 static bool {{feature.first_lowered_name}}Enabled(); 24 static bool {{feature.first_lowered_name}}Enabled();
23 {% else %} 25 {% else %}
24 {% if feature.condition %} 26 {% if feature.condition %}
25 #if ENABLE({{feature.condition}}) 27 #if ENABLE({{feature.condition}})
26 {% endif %} 28 {% endif %}
27 static void set{{feature.name}}Enabled(bool isEnabled) { is{{feature.name}}E nabled = isEnabled; } 29 static void set{{feature.name}}Enabled(bool isEnabled) { is{{feature.name}}E nabled = isEnabled; }
28 static bool {{feature.first_lowered_name}}Enabled() { return {{feature.enabl ed_condition}}; } 30 static bool {{feature.first_lowered_name}}Enabled() { return {{feature.enabl ed_condition}}; }
(...skipping 13 matching lines...) Expand all
42 {% for feature in features if not feature.custom %} 44 {% for feature in features if not feature.custom %}
43 {% filter enable_conditional(feature.condition) %} 45 {% filter enable_conditional(feature.condition) %}
44 static bool is{{feature.name}}Enabled; 46 static bool is{{feature.name}}Enabled;
45 {% endfilter %} 47 {% endfilter %}
46 {% endfor %} 48 {% endfor %}
47 }; 49 };
48 50
49 } // namespace blink 51 } // namespace blink
50 52
51 #endif // RuntimeEnabledFeatures_h 53 #endif // RuntimeEnabledFeatures_h
OLDNEW
« no previous file with comments | « Source/build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl ('k') | Source/web/WebRuntimeFeatures.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698