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

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

Issue 18578007: Add a public API to enable/disable blink runtime features by name (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Require a 'command_line_flag' option in RuntimeEnabledFeatures.in Created 7 years, 5 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
Index: Source/core/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl
diff --git a/Source/core/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl b/Source/core/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl
index 4affac1f8eb467cbbb91859d8136b0dcf47ce75b..6f29301cf0269560eb707a3b27c98b43366b1c5e 100644
--- a/Source/core/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl
+++ b/Source/core/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl
@@ -21,5 +21,18 @@ bool RuntimeEnabledFeatures::is{{feature.name}}Enabled = false;
{%- endcall %}
{%- endfor %}
+bool RuntimeEnabledFeatures::setFeatureEnabled(const String& feature, bool enable)
+{
+{%- for feature in features if feature.command_line_flag and not feature.custom %}
+{%- call wrap_with_condition(feature.condition) %}
+ if (feature == "{{feature.name}}") {
+ set{{feature.name}}Enabled(enable);
+ return true;
+ }
+{%- endcall %}
+{%- endfor %}
+ return false;
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/scripts/make_runtime_features.py ('k') | Source/core/scripts/templates/RuntimeEnabledFeatures.h.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698