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

Unified Diff: content/child/runtime_features.cc

Issue 898483004: Add --{enable,disable}-blink-features flags which set RuntimeEnabledFeatures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address jochen review comments Created 5 years, 10 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 | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/runtime_features.cc
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
index 79b0f244b47fada2de35d0bf87c4ceb00b426adc..fe4bb694372a29604f4651b6e68c89d78283c72d 100644
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -4,8 +4,11 @@
#include "content/child/runtime_features.h"
+#include <vector>
+
#include "base/command_line.h"
#include "base/metrics/field_trial.h"
+#include "base/strings/string_split.h"
#include "content/common/content_switches_internal.h"
#include "content/public/common/content_switches.h"
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
@@ -186,6 +189,29 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
WebRuntimeFeatures::enableV8IdleTasks(false);
else
WebRuntimeFeatures::enableV8IdleTasks(true);
+
+ // Enable explicitly enabled features, and then disable explicitly disabled
+ // ones.
+ if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) {
+ std::vector<std::string> enabled_features;
+ base::SplitString(
+ command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), ',',
+ &enabled_features);
+ for (const std::string& feature : enabled_features) {
+ WebRuntimeFeatures::enableFeatureFromString(
+ blink::WebString::fromLatin1(feature), true);
+ }
+ }
+ if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) {
+ std::vector<std::string> disabled_features;
+ base::SplitString(
+ command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), ',',
+ &disabled_features);
+ for (const std::string& feature : disabled_features) {
+ WebRuntimeFeatures::enableFeatureFromString(
+ blink::WebString::fromLatin1(feature), false);
+ }
+ }
}
} // namespace content
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698