diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-12 23:46:17 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-12 23:46:17 +0000 |
commit | 515c71659b320d501ca37fa7a3a39b2cf3a6d6f8 (patch) | |
tree | e6dde2fe99fede1de70452d11c6c016ad9bffe5d /chrome | |
parent | 92c85519988f8b53cd8b630468d4c47102e6d92e (diff) | |
download | chromium_src-515c71659b320d501ca37fa7a3a39b2cf3a6d6f8.zip chromium_src-515c71659b320d501ca37fa7a3a39b2cf3a6d6f8.tar.gz chromium_src-515c71659b320d501ca37fa7a3a39b2cf3a6d6f8.tar.bz2 |
Asynchronously launches the GPU process.
- First renderer process sends IPC to browser process causing it to prelaunch the GPU process.
- IPC channel is subsequently established.
- If EstablishAsyncChannelSync is not called during this period, it will not block.
- Future renderer processes simply asynchronously establish the IPC channel.
- This also causes the GPU process to be relaunched if it crashed.
TEST=try, observed that GPU process launches even for pages without 3D content
BUG=none
Review URL: http://codereview.chromium.org/2952005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52152 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/renderer_host/browser_render_process_host.cc | 1 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 4 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 | ||||
-rw-r--r-- | chrome/renderer/render_thread.cc | 8 |
4 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index 411a597..e945628 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -575,6 +575,7 @@ void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer( switches::kRemoteShellPort, switches::kEnablePepperTesting, switches::kEnableChromoting, + switches::kPrelaunchGpuProcess, }; for (size_t i = 0; i < arraysize(switch_names); ++i) { diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 83caf08..127baac 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -674,6 +674,10 @@ const char kPluginStartupDialog[] = "plugin-startup-dialog"; // possibly be used for connections. const char kPreconnectDespiteProxy[] = "preconnect-despite-proxy"; +// Establishes a channel to the GPU process asynchronously and (re)launches it +// if necessary when a renderer process starts. +const char kPrelaunchGpuProcess[] = "prelaunch-gpu-process"; + // Prints the pages on the screen. const char kPrint[] = "print"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 87755e7..558189d 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -200,6 +200,7 @@ extern const char kPluginPath[]; extern const char kPluginProcess[]; extern const char kPluginStartupDialog[]; extern const char kPreconnectDespiteProxy[]; +extern const char kPrelaunchGpuProcess[]; extern const char kPrint[]; extern const char kProcessPerSite[]; extern const char kProcessPerTab[]; diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index 30be754..95588c8 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -253,6 +253,14 @@ void RenderThread::Init() { suicide_on_channel_error_filter_ = new SuicideOnChannelErrorFilter; AddFilter(suicide_on_channel_error_filter_.get()); #endif + + // Establish a channel to the GPU process asynchronously if requested. If the + // channel is established in time, EstablishGpuChannelSync will not block when + // it is later called. + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kPrelaunchGpuProcess)) { + EstablishGpuChannel(); + } } RenderThread::~RenderThread() { |