| 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/web_contents/render_view_host_manager.h" | 5 #include "content/browser/web_contents/render_view_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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 250 |
| 251 RenderViewHostImpl* render_view_host_impl = static_cast<RenderViewHostImpl*>( | 251 RenderViewHostImpl* render_view_host_impl = static_cast<RenderViewHostImpl*>( |
| 252 render_view_host); | 252 render_view_host); |
| 253 | 253 |
| 254 for (RenderViewHostMap::iterator iter = swapped_out_hosts_.begin(); | 254 for (RenderViewHostMap::iterator iter = swapped_out_hosts_.begin(); |
| 255 iter != swapped_out_hosts_.end(); | 255 iter != swapped_out_hosts_.end(); |
| 256 ++iter) { | 256 ++iter) { |
| 257 DCHECK_NE(iter->second->GetSiteInstance(), | 257 DCHECK_NE(iter->second->GetSiteInstance(), |
| 258 current_host()->GetSiteInstance()); | 258 current_host()->GetSiteInstance()); |
| 259 | 259 |
| 260 iter->second->UpdateFrameTree( | 260 // Send updates to the other swapped out RVHs, unless it's the pending RVH |
| 261 render_view_host_impl->GetProcess()->GetID(), | 261 // (which is in the process of navigating). |
| 262 render_view_host_impl->GetRoutingID(), | 262 // TODO(creis): Remove the pending RVH from swapped_out_hosts_. |
| 263 render_view_host_impl->frame_tree()); | 263 // TODO(nasko): Don't send updates across BrowsingInstances. |
| 264 // See http://crbug.com/150855. |
| 265 if (iter->second != pending_render_view_host_) { |
| 266 iter->second->UpdateFrameTree( |
| 267 render_view_host_impl->GetProcess()->GetID(), |
| 268 render_view_host_impl->GetRoutingID(), |
| 269 render_view_host_impl->frame_tree()); |
| 270 } |
| 264 } | 271 } |
| 265 } | 272 } |
| 266 | 273 |
| 267 void RenderViewHostManager::SetWebUIPostCommit(WebUIImpl* web_ui) { | 274 void RenderViewHostManager::SetWebUIPostCommit(WebUIImpl* web_ui) { |
| 268 DCHECK(!web_ui_.get()); | 275 DCHECK(!web_ui_.get()); |
| 269 web_ui_.reset(web_ui); | 276 web_ui_.reset(web_ui); |
| 270 } | 277 } |
| 271 | 278 |
| 272 void RenderViewHostManager::RendererAbortedProvisionalLoad( | 279 void RenderViewHostManager::RendererAbortedProvisionalLoad( |
| 273 RenderViewHost* render_view_host) { | 280 RenderViewHost* render_view_host) { |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 } | 971 } |
| 965 | 972 |
| 966 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost( | 973 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost( |
| 967 SiteInstance* instance) { | 974 SiteInstance* instance) { |
| 968 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId()); | 975 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId()); |
| 969 if (iter != swapped_out_hosts_.end()) | 976 if (iter != swapped_out_hosts_.end()) |
| 970 return iter->second; | 977 return iter->second; |
| 971 | 978 |
| 972 return NULL; | 979 return NULL; |
| 973 } | 980 } |
| OLD | NEW |