Chromium Code Reviews| 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. |
|
nasko
2012/09/20 22:18:04
nit: You can put in crbug.com/150855 for my TODO.
Charlie Reis
2012/09/20 23:25:38
Done.
| |
| 264 if (iter->second != pending_render_view_host_) { | |
| 265 iter->second->UpdateFrameTree( | |
| 266 render_view_host_impl->GetProcess()->GetID(), | |
| 267 render_view_host_impl->GetRoutingID(), | |
| 268 render_view_host_impl->frame_tree()); | |
| 269 } | |
| 264 } | 270 } |
| 265 } | 271 } |
| 266 | 272 |
| 267 void RenderViewHostManager::SetWebUIPostCommit(WebUIImpl* web_ui) { | 273 void RenderViewHostManager::SetWebUIPostCommit(WebUIImpl* web_ui) { |
| 268 DCHECK(!web_ui_.get()); | 274 DCHECK(!web_ui_.get()); |
| 269 web_ui_.reset(web_ui); | 275 web_ui_.reset(web_ui); |
| 270 } | 276 } |
| 271 | 277 |
| 272 void RenderViewHostManager::RendererAbortedProvisionalLoad( | 278 void RenderViewHostManager::RendererAbortedProvisionalLoad( |
| 273 RenderViewHost* render_view_host) { | 279 RenderViewHost* render_view_host) { |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 964 } | 970 } |
| 965 | 971 |
| 966 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost( | 972 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost( |
| 967 SiteInstance* instance) { | 973 SiteInstance* instance) { |
| 968 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId()); | 974 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId()); |
| 969 if (iter != swapped_out_hosts_.end()) | 975 if (iter != swapped_out_hosts_.end()) |
| 970 return iter->second; | 976 return iter->second; |
| 971 | 977 |
| 972 return NULL; | 978 return NULL; |
| 973 } | 979 } |
| OLD | NEW |