Commit ed7012ce authored by apatrick@chromium.org's avatar apatrick@chromium.org

Move GPU prelaunch to later in startup process to ensure the blacklist information is available.

BUG=138347

Review URL: https://chromiumcodereview.appspot.com/10831014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148499 0039d316-1c4b-4281-b951-d872f2087c98
parent 0f070b8b
......@@ -437,6 +437,22 @@ void BrowserMainLoop::CreateThreads() {
if (parts_.get())
parts_->PreMainMessageLoopRun();
// When running the GPU thread in-process, avoid optimistically starting it
// since creating the GPU thread races against creation of the one-and-only
// ChildProcess instance which is created by the renderer thread.
GpuDataManager* gpu_data_manager = content::GpuDataManager::GetInstance();
if (gpu_data_manager->GpuAccessAllowed() &&
!parsed_command_line_.HasSwitch(switches::kDisableGpuProcessPrelaunch) &&
!parsed_command_line_.HasSwitch(switches::kSingleProcess) &&
!parsed_command_line_.HasSwitch(switches::kInProcessGPU)) {
TRACE_EVENT_INSTANT0("gpu", "Post task to launch GPU process");
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE, base::Bind(
base::IgnoreResult(&GpuProcessHost::Get),
GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED,
content::CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP));
}
// If the UI thread blocks, the whole UI is unresponsive.
// Do not allow disk IO from the UI thread.
base::ThreadRestrictions::SetIOAllowed(false);
......@@ -608,22 +624,7 @@ void BrowserMainLoop::BrowserThreadsStarted() {
// Start the GpuDataManager before we set up the MessageLoops because
// otherwise we'll trigger the assertion about doing IO on the UI thread.
GpuDataManager* gpu_data_manager = content::GpuDataManager::GetInstance();
// When running the GPU thread in-process, avoid optimistically starting it
// since creating the GPU thread races against creation of the one-and-only
// ChildProcess instance which is created by the renderer thread.
if (gpu_data_manager->GpuAccessAllowed() &&
!parsed_command_line_.HasSwitch(switches::kDisableGpuProcessPrelaunch) &&
!parsed_command_line_.HasSwitch(switches::kSingleProcess) &&
!parsed_command_line_.HasSwitch(switches::kInProcessGPU)) {
TRACE_EVENT_INSTANT0("gpu", "Post task to launch GPU process");
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE, base::Bind(
base::IgnoreResult(&GpuProcessHost::Get),
GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED,
content::CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP));
}
content::GpuDataManager::GetInstance();
}
void BrowserMainLoop::InitializeToolkit() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment