Chromium Code Reviews| 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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 base::UserMetricsAction("ProcessSwapBindingsMismatch_RVHM")); | 158 base::UserMetricsAction("ProcessSwapBindingsMismatch_RVHM")); |
| 159 pending_web_ui_.reset(); | 159 pending_web_ui_.reset(); |
| 160 } | 160 } |
| 161 } | 161 } |
| 162 | 162 |
| 163 RenderFrameHostImpl* RenderFrameHostManager::Navigate( | 163 RenderFrameHostImpl* RenderFrameHostManager::Navigate( |
| 164 const NavigationEntryImpl& entry) { | 164 const NavigationEntryImpl& entry) { |
| 165 TRACE_EVENT0("browser", "RenderFrameHostManager:Navigate"); | 165 TRACE_EVENT0("browser", "RenderFrameHostManager:Navigate"); |
| 166 // Create a pending RenderFrameHost to use for the navigation. | 166 // Create a pending RenderFrameHost to use for the navigation. |
| 167 RenderFrameHostImpl* dest_render_frame_host = | 167 RenderFrameHostImpl* dest_render_frame_host = |
| 168 UpdateRendererStateForNavigate(entry); | 168 UpdateStateForNavigate(entry); |
|
Charlie Reis
2014/04/29 21:32:09
This can fit on the previous line now, right?
nasko
2014/04/29 21:34:17
Done.
| |
| 169 if (!dest_render_frame_host) | 169 if (!dest_render_frame_host) |
| 170 return NULL; // We weren't able to create a pending render frame host. | 170 return NULL; // We weren't able to create a pending render frame host. |
| 171 | 171 |
| 172 // If the current render_frame_host_ isn't live, we should create it so | 172 // If the current render_frame_host_ isn't live, we should create it so |
| 173 // that we don't show a sad tab while the dest_render_frame_host fetches | 173 // that we don't show a sad tab while the dest_render_frame_host fetches |
| 174 // its first page. (Bug 1145340) | 174 // its first page. (Bug 1145340) |
| 175 if (dest_render_frame_host != render_frame_host_ && | 175 if (dest_render_frame_host != render_frame_host_ && |
| 176 !render_frame_host_->render_view_host()->IsRenderViewLive()) { | 176 !render_frame_host_->render_view_host()->IsRenderViewLive()) { |
| 177 // Note: we don't call InitRenderView here because we are navigating away | 177 // Note: we don't call InitRenderView here because we are navigating away |
| 178 // soon anyway, and we don't have the NavigationEntry for this host. | 178 // soon anyway, and we don't have the NavigationEntry for this host. |
| (...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1161 // This deletes all RenderFrameHosts using the |rvh|, which then causes | 1161 // This deletes all RenderFrameHosts using the |rvh|, which then causes |
| 1162 // |rvh| to Shutdown. | 1162 // |rvh| to Shutdown. |
| 1163 FrameTree* tree = rvh->GetDelegate()->GetFrameTree(); | 1163 FrameTree* tree = rvh->GetDelegate()->GetFrameTree(); |
| 1164 tree->ForEach(base::Bind( | 1164 tree->ForEach(base::Bind( |
| 1165 &RenderFrameHostManager::ClearProxiesInSiteInstance, | 1165 &RenderFrameHostManager::ClearProxiesInSiteInstance, |
| 1166 site_instance_id)); | 1166 site_instance_id)); |
| 1167 } | 1167 } |
| 1168 } | 1168 } |
| 1169 } | 1169 } |
| 1170 | 1170 |
| 1171 RenderFrameHostImpl* RenderFrameHostManager::UpdateRendererStateForNavigate( | 1171 RenderFrameHostImpl* RenderFrameHostManager::UpdateStateForNavigate( |
| 1172 const NavigationEntryImpl& entry) { | 1172 const NavigationEntryImpl& entry) { |
| 1173 // If we are currently navigating cross-process, we want to get back to normal | 1173 // If we are currently navigating cross-process, we want to get back to normal |
| 1174 // and then navigate as usual. | 1174 // and then navigate as usual. |
| 1175 if (cross_navigation_pending_) { | 1175 if (cross_navigation_pending_) { |
| 1176 if (pending_render_frame_host_) | 1176 if (pending_render_frame_host_) |
| 1177 CancelPending(); | 1177 CancelPending(); |
| 1178 cross_navigation_pending_ = false; | 1178 cross_navigation_pending_ = false; |
| 1179 } | 1179 } |
| 1180 | 1180 |
| 1181 // render_frame_host_'s SiteInstance and new_instance will not be deleted | 1181 // render_frame_host_'s SiteInstance and new_instance will not be deleted |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1425 SiteInstance* instance) const { | 1425 SiteInstance* instance) const { |
| 1426 RenderFrameProxyHostMap::const_iterator iter = | 1426 RenderFrameProxyHostMap::const_iterator iter = |
| 1427 proxy_hosts_.find(instance->GetId()); | 1427 proxy_hosts_.find(instance->GetId()); |
| 1428 if (iter != proxy_hosts_.end()) | 1428 if (iter != proxy_hosts_.end()) |
| 1429 return iter->second; | 1429 return iter->second; |
| 1430 | 1430 |
| 1431 return NULL; | 1431 return NULL; |
| 1432 } | 1432 } |
| 1433 | 1433 |
| 1434 } // namespace content | 1434 } // namespace content |
| OLD | NEW |