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 fd3a7f22fe71ae0b451b6bf898700cf56445627f..a19136c70b2e5d70d12ac66458330396dfe3914e 100644 |
--- a/content/browser/renderer_host/render_process_host_impl.cc |
+++ b/content/browser/renderer_host/render_process_host_impl.cc |
@@ -891,6 +891,22 @@ StoragePartition* RenderProcessHostImpl::GetStoragePartition() const { |
return storage_partition_impl_; |
} |
+static void AppendGpuCommandLineFlags(CommandLine* command_line) { |
+ if (content::IsThreadedCompositingEnabled()) |
+ command_line->AppendSwitch(switches::kEnableThreadedCompositing); |
+ |
+ if (content::IsDelegatedRendererEnabled()) |
+ command_line->AppendSwitch(switches::kEnableDelegatedRenderer); |
+ |
+ if (content::IsDeadlineSchedulingEnabled()) |
+ command_line->AppendSwitch(switches::kEnableDeadlineScheduling); |
+ |
+ // Appending disable-gpu-feature switches due to software rendering list. |
jamesr
2014/01/08 22:20:40
can you remove any of the code from content/gpu/ t
|
+ GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
+ DCHECK(gpu_data_manager); |
+ gpu_data_manager->AppendRendererCommandLine(command_line); |
+} |
+ |
void RenderProcessHostImpl::AppendRendererCommandLine( |
CommandLine* command_line) const { |
// Pass the process type first, so it shows first in process listings. |
@@ -916,22 +932,10 @@ void RenderProcessHostImpl::AppendRendererCommandLine( |
field_trial_states); |
} |
- if (content::IsThreadedCompositingEnabled()) |
- command_line->AppendSwitch(switches::kEnableThreadedCompositing); |
- |
- if (content::IsDelegatedRendererEnabled()) |
- command_line->AppendSwitch(switches::kEnableDelegatedRenderer); |
- |
- if (content::IsDeadlineSchedulingEnabled()) |
- command_line->AppendSwitch(switches::kEnableDeadlineScheduling); |
- |
GetContentClient()->browser()->AppendExtraCommandLineSwitches( |
command_line, GetID()); |
- // Appending disable-gpu-feature switches due to software rendering list. |
- GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
- DCHECK(gpu_data_manager); |
- gpu_data_manager->AppendRendererCommandLine(command_line); |
+ AppendGpuCommandLineFlags(command_line); |
} |
void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( |
@@ -1656,12 +1660,15 @@ void RenderProcessHost::SetRunRendererInProcess(bool value) { |
g_run_renderer_in_process_ = value; |
CommandLine* command_line = CommandLine::ForCurrentProcess(); |
- if (value && !command_line->HasSwitch(switches::kLang)) { |
- // Modify the current process' command line to include the browser locale, |
- // as the renderer expects this flag to be set. |
- const std::string locale = |
- GetContentClient()->browser()->GetApplicationLocale(); |
- command_line->AppendSwitchASCII(switches::kLang, locale); |
+ if (value) { |
+ if (!command_line->HasSwitch(switches::kLang)) { |
+ // Modify the current process' command line to include the browser locale, |
+ // as the renderer expects this flag to be set. |
+ const std::string locale = |
+ GetContentClient()->browser()->GetApplicationLocale(); |
+ command_line->AppendSwitchASCII(switches::kLang, locale); |
+ } |
+ AppendGpuCommandLineFlags(command_line); |
jamesr
2014/01/08 22:20:40
probably deserves a comment with link to a bug and
|
} |
} |