OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/render_frame_host_manager.h" | 5 #include "content/browser/frame_host/render_frame_host_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
658 | 658 |
659 // If the SiteInstance for the pending RFH is being used by others don't | 659 // If the SiteInstance for the pending RFH is being used by others don't |
660 // delete the RFH. Just swap it out and it can be reused at a later point. | 660 // delete the RFH. Just swap it out and it can be reused at a later point. |
661 SiteInstanceImpl* site_instance = render_frame_host->GetSiteInstance(); | 661 SiteInstanceImpl* site_instance = render_frame_host->GetSiteInstance(); |
662 if (site_instance->HasSite() && site_instance->active_frame_count() > 1) { | 662 if (site_instance->HasSite() && site_instance->active_frame_count() > 1) { |
663 // Any currently suspended navigations are no longer needed. | 663 // Any currently suspended navigations are no longer needed. |
664 render_frame_host->CancelSuspendedNavigations(); | 664 render_frame_host->CancelSuspendedNavigations(); |
665 | 665 |
666 RenderFrameProxyHost* proxy = | 666 RenderFrameProxyHost* proxy = |
667 new RenderFrameProxyHost(site_instance, frame_tree_node_); | 667 new RenderFrameProxyHost(site_instance, frame_tree_node_); |
668 CHECK(!GetRenderFrameProxyHost(site_instance)); | |
clamy
2015/04/14 15:32:04
Maybe move the CHECK above the creation of the new
carlosk
2015/04/23 16:10:13
Done.
| |
668 proxy_hosts_[site_instance->GetId()] = proxy; | 669 proxy_hosts_[site_instance->GetId()] = proxy; |
669 | 670 |
670 // Check if the RenderFrameHost is already swapped out, to avoid swapping it | 671 // Check if the RenderFrameHost is already swapped out, to avoid swapping it |
671 // out again. | 672 // out again. |
672 if (!render_frame_host->is_swapped_out()) | 673 if (!render_frame_host->is_swapped_out()) |
673 render_frame_host->SwapOut(proxy, false); | 674 render_frame_host->SwapOut(proxy, false); |
674 | 675 |
675 if (frame_tree_node_->IsMainFrame()) | 676 if (frame_tree_node_->IsMainFrame()) |
676 proxy->TakeFrameHostOwnership(render_frame_host.Pass()); | 677 proxy->TakeFrameHostOwnership(render_frame_host.Pass()); |
677 } else { | 678 } else { |
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2085 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 2086 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
2086 SiteInstance* instance) { | 2087 SiteInstance* instance) { |
2087 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 2088 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
2088 if (iter != proxy_hosts_.end()) { | 2089 if (iter != proxy_hosts_.end()) { |
2089 delete iter->second; | 2090 delete iter->second; |
2090 proxy_hosts_.erase(iter); | 2091 proxy_hosts_.erase(iter); |
2091 } | 2092 } |
2092 } | 2093 } |
2093 | 2094 |
2094 } // namespace content | 2095 } // namespace content |
OLD | NEW |