| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 RenderFrameProxyHost* proxy = GetRenderFrameProxyHost(site_instance); | 1052 RenderFrameProxyHost* proxy = GetRenderFrameProxyHost(site_instance); |
| 1053 CHECK(proxy); | 1053 CHECK(proxy); |
| 1054 | 1054 |
| 1055 DeleteRenderFrameProxyHost(site_instance); | 1055 DeleteRenderFrameProxyHost(site_instance); |
| 1056 } | 1056 } |
| 1057 | 1057 |
| 1058 RenderFrameProxyHost* RenderFrameHostManager::CreateRenderFrameProxyHost( | 1058 RenderFrameProxyHost* RenderFrameHostManager::CreateRenderFrameProxyHost( |
| 1059 SiteInstance* site_instance, | 1059 SiteInstance* site_instance, |
| 1060 RenderViewHostImpl* rvh) { | 1060 RenderViewHostImpl* rvh) { |
| 1061 int site_instance_id = site_instance->GetId(); | 1061 int site_instance_id = site_instance->GetId(); |
| 1062 CHECK(proxy_hosts_.find(site_instance_id) == proxy_hosts_.end()) | 1062 // A proxy already existed for this SiteInstance. |
| 1063 << "A proxy already existed for this SiteInstance."; | 1063 CHECK(proxy_hosts_.find(site_instance_id) == proxy_hosts_.end()); |
| 1064 RenderFrameProxyHost* proxy_host = | 1064 RenderFrameProxyHost* proxy_host = |
| 1065 new RenderFrameProxyHost(site_instance, rvh, frame_tree_node_); | 1065 new RenderFrameProxyHost(site_instance, rvh, frame_tree_node_); |
| 1066 proxy_hosts_[site_instance_id] = base::WrapUnique(proxy_host); | 1066 proxy_hosts_[site_instance_id] = base::WrapUnique(proxy_host); |
| 1067 static_cast<SiteInstanceImpl*>(site_instance)->AddObserver(this); | 1067 static_cast<SiteInstanceImpl*>(site_instance)->AddObserver(this); |
| 1068 return proxy_host; | 1068 return proxy_host; |
| 1069 } | 1069 } |
| 1070 | 1070 |
| 1071 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 1071 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
| 1072 SiteInstance* site_instance) { | 1072 SiteInstance* site_instance) { |
| 1073 static_cast<SiteInstanceImpl*>(site_instance)->RemoveObserver(this); | 1073 static_cast<SiteInstanceImpl*>(site_instance)->RemoveObserver(this); |
| (...skipping 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2736 resolved_url)) { | 2736 resolved_url)) { |
| 2737 DCHECK(!dest_instance || | 2737 DCHECK(!dest_instance || |
| 2738 dest_instance == render_frame_host_->GetSiteInstance()); | 2738 dest_instance == render_frame_host_->GetSiteInstance()); |
| 2739 return false; | 2739 return false; |
| 2740 } | 2740 } |
| 2741 | 2741 |
| 2742 return true; | 2742 return true; |
| 2743 } | 2743 } |
| 2744 | 2744 |
| 2745 } // namespace content | 2745 } // namespace content |
| OLD | NEW |