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 |