| 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");
|
|
|
|
|