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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 1471693007: Make FeatureList override state be plumbed to renderer processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Match function order in header file. Created 5 years, 1 month 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 | « base/feature_list_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index ee17b6a88f2cc2a376809762c3daea42b487f1fd..59bbf1932ac419f0db05d878133831a3e1c7111e 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -17,6 +17,7 @@
#include "base/callback.h"
#include "base/command_line.h"
#include "base/debug/dump_without_crashing.h"
+#include "base/feature_list.h"
#include "base/files/file.h"
#include "base/lazy_instance.h"
#include "base/location.h"
@@ -433,6 +434,24 @@ std::string UintVectorToString(const std::vector<unsigned>& vector) {
return str;
}
+// Copies kEnableFeatures and kDisableFeatures to the renderer command line.
+// Generates them from the FeatureList override state, to take into account
+// overrides from FieldTrials.
+void CopyEnableDisableFeatureFlagsToRenderer(base::CommandLine* renderer_cmd) {
+ std::string enabled_features;
+ std::string disabled_features;
+ base::FeatureList::GetInstance()->GetFeatureOverrides(&enabled_features,
+ &disabled_features);
+ if (!enabled_features.empty()) {
+ renderer_cmd->AppendSwitchASCII(switches::kEnableFeatures,
+ enabled_features);
+ }
+ if (!disabled_features.empty()) {
+ renderer_cmd->AppendSwitchASCII(switches::kDisableFeatures,
+ disabled_features);
+ }
+}
+
} // namespace
RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL;
@@ -1302,7 +1321,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kDisableDisplayList2dCanvas,
switches::kDisableDistanceFieldText,
switches::kDisableEncryptedMedia,
- switches::kDisableFeatures,
switches::kDisableFileSystem,
switches::kDisableGestureRequirementForMediaPlayback,
switches::kDisableGpuCompositing,
@@ -1341,7 +1359,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kEnableDistanceFieldText,
switches::kEnableExperimentalCanvasFeatures,
switches::kEnableExperimentalWebPlatformFeatures,
- switches::kEnableFeatures,
switches::kEnableHeapProfiling,
switches::kEnableGPUClientLogging,
switches::kEnableGpuClientTracing,
@@ -1483,6 +1500,8 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames,
arraysize(kSwitchNames));
+ CopyEnableDisableFeatureFlagsToRenderer(renderer_cmd);
+
if (browser_cmd.HasSwitch(switches::kTraceStartup) &&
BrowserMainLoop::GetInstance()->is_tracing_startup_for_duration()) {
// Pass kTraceStartup switch to renderer only if startup tracing has not
« no previous file with comments | « base/feature_list_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698