| OLD | NEW |
| 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 <string> |
| 8 |
| 7 #include "platform/PlatformExport.h" | 9 #include "platform/PlatformExport.h" |
| 8 #include "wtf/Forward.h" | 10 #include "wtf/Forward.h" |
| 9 | 11 |
| 10 namespace blink { | 12 namespace blink { |
| 11 | 13 |
| 12 // A class that stores static enablers for all experimental features. | 14 // A class that stores static enablers for all experimental features. |
| 13 | 15 |
| 14 class PLATFORM_EXPORT RuntimeEnabledFeatures { | 16 class PLATFORM_EXPORT RuntimeEnabledFeatures { |
| 15 public: | 17 public: |
| 16 {% for feature_set in feature_sets %} | 18 {% for feature_set in feature_sets %} |
| 17 static void set{{feature_set|capitalize}}FeaturesEnabled(bool); | 19 static void set{{feature_set|capitalize}}FeaturesEnabled(bool); |
| 18 {% endfor %} | 20 {% endfor %} |
| 19 | 21 |
| 20 static void setFeatureEnabledFromString(const WTF::String& name, bool isEnab
led); | 22 static void setFeatureEnabledFromString(const std::string& name, bool isEnab
led); |
| 21 | 23 |
| 22 {% for feature in features %} | 24 {% for feature in features %} |
| 23 {% if feature.custom %} | 25 {% if feature.custom %} |
| 24 static bool {{feature.first_lowered_name}}Enabled(); | 26 static bool {{feature.first_lowered_name}}Enabled(); |
| 25 {% else %} | 27 {% else %} |
| 26 {% if feature.condition %} | 28 {% if feature.condition %} |
| 27 #if ENABLE({{feature.condition}}) | 29 #if ENABLE({{feature.condition}}) |
| 28 {% endif %} | 30 {% endif %} |
| 29 static void set{{feature.name}}Enabled(bool isEnabled) { is{{feature.name}}E
nabled = isEnabled; } | 31 static void set{{feature.name}}Enabled(bool isEnabled) { is{{feature.name}}E
nabled = isEnabled; } |
| 30 static bool {{feature.first_lowered_name}}Enabled() { return {{feature.enabl
ed_condition}}; } | 32 static bool {{feature.first_lowered_name}}Enabled() { return {{feature.enabl
ed_condition}}; } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 44 {% for feature in features if not feature.custom %} | 46 {% for feature in features if not feature.custom %} |
| 45 {% filter enable_conditional(feature.condition) %} | 47 {% filter enable_conditional(feature.condition) %} |
| 46 static bool is{{feature.name}}Enabled; | 48 static bool is{{feature.name}}Enabled; |
| 47 {% endfilter %} | 49 {% endfilter %} |
| 48 {% endfor %} | 50 {% endfor %} |
| 49 }; | 51 }; |
| 50 | 52 |
| 51 } // namespace blink | 53 } // namespace blink |
| 52 | 54 |
| 53 #endif // RuntimeEnabledFeatures_h | 55 #endif // RuntimeEnabledFeatures_h |
| OLD | NEW |