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

Unified Diff: content/browser/gpu/browser_gpu_channel_host_factory.cc

Issue 10081018: Revert 132218 - Convert plugin and GPU process to brokered handle duplication. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.h ('k') | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/browser_gpu_channel_host_factory.cc
===================================================================
--- content/browser/gpu/browser_gpu_channel_host_factory.cc (revision 132251)
+++ content/browser/gpu/browser_gpu_channel_host_factory.cc (working copy)
@@ -153,8 +153,10 @@
void BrowserGpuChannelHostFactory::GpuChannelEstablishedOnIO(
EstablishRequest* request,
const IPC::ChannelHandle& channel_handle,
+ base::ProcessHandle gpu_process_handle,
const GPUInfo& gpu_info) {
request->channel_handle = channel_handle;
+ request->gpu_process_handle = gpu_process_handle;
request->gpu_info = gpu_info;
request->event.Signal();
}
@@ -189,12 +191,26 @@
request.gpu_process_handle == base::kNullProcessHandle)
return NULL;
+ base::ProcessHandle browser_process_for_gpu;
+#if defined(OS_WIN)
+ // Create a process handle that the GPU process can use to access our handles.
+ DuplicateHandle(base::GetCurrentProcessHandle(),
+ base::GetCurrentProcessHandle(),
+ request.gpu_process_handle,
+ &browser_process_for_gpu,
+ PROCESS_DUP_HANDLE,
+ FALSE,
+ 0);
+#else
+ browser_process_for_gpu = base::GetCurrentProcessHandle();
+#endif
+
gpu_channel_ = new GpuChannelHost(this, gpu_host_id_, gpu_client_id_);
gpu_channel_->set_gpu_info(request.gpu_info);
content::GetContentClient()->SetGpuInfo(request.gpu_info);
// Connect to the GPU process if a channel name was received.
- gpu_channel_->Connect(request.channel_handle);
+ gpu_channel_->Connect(request.channel_handle, browser_process_for_gpu);
return gpu_channel_.get();
}
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.h ('k') | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698