| Index: Source/build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl
|
| diff --git a/Source/build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl b/Source/build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl
|
| index fd648b7304d558825b204970e60a074aeac8133a..d3993f271fea812014d611a4a64fe3813afcf000 100644
|
| --- a/Source/build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl
|
| +++ b/Source/build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl
|
| @@ -7,6 +7,21 @@
|
| #include "wtf/Assertions.h"
|
| #include "wtf/text/WTFString.h"
|
|
|
| +namespace {
|
| +
|
| +bool caseInsensitiveEqual(const std::string& a, const std::string& b)
|
| +{
|
| + if (a.size() != b.size())
|
| + return false;
|
| + for (size_t i = 0; i < a.size(); ++i) {
|
| + if (tolower(a[i]) != tolower(b[i]))
|
| + return false;
|
| + }
|
| + return true;
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| namespace blink {
|
|
|
| {% for feature_set in feature_sets %}
|
| @@ -19,17 +34,17 @@ void RuntimeEnabledFeatures::set{{feature_set|capitalize}}FeaturesEnabled(bool e
|
|
|
| {% endfor %}
|
|
|
| -void RuntimeEnabledFeatures::setFeatureEnabledFromString(const String& name, bool isEnabled)
|
| +void RuntimeEnabledFeatures::setFeatureEnabledFromString(const std::string& name, bool isEnabled)
|
| {
|
| {% for feature in features if not feature.custom %}
|
| {% filter enable_conditional(feature.condition) %}
|
| - if (equalIgnoringCase(name, "{{feature.name}}")) {
|
| + if (caseInsensitiveEqual(name, "{{feature.name}}")) {
|
| set{{feature.name}}Enabled(isEnabled);
|
| return;
|
| }
|
| {% endfilter %}
|
| {% endfor %}
|
| - WTF_LOG_ERROR("RuntimeEnabledFeature not recognized: %s", name.ascii().data());
|
| + WTF_LOG_ERROR("RuntimeEnabledFeature not recognized: %s", name.c_str());
|
| }
|
|
|
| {% for feature in features if not feature.custom %}
|
|
|