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

Unified Diff: content/browser/browser_main_loop.cc

Issue 10831014: Move GPU prelaunch to later in startup process to ensure the blacklist information is available. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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/browser_main_loop.cc
===================================================================
--- content/browser/browser_main_loop.cc (revision 148344)
+++ content/browser/browser_main_loop.cc (working copy)
@@ -437,6 +437,22 @@
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 @@
// 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() {
« 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