| OLD | NEW |
| 1 {% from 'macros.tmpl' import license %} | 1 {% from 'macros.tmpl' import license %} |
| 2 {{license()}} | 2 {{license()}} |
| 3 | 3 |
| 4 #include "config.h" | 4 #include "config.h" |
| 5 #include "platform/RuntimeEnabledFeatures.h" | 5 #include "platform/RuntimeEnabledFeatures.h" |
| 6 | 6 |
| 7 #include "wtf/Assertions.h" |
| 8 #include "wtf/text/WTFString.h" |
| 9 |
| 7 namespace blink { | 10 namespace blink { |
| 8 | 11 |
| 9 {% for feature_set in feature_sets %} | 12 {% for feature_set in feature_sets %} |
| 10 void RuntimeEnabledFeatures::set{{feature_set|capitalize}}FeaturesEnabled(bool e
nable) | 13 void RuntimeEnabledFeatures::set{{feature_set|capitalize}}FeaturesEnabled(bool e
nable) |
| 11 { | 14 { |
| 12 {% for feature in features if feature.status == feature_set %} | 15 {% for feature in features if feature.status == feature_set %} |
| 13 set{{feature.name}}Enabled(enable); | 16 set{{feature.name}}Enabled(enable); |
| 14 {% endfor %} | 17 {% endfor %} |
| 15 } | 18 } |
| 16 | 19 |
| 17 {% endfor %} | 20 {% endfor %} |
| 21 |
| 22 void RuntimeEnabledFeatures::setFeatureEnabledFromString(const String& name, boo
l isEnabled) |
| 23 { |
| 24 {% for feature in features if not feature.custom %} |
| 25 {% filter enable_conditional(feature.condition) %} |
| 26 if (equalIgnoringCase(name, "{{feature.name}}")) { |
| 27 set{{feature.name}}Enabled(isEnabled); |
| 28 return; |
| 29 } |
| 30 {% endfilter %} |
| 31 {% endfor %} |
| 32 WTF_LOG_ERROR("RuntimeEnabledFeature not recognized: %s", name.ascii().data(
)); |
| 33 } |
| 34 |
| 18 {% for feature in features if not feature.custom %} | 35 {% for feature in features if not feature.custom %} |
| 19 {% filter enable_conditional(feature.condition) %} | 36 {% filter enable_conditional(feature.condition) %} |
| 20 bool RuntimeEnabledFeatures::is{{feature.name}}Enabled = {{'true' if feature.sta
tus == 'stable' else 'false'}}; | 37 bool RuntimeEnabledFeatures::is{{feature.name}}Enabled = {{'true' if feature.sta
tus == 'stable' else 'false'}}; |
| 21 {% endfilter %} | 38 {% endfilter %} |
| 22 {% endfor %} | 39 {% endfor %} |
| 23 | 40 |
| 24 } // namespace blink | 41 } // namespace blink |
| OLD | NEW |