summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc1
-rw-r--r--chrome/common/chrome_switches.cc4
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/renderer/render_thread.cc8
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() {