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

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

Issue 1538803004: Create child window in GPU process for DirectComposition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/common/gpu/child_window_surface_win.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
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 913d7e1c34099a24614da6ab18b9019e5ca597c8..b97057871f71fff84dc7c8c58109718e59b0e8cb 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -617,6 +617,10 @@ bool GpuProcessHost::OnMessageReceived(const IPC::Message& message) {
OnDestroyChannel)
IPC_MESSAGE_HANDLER(GpuHostMsg_CacheShader,
OnCacheShader)
+#if defined(OS_WIN)
+ IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceCreatedChildWindow,
+ OnAcceleratedSurfaceCreatedChildWindow)
+#endif
IPC_MESSAGE_UNHANDLED(RouteOnUIThread(message))
IPC_END_MESSAGE_MAP()
@@ -624,6 +628,36 @@ bool GpuProcessHost::OnMessageReceived(const IPC::Message& message) {
return true;
}
+#if defined(OS_WIN)
+void GpuProcessHost::OnAcceleratedSurfaceCreatedChildWindow(
+ const gfx::PluginWindowHandle& parent_handle,
+ const gfx::PluginWindowHandle& window_handle) {
+ DCHECK(process_);
+ {
+ DWORD process_id = 0;
+ DWORD thread_id = GetWindowThreadProcessId(parent_handle, &process_id);
+
+ if (!thread_id || process_id != ::GetCurrentProcessId()) {
+ process_->TerminateOnBadMessageReceived(
+ GpuHostMsg_AcceleratedSurfaceCreatedChildWindow::ID);
+ return;
+ }
+ }
+ {
+ DWORD process_id = 0;
+ DWORD thread_id = GetWindowThreadProcessId(window_handle, &process_id);
+
+ if (!thread_id || process_id != process_->GetProcess().Pid()) {
+ process_->TerminateOnBadMessageReceived(
+ GpuHostMsg_AcceleratedSurfaceCreatedChildWindow::ID);
+ return;
+ }
+ }
+
+ ::SetParent(window_handle, parent_handle);
+}
+#endif
+
void GpuProcessHost::OnChannelConnected(int32_t peer_pid) {
TRACE_EVENT0("gpu", "GpuProcessHost::OnChannelConnected");
« no previous file with comments | « content/browser/gpu/gpu_process_host.h ('k') | content/common/gpu/child_window_surface_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698