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

Unified Diff: content/browser/browser_main_loop.cc

Issue 9545008: Automatically start the GPU process 5s after browser startup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix worker_uitest Created 8 years, 10 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 | content/common/gpu/gpu_process_launch_causes.h » ('j') | 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 af21209e88cb3c6c95ad9991d8a4dc129a037eca..7b46f7adb92ade28d89292944e3f14c9eb0e4237 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -17,6 +17,7 @@
#include "content/browser/download/download_file_manager.h"
#include "content/browser/download/save_file_manager.h"
#include "content/browser/gpu/browser_gpu_channel_host_factory.h"
+#include "content/browser/gpu/gpu_process_host.h"
#include "content/browser/gpu/gpu_process_host_ui_shim.h"
#include "content/browser/in_process_webkit/webkit_thread.h"
#include "content/browser/plugin_service_impl.h"
@@ -429,6 +430,14 @@ void BrowserMainLoop::CreateThreads() {
// If the UI thread blocks, the whole UI is unresponsive.
// Do not allow disk IO from the UI thread.
base::ThreadRestrictions::SetIOAllowed(false);
+
+ BrowserThread::PostDelayedTask(
+ BrowserThread::IO, FROM_HERE, base::Bind(
+ base::IgnoreResult(&GpuProcessHost::GetForClient),
+ 1, // Arbitrary non-0 (to cause sandboxing) client_id.
+ content::CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP),
+ // Arbitrary delay to avoid allow browser init precious CPU cycles.
+ base::TimeDelta::FromSeconds(5));
}
void BrowserMainLoop::RunMainMessageLoopParts() {
« no previous file with comments | « no previous file | content/common/gpu/gpu_process_launch_causes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698