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

Unified Diff: chrome/browser/gpu_process_host.cc

Issue 6296006: Disabled support for running GPU thread in browser process with --single-proc... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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: chrome/browser/gpu_process_host.cc
===================================================================
--- chrome/browser/gpu_process_host.cc (revision 71359)
+++ chrome/browser/gpu_process_host.cc (working copy)
@@ -574,6 +574,12 @@
bool GpuProcessHost::LaunchGpuProcess() {
const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
+ // TODO(apatrick): This cannot be a UI message pump on Linux because glib is
+ // not thread safe. Changing this to an IO message pump does not completely
+ // resolve the problem, most likely because we're sharing a connection to the
+ // X server with the browser.
+#if !defined(OS_LINUX)
+
// If the single-process switch is present, just launch the GPU service in a
// new thread in the browser process.
if (browser_command_line.HasSwitch(switches::kSingleProcess)) {
@@ -584,50 +590,53 @@
if (!thread->StartWithOptions(options))
return false;
- } else {
- CommandLine::StringType gpu_launcher =
- browser_command_line.GetSwitchValueNative(switches::kGpuLauncher);
- FilePath exe_path = ChildProcessHost::GetChildPath(gpu_launcher.empty());
- if (exe_path.empty())
- return false;
+ return true;
+ }
+#endif
- CommandLine* cmd_line = new CommandLine(exe_path);
- cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess);
- cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id());
+ CommandLine::StringType gpu_launcher =
+ browser_command_line.GetSwitchValueNative(switches::kGpuLauncher);
- // Propagate relevant command line switches.
- static const char* const kSwitchNames[] = {
- switches::kUseGL,
- switches::kDisableGpuVsync,
- switches::kDisableGpuWatchdog,
- switches::kDisableLogging,
- switches::kEnableAcceleratedDecoding,
- switches::kEnableLogging,
- #if defined(OS_MACOSX)
- switches::kEnableSandboxLogging,
- #endif
- switches::kGpuStartupDialog,
- switches::kLoggingLevel,
- switches::kNoGpuSandbox,
- switches::kNoSandbox,
- };
- cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
- arraysize(kSwitchNames));
+ FilePath exe_path = ChildProcessHost::GetChildPath(gpu_launcher.empty());
+ if (exe_path.empty())
+ return false;
- // If specified, prepend a launcher program to the command line.
- if (!gpu_launcher.empty())
- cmd_line->PrependWrapper(gpu_launcher);
+ CommandLine* cmd_line = new CommandLine(exe_path);
+ cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess);
+ cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id());
- Launch(
+ // Propagate relevant command line switches.
+ static const char* const kSwitchNames[] = {
+ switches::kUseGL,
+ switches::kDisableGpuVsync,
+ switches::kDisableGpuWatchdog,
+ switches::kDisableLogging,
+ switches::kEnableAcceleratedDecoding,
+ switches::kEnableLogging,
+#if defined(OS_MACOSX)
+ switches::kEnableSandboxLogging,
+#endif
+ switches::kGpuStartupDialog,
+ switches::kLoggingLevel,
+ switches::kNoGpuSandbox,
+ switches::kNoSandbox,
+ };
+ cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
+ arraysize(kSwitchNames));
+
+ // If specified, prepend a launcher program to the command line.
+ if (!gpu_launcher.empty())
+ cmd_line->PrependWrapper(gpu_launcher);
+
+ Launch(
#if defined(OS_WIN)
- FilePath(),
+ FilePath(),
#elif defined(OS_POSIX)
- false, // Never use the zygote (GPU plugin can't be sandboxed).
- base::environment_vector(),
+ false, // Never use the zygote (GPU plugin can't be sandboxed).
+ base::environment_vector(),
#endif
- cmd_line);
- }
+ cmd_line);
UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessLifetimeEvents",
LAUNCED, GPU_PROCESS_LIFETIME_EVENT_MAX);
« 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