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

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

Issue 129633002: Also append GPU command-line flags to the browser in single-process mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: style Created 6 years, 11 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 | « no previous file | 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 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
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698