Index: chrome/browser/gpu_process_host.cc |
=================================================================== |
--- chrome/browser/gpu_process_host.cc (revision 75655) |
+++ chrome/browser/gpu_process_host.cc (working copy) |
@@ -2,6 +2,10 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#if defined(OS_WIN) |
+#include <windows.h> |
+#endif |
+ |
#include "chrome/browser/gpu_process_host.h" |
#include "app/app_switches.h" |
@@ -173,6 +177,31 @@ |
return true; |
} |
+void GpuProcessHost::OnProcessLaunched() { |
+ // Send the GPU process handle to the UI thread before it has to any |
Ken Russell (switch to Gerrit)
2011/02/24 19:48:47
Remove "any" at end of line.
|
+ // respond to any requests to establish a GPU channel. The response |
+ // to such requests require that the GPU process handle be known. |
+ base::ProcessHandle child_handle; |
+#if defined(OS_WIN) |
+ DuplicateHandle(base::GetCurrentProcessHandle(), |
+ handle(), |
+ base::GetCurrentProcessHandle(), |
+ &child_handle, |
+ PROCESS_DUP_HANDLE, |
+ FALSE, |
+ 0); |
+#else |
+ child_handle = handle(); |
+#endif |
+ |
+ BrowserThread::PostTask( |
+ BrowserThread::UI, |
+ FROM_HERE, |
+ NewRunnableFunction(&GpuProcessHostUIShim::NotifyGpuProcessLaunched, |
+ host_id_, |
+ child_handle)); |
+} |
+ |
namespace { |
void SendOutstandingRepliesDispatcher(int host_id) { |
@@ -233,6 +262,9 @@ |
if (!thread->StartWithOptions(options)) |
return false; |
+ set_handle(base::GetCurrentProcessHandle()); |
+ OnProcessLaunched(); |
+ |
return true; |
} |