OLD | NEW |
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 "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 #if defined(TOOLKIT_GTK) | 681 #if defined(TOOLKIT_GTK) |
682 SurfaceRefMap::iterator it = surface_refs_.find(surface_id); | 682 SurfaceRefMap::iterator it = surface_refs_.find(surface_id); |
683 if (it != surface_refs_.end()) | 683 if (it != surface_refs_.end()) |
684 surface_refs_.erase(it); | 684 surface_refs_.erase(it); |
685 #endif // defined(TOOLKIT_GTK) | 685 #endif // defined(TOOLKIT_GTK) |
686 } | 686 } |
687 | 687 |
688 void GpuProcessHost::OnImageCreated(const gfx::Size size) { | 688 void GpuProcessHost::OnImageCreated(const gfx::Size size) { |
689 TRACE_EVENT0("gpu", "GpuProcessHost::OnImageCreated"); | 689 TRACE_EVENT0("gpu", "GpuProcessHost::OnImageCreated"); |
690 | 690 |
691 if (!create_image_requests_.empty()) | 691 if (create_image_requests_.empty()) |
692 return; | 692 return; |
693 | 693 |
694 CreateImageCallback callback = create_image_requests_.front(); | 694 CreateImageCallback callback = create_image_requests_.front(); |
695 create_image_requests_.pop(); | 695 create_image_requests_.pop(); |
696 callback.Run(size); | 696 callback.Run(size); |
697 } | 697 } |
698 | 698 |
699 void GpuProcessHost::OnDidCreateOffscreenContext(const GURL& url) { | 699 void GpuProcessHost::OnDidCreateOffscreenContext(const GURL& url) { |
700 urls_with_live_offscreen_contexts_.insert(url); | 700 urls_with_live_offscreen_contexts_.insert(url); |
701 } | 701 } |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 void GpuProcessHost::BlockLiveOffscreenContexts() { | 1043 void GpuProcessHost::BlockLiveOffscreenContexts() { |
1044 for (std::multiset<GURL>::iterator iter = | 1044 for (std::multiset<GURL>::iterator iter = |
1045 urls_with_live_offscreen_contexts_.begin(); | 1045 urls_with_live_offscreen_contexts_.begin(); |
1046 iter != urls_with_live_offscreen_contexts_.end(); ++iter) { | 1046 iter != urls_with_live_offscreen_contexts_.end(); ++iter) { |
1047 GpuDataManagerImpl::GetInstance()->BlockDomainFrom3DAPIs( | 1047 GpuDataManagerImpl::GetInstance()->BlockDomainFrom3DAPIs( |
1048 *iter, GpuDataManagerImpl::DOMAIN_GUILT_UNKNOWN); | 1048 *iter, GpuDataManagerImpl::DOMAIN_GUILT_UNKNOWN); |
1049 } | 1049 } |
1050 } | 1050 } |
1051 | 1051 |
1052 } // namespace content | 1052 } // namespace content |
OLD | NEW |