Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / build / scripts / templates / RuntimeEnabledFeatures.h.tmpl
1 {% from 'macros.tmpl' import license %}
2 {{license()}}
3
4 #ifndef RuntimeEnabledFeatures_h
5 #define RuntimeEnabledFeatures_h
6
7 #include "platform/PlatformExport.h"
8
9 namespace WebCore {
10
11 // A class that stores static enablers for all experimental features.
12
13 class PLATFORM_EXPORT RuntimeEnabledFeatures {
14 public:
15     {% for feature_set in feature_sets %}
16     static void set{{feature_set|capitalize}}FeaturesEnabled(bool);
17     {% endfor %}
18
19
20     {% for feature in features %}
21     {% if feature.custom %}
22     static bool {{feature.first_lowered_name}}Enabled();
23     {% else %}
24     {% if feature.condition %}
25 #if ENABLE({{feature.condition}})
26     {% endif %}
27     static void set{{feature.name}}Enabled(bool isEnabled) { is{{feature.name}}Enabled = isEnabled; }
28     static bool {{feature.first_lowered_name}}Enabled() { return {{feature.enabled_condition}}; }
29     {% if feature.condition %}
30 #else
31     static void set{{feature.name}}Enabled(bool) { }
32     static bool {{feature.first_lowered_name}}Enabled() { return false; }
33 #endif
34     {% endif %}
35
36     {% endif %}
37     {% endfor %}
38
39 private:
40     RuntimeEnabledFeatures() { }
41
42     {% for feature in features if not feature.custom %}
43     {% filter enable_conditional(feature.condition) %}
44     static bool is{{feature.name}}Enabled;
45     {% endfilter %}
46     {% endfor %}
47 };
48
49 } // namespace WebCore
50
51 #endif // RuntimeEnabledFeatures_h