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

Unified Diff: chrome/browser/gpu_process_host.cc

Issue 6557006: Moved creation of GPU transfer buffers into the browser process.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
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;
}

Powered by Google App Engine
This is Rietveld 408576698