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

Side by Side 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 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/gpu/gpu_process_host.h" 5 #include "content/browser/gpu/gpu_process_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/base_switches.h" 10 #include "base/base_switches.h"
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 IPC_MESSAGE_HANDLER(GpuHostMsg_GpuMemoryUmaStats, 627 IPC_MESSAGE_HANDLER(GpuHostMsg_GpuMemoryUmaStats,
628 OnGpuMemoryUmaStatsReceived) 628 OnGpuMemoryUmaStatsReceived)
629 #if defined(OS_MACOSX) 629 #if defined(OS_MACOSX)
630 IPC_MESSAGE_HANDLER_GENERIC(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, 630 IPC_MESSAGE_HANDLER_GENERIC(GpuHostMsg_AcceleratedSurfaceBuffersSwapped,
631 OnAcceleratedSurfaceBuffersSwapped(message)) 631 OnAcceleratedSurfaceBuffersSwapped(message))
632 #endif 632 #endif
633 IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyChannel, 633 IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyChannel,
634 OnDestroyChannel) 634 OnDestroyChannel)
635 IPC_MESSAGE_HANDLER(GpuHostMsg_CacheShader, 635 IPC_MESSAGE_HANDLER(GpuHostMsg_CacheShader,
636 OnCacheShader) 636 OnCacheShader)
637 #if defined(OS_WIN)
638 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceCreatedChildWindow,
639 OnAcceleratedSurfaceCreatedChildWindow)
640 #endif
637 641
638 IPC_MESSAGE_UNHANDLED(RouteOnUIThread(message)) 642 IPC_MESSAGE_UNHANDLED(RouteOnUIThread(message))
639 IPC_END_MESSAGE_MAP() 643 IPC_END_MESSAGE_MAP()
640 644
641 return true; 645 return true;
642 } 646 }
643 647
648 #if defined(OS_WIN)
649 void GpuProcessHost::OnAcceleratedSurfaceCreatedChildWindow(
650 const gfx::PluginWindowHandle& parent_handle,
651 const gfx::PluginWindowHandle& window_handle) {
652 {
653 DWORD process_id = 0;
654 DWORD thread_id = GetWindowThreadProcessId(parent_handle, &process_id);
655
656 if (!thread_id || process_id != ::GetCurrentProcessId())
657 return;
Will Harris 2016/01/06 18:23:32 could consider calling bad_message::ReceivedBadMes
jschuh 2016/01/07 01:41:11 Yep. This is bad so kill the sender.
658 }
659 {
660 DWORD process_id = 0;
661 DWORD thread_id = GetWindowThreadProcessId(window_handle, &process_id);
662
663 DCHECK(process_);
664
665 if (!thread_id || process_id != process_->GetProcess().Pid())
666 return;
667 }
668
669 ::SetParent(window_handle, parent_handle);
670 }
671 #endif
672
644 void GpuProcessHost::OnChannelConnected(int32 peer_pid) { 673 void GpuProcessHost::OnChannelConnected(int32 peer_pid) {
645 TRACE_EVENT0("gpu", "GpuProcessHost::OnChannelConnected"); 674 TRACE_EVENT0("gpu", "GpuProcessHost::OnChannelConnected");
646 675
647 while (!queued_messages_.empty()) { 676 while (!queued_messages_.empty()) {
648 Send(queued_messages_.front()); 677 Send(queued_messages_.front());
649 queued_messages_.pop(); 678 queued_messages_.pop();
650 } 679 }
651 } 680 }
652 681
653 void GpuProcessHost::EstablishGpuChannel( 682 void GpuProcessHost::EstablishGpuChannel(
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); 1198 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader");
1170 ClientIdToShaderCacheMap::iterator iter = 1199 ClientIdToShaderCacheMap::iterator iter =
1171 client_id_to_shader_cache_.find(client_id); 1200 client_id_to_shader_cache_.find(client_id);
1172 // If the cache doesn't exist then this is an off the record profile. 1201 // If the cache doesn't exist then this is an off the record profile.
1173 if (iter == client_id_to_shader_cache_.end()) 1202 if (iter == client_id_to_shader_cache_.end())
1174 return; 1203 return;
1175 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); 1204 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader);
1176 } 1205 }
1177 1206
1178 } // namespace content 1207 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698