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

Unified Diff: content/browser/gpu/gpu_process_host.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/gpu_process_host.h ('k') | content/browser/renderer_host/gpu_message_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_process_host.cc
===================================================================
--- content/browser/gpu/gpu_process_host.cc (revision 132251)
+++ content/browser/gpu/gpu_process_host.cc (working copy)
@@ -267,6 +267,7 @@
GpuProcessHost::GpuProcessHost(int host_id, GpuProcessKind kind)
: host_id_(host_id),
+ gpu_process_(base::kNullProcessHandle),
in_process_(false),
software_rendering_(false),
kind_(kind),
@@ -337,6 +338,11 @@
content::RESULT_CODE_LAST_CODE);
}
+#if defined(OS_WIN)
+ if (gpu_process_)
+ CloseHandle(gpu_process_);
+#endif
+
// In case we never started, clean up.
while (!queued_messages_.empty()) {
delete queued_messages_.front();
@@ -492,6 +498,10 @@
void GpuProcessHost::OnChannelEstablished(
const IPC::ChannelHandle& channel_handle) {
+ // The GPU process should have launched at this point and this object should
+ // have been notified of its process handle.
+ DCHECK(gpu_process_);
+
EstablishChannelCallback callback = channel_requests_.front();
channel_requests_.pop();
@@ -511,7 +521,7 @@
return;
}
- callback.Run(channel_handle,
+ callback.Run(channel_handle, gpu_process_,
GpuDataManagerImpl::GetInstance()->GetGPUInfo());
}
@@ -613,6 +623,25 @@
#endif // OS_WIN && !USE_AURA
void GpuProcessHost::OnProcessLaunched() {
+ // Send the GPU process handle to the UI thread before it has to
+ // 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 = in_process_ ?
+ base::GetCurrentProcessHandle() : process_->GetData().handle;
+
+#if defined(OS_WIN)
+ DuplicateHandle(base::GetCurrentProcessHandle(),
+ child_handle,
+ base::GetCurrentProcessHandle(),
+ &gpu_process_,
+ PROCESS_DUP_HANDLE,
+ FALSE,
+ 0);
+#else
+ gpu_process_ = child_handle;
+#endif
+
UMA_HISTOGRAM_TIMES("GPU.GPUProcessLaunchTime",
base::TimeTicks::Now() - init_start_time_);
}
@@ -745,7 +774,7 @@
const IPC::ChannelHandle& channel_handle,
base::ProcessHandle renderer_process_for_gpu,
const content::GPUInfo& gpu_info) {
- callback.Run(channel_handle, gpu_info);
+ callback.Run(channel_handle, renderer_process_for_gpu, gpu_info);
}
void GpuProcessHost::CreateCommandBufferError(
« no previous file with comments | « content/browser/gpu/gpu_process_host.h ('k') | content/browser/renderer_host/gpu_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698