OLD | NEW |
(Empty) | |
| 1 {% from "macros.tmpl" import wrap_with_condition -%} |
| 2 |
| 3 {{ license }} |
| 4 #ifndef RuntimeEnabledFeatures_h |
| 5 #define RuntimeEnabledFeatures_h |
| 6 |
| 7 namespace WebCore { |
| 8 |
| 9 // A class that stores static enablers for all experimental features. |
| 10 |
| 11 class RuntimeEnabledFeatures { |
| 12 public: |
| 13 {%- for feature in features %} |
| 14 {%- if feature.custom %} |
| 15 static bool {{feature.first_lowered_name}}Enabled(); |
| 16 {%- else %} |
| 17 {%- if feature.condition %} |
| 18 #if ENABLE({{feature.condition}}) |
| 19 {%- endif %} |
| 20 static void set{{feature.name}}Enabled(bool isEnabled) { is{{feature.name}}E
nabled = isEnabled; } |
| 21 static bool {{feature.first_lowered_name}}Enabled() { return {{feature.enabl
ed_condition}}; } |
| 22 {%- if feature.condition %} |
| 23 #else |
| 24 static void set{{feature.name}}Enabled(bool) { } |
| 25 static bool {{feature.first_lowered_name}}Enabled() { return false; } |
| 26 #endif |
| 27 {%- endif %} |
| 28 {%- endif %} |
| 29 {% endfor %} |
| 30 |
| 31 private: |
| 32 RuntimeEnabledFeatures() { } |
| 33 |
| 34 {% for feature in features if not feature.custom %} |
| 35 {%- call wrap_with_condition(feature.condition) %} |
| 36 static bool is{{feature.name}}Enabled; |
| 37 {%- endcall %} |
| 38 {%- endfor %} |
| 39 }; |
| 40 |
| 41 } // namespace WebCore |
| 42 |
| 43 #endif // RuntimeEnabledFeatures_h |
| 44 |
OLD | NEW |