1 {% from 'macros.tmpl' import license %}
5 #include "platform/RuntimeEnabledFeatures.h"
7 #include "wtf/Assertions.h"
8 #include "wtf/text/WTFString.h"
12 bool caseInsensitiveEqual(const std::string& a, const std::string& b)
14 if (a.size() != b.size())
16 for (size_t i = 0; i < a.size(); ++i) {
17 if (tolower(a[i]) != tolower(b[i]))
27 {% for feature_set in feature_sets %}
28 void RuntimeEnabledFeatures::set{{feature_set|capitalize}}FeaturesEnabled(bool enable)
30 {% for feature in features if feature.status == feature_set %}
31 set{{feature.name}}Enabled(enable);
37 void RuntimeEnabledFeatures::setFeatureEnabledFromString(const std::string& name, bool isEnabled)
39 {% for feature in features if not feature.custom %}
40 {% filter enable_conditional(feature.condition) %}
41 if (caseInsensitiveEqual(name, "{{feature.name}}")) {
42 set{{feature.name}}Enabled(isEnabled);
47 WTF_LOG_ERROR("RuntimeEnabledFeature not recognized: %s", name.c_str());
50 {% for feature in features if not feature.custom %}
51 {% filter enable_conditional(feature.condition) %}
52 bool RuntimeEnabledFeatures::is{{feature.name}}Enabled = {{'true' if feature.status == 'stable' else 'false'}};