Index: content/browser/browser_main_loop.cc |
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc |
index 91d86e1b02eb1fb00914fa834d073e2cb9a0d629..e9ee89f93c3d0d1ef006bf2f5bfa449093c678d1 100644 |
--- a/content/browser/browser_main_loop.cc |
+++ b/content/browser/browser_main_loop.cc |
@@ -1110,7 +1110,7 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() { |
} |
// Must happen after the IO thread is shutdown since this may be accessed from |
// it. |
- { |
+ if (!shell::ShellIsRemote()) { |
TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GPUChannelFactory"); |
if (BrowserGpuChannelHostFactory::instance()) |
BrowserGpuChannelHostFactory::Terminate(); |
@@ -1174,6 +1174,8 @@ int BrowserMainLoop::BrowserThreadsStarted() { |
mojo_shell_context_.reset(new MojoShellContext); |
if (shell::ShellIsRemote()) { |
#if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) |
+ base::CommandLine::ForCurrentProcess()->AppendSwitch( |
+ switches::kIsRunningInMash); |
// TODO(rockot): Remove the blocking wait for init. |
// http://crbug.com/594852. |
auto connection = MojoShellConnection::GetForProcess(); |
@@ -1214,7 +1216,8 @@ int BrowserMainLoop::BrowserThreadsStarted() { |
#elif defined(USE_AURA) || defined(OS_MACOSX) |
established_gpu_channel = true; |
if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor() || |
- parsed_command_line_.HasSwitch(switches::kDisableGpuEarlyInit)) { |
+ parsed_command_line_.HasSwitch(switches::kDisableGpuEarlyInit) || |
+ shell::ShellIsRemote()) { |
established_gpu_channel = always_uses_gpu = false; |
} |
BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); |
@@ -1317,9 +1320,8 @@ int BrowserMainLoop::BrowserThreadsStarted() { |
// since creating the GPU thread races against creation of the one-and-only |
// ChildProcess instance which is created by the renderer thread. |
if (GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(NULL) && |
- !established_gpu_channel && |
- always_uses_gpu && |
- !UsingInProcessGpu()) { |
+ !established_gpu_channel && always_uses_gpu && !UsingInProcessGpu() && |
+ !shell::ShellIsRemote()) { |
TRACE_EVENT_INSTANT0("gpu", "Post task to launch GPU process", |
TRACE_EVENT_SCOPE_THREAD); |
BrowserThread::PostTask( |