Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Unified Diff: Source/build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl

Issue 890723004: Allow setting runtime-enabled features from a string. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/build/scripts/templates/RuntimeEnabledFeatures.h.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 82592188d06a3f926c137dafc270acb9a9e9c23c..fd648b7304d558825b204970e60a074aeac8133a 100644
--- a/Source/build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl
+++ b/Source/build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl
@@ -4,6 +4,9 @@
#include "config.h"
#include "platform/RuntimeEnabledFeatures.h"
+#include "wtf/Assertions.h"
+#include "wtf/text/WTFString.h"
+
namespace blink {
{% for feature_set in feature_sets %}
@@ -15,6 +18,20 @@ void RuntimeEnabledFeatures::set{{feature_set|capitalize}}FeaturesEnabled(bool e
}
{% endfor %}
+
+void RuntimeEnabledFeatures::setFeatureEnabledFromString(const String& name, bool isEnabled)
+{
+ {% for feature in features if not feature.custom %}
+ {% filter enable_conditional(feature.condition) %}
+ if (equalIgnoringCase(name, "{{feature.name}}")) {
+ set{{feature.name}}Enabled(isEnabled);
+ return;
+ }
+ {% endfilter %}
+ {% endfor %}
+ WTF_LOG_ERROR("RuntimeEnabledFeature not recognized: %s", name.ascii().data());
+}
+
{% for feature in features if not feature.custom %}
{% filter enable_conditional(feature.condition) %}
bool RuntimeEnabledFeatures::is{{feature.name}}Enabled = {{'true' if feature.status == 'stable' else 'false'}};
« no previous file with comments | « no previous file | Source/build/scripts/templates/RuntimeEnabledFeatures.h.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698