Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / build / scripts / templates / RuntimeEnabledFeatures.h.tmpl
blobb9f4873783ad960f0361ab405ca8de808849a77e
1 {% from 'macros.tmpl' import license %}
2 {{license()}}
4 #ifndef RuntimeEnabledFeatures_h
5 #define RuntimeEnabledFeatures_h
7 #include <string>
9 #include "platform/PlatformExport.h"
10 #include "wtf/Forward.h"
12 namespace blink {
14 // A class that stores static enablers for all experimental features.
16 class PLATFORM_EXPORT RuntimeEnabledFeatures {
17 public:
18     {% for feature_set in feature_sets %}
19     static void set{{feature_set|capitalize}}FeaturesEnabled(bool);
20     {% endfor %}
22     static void setFeatureEnabledFromString(const std::string& name, bool isEnabled);
24     {% for feature in features %}
25     {% if feature.custom %}
26     static bool {{feature.first_lowered_name}}Enabled();
27     {% else %}
28     {% if feature.condition %}
29 #if ENABLE({{feature.condition}})
30     {% endif %}
31     static void set{{feature.name}}Enabled(bool isEnabled) { is{{feature.name}}Enabled = isEnabled; }
32     static bool {{feature.first_lowered_name}}Enabled() { return {{feature.enabled_condition}}; }
33     {% if feature.condition %}
34 #else
35     static void set{{feature.name}}Enabled(bool) { }
36     static bool {{feature.first_lowered_name}}Enabled() { return false; }
37 #endif
38     {% endif %}
40     {% endif %}
41     {% endfor %}
43 private:
44     RuntimeEnabledFeatures() { }
46     {% for feature in features if not feature.custom %}
47     {% filter enable_conditional(feature.condition) %}
48     static bool is{{feature.name}}Enabled;
49     {% endfilter %}
50     {% endfor %}
53 } // namespace blink
55 #endif // RuntimeEnabledFeatures_h