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

Unified Diff: content/browser/renderer_host/gpu_message_filter.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: content/browser/renderer_host/gpu_message_filter.cc
===================================================================
--- content/browser/renderer_host/gpu_message_filter.cc (revision 75655)
+++ content/browser/renderer_host/gpu_message_filter.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/renderer_host/gpu_message_filter.h"
#include "base/callback.h"
@@ -53,7 +57,8 @@
namespace {
class EstablishChannelCallback
- : public CallbackRunner<Tuple2<const IPC::ChannelHandle&,
+ : public CallbackRunner<Tuple3<const IPC::ChannelHandle&,
+ base::ProcessHandle,
const GPUInfo&> > {
public:
explicit EstablishChannelCallback(GpuMessageFilter* filter):
@@ -66,17 +71,38 @@
}
void Send(const IPC::ChannelHandle& channel,
+ base::ProcessHandle browser_gpu_process,
Ken Russell (switch to Gerrit) 2011/02/24 19:48:47 Perhaps "gpu_process_for_browser"?
const GPUInfo& gpu_info) {
+ if (!filter_)
+ return;
+
+ base::ProcessHandle gpu_renderer_process;
+#if defined(OS_WIN)
+ // Create a process handle that the renderer process can give to the GPU
+ // process to give it access to its handles.
+ DuplicateHandle(base::GetCurrentProcessHandle(),
+ filter_->peer_handle(),
+ browser_gpu_process,
+ &gpu_renderer_process,
+ PROCESS_DUP_HANDLE,
+ FALSE,
+ 0);
+#else
+ gpu_renderer_process = filter_->peer_handle();
+#endif
+
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
ViewMsg_GpuChannelEstablished* reply =
- new ViewMsg_GpuChannelEstablished(channel, gpu_info);
+ new ViewMsg_GpuChannelEstablished(channel,
+ gpu_renderer_process,
+ gpu_info);
+
// If the renderer process is performing synchronous initialization,
// it needs to handle this message before receiving the reply for
// the synchronous GpuHostMsg_SynchronizeGpu message.
reply->set_unblock(true);
- if (filter_)
- filter_->Send(reply);
+ filter_->Send(reply);
}
private:
@@ -148,7 +174,9 @@
if (!ui_shim) {
ui_shim = GpuProcessHostUIShim::GetForRenderer(render_process_id_);
if (!ui_shim) {
- callback->Run(IPC::ChannelHandle(), GPUInfo());
+ callback->Run(IPC::ChannelHandle(),
+ static_cast<base::ProcessHandle>(NULL),
+ GPUInfo());
return;
}

Powered by Google App Engine
This is Rietveld 408576698