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

Unified Diff: content/browser/browser_main_loop.cc

Issue 11469022: Start GPU process earlier (when force-compositing mode is enabled) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: combine reverted patch Created 8 years 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
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index 472cb44320848e5fa82663056ad48344535dad3e..fd98057a01f35c3fbfb17426fd45ce00a5a4228b 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -32,6 +32,7 @@
#include "content/browser/trace_controller_impl.h"
#include "content/public/browser/browser_main_parts.h"
#include "content/public/browser/browser_shutdown.h"
+#include "content/public/browser/compositor_util.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_switches.h"
@@ -465,23 +466,6 @@ void BrowserMainLoop::CreateThreads() {
if (parts_.get())
parts_->PreMainMessageLoopRun();
-#if !defined(OS_IOS)
- // 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 (GpuDataManagerImpl::GetInstance()->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,
- CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP));
- }
-#endif // !defined(OS_IOS)
-
// If the UI thread blocks, the whole UI is unresponsive.
// Do not allow disk IO from the UI thread.
base::ThreadRestrictions::SetIOAllowed(false);
@@ -695,6 +679,22 @@ void BrowserMainLoop::BrowserThreadsStarted() {
allowed_clipboard_threads.push_back(io_thread_->thread_id());
#endif
ui::Clipboard::SetAllowedThreads(allowed_clipboard_threads);
+
+ // 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 (GpuDataManagerImpl::GetInstance()->GpuAccessAllowed() &&
+ content::IsForceCompositingModeEnabled() &&
+ !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,
+ CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP));
+ }
#endif // !defined(OS_IOS)
}
« 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