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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
257 if (pending_nav_params_ && | 257 if (pending_nav_params_ && |
258 pending_nav_params_->global_request_id == | 258 pending_nav_params_->global_request_id == |
259 entry.transferred_global_request_id()) { | 259 entry.transferred_global_request_id()) { |
260 pending_nav_params_->cross_site_transferring_request->ReleaseRequest(); | 260 pending_nav_params_->cross_site_transferring_request->ReleaseRequest(); |
261 } | 261 } |
262 | 262 |
263 return dest_render_frame_host; | 263 return dest_render_frame_host; |
264 } | 264 } |
265 | 265 |
266 void RenderFrameHostManager::Stop() { | 266 void RenderFrameHostManager::Stop() { |
267 render_frame_host_->render_view_host()->Stop(); | 267 render_frame_host_->Stop(); |
268 | 268 |
269 // If we are cross-navigating, we should stop the pending renderers. This | 269 // If we are cross-navigating, we should stop the pending renderers. This |
270 // will lead to a DidFailProvisionalLoad, which will properly destroy them. | 270 // will lead to a DidFailProvisionalLoad, which will properly destroy them. |
271 if (cross_navigation_pending_) { | 271 if (cross_navigation_pending_) { |
272 pending_render_frame_host_->render_view_host()->Send(new ViewMsg_Stop( | 272 pending_render_frame_host_->Send(new FrameMsg_Stop( |
273 pending_render_frame_host_->render_view_host()->GetRoutingID())); | 273 pending_render_frame_host_->GetRoutingID())); |
274 } | 274 } |
275 } | 275 } |
276 | 276 |
277 void RenderFrameHostManager::SetIsLoading(bool is_loading) { | 277 void RenderFrameHostManager::SetIsLoading(bool is_loading) { |
278 render_frame_host_->render_view_host()->SetIsLoading(is_loading); | 278 render_frame_host_->render_view_host()->SetIsLoading(is_loading); |
279 if (pending_render_frame_host_) | 279 if (pending_render_frame_host_) |
280 pending_render_frame_host_->render_view_host()->SetIsLoading(is_loading); | 280 pending_render_frame_host_->render_view_host()->SetIsLoading(is_loading); |
281 } | 281 } |
282 | 282 |
283 bool RenderFrameHostManager::ShouldCloseTabOnUnresponsiveRenderer() { | 283 bool RenderFrameHostManager::ShouldCloseTabOnUnresponsiveRenderer() { |
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1537 // cancel the request. | 1537 // cancel the request. |
1538 DCHECK(!pending_render_frame_host_->are_navigations_suspended()); | 1538 DCHECK(!pending_render_frame_host_->are_navigations_suspended()); |
1539 bool is_transfer = | 1539 bool is_transfer = |
1540 entry.transferred_global_request_id() != GlobalRequestID(); | 1540 entry.transferred_global_request_id() != GlobalRequestID(); |
1541 if (is_transfer) { | 1541 if (is_transfer) { |
1542 // We don't need to stop the old renderer or run beforeunload/unload | 1542 // We don't need to stop the old renderer or run beforeunload/unload |
1543 // handlers, because those have already been done. | 1543 // handlers, because those have already been done. |
1544 DCHECK(pending_nav_params_->global_request_id == | 1544 DCHECK(pending_nav_params_->global_request_id == |
1545 entry.transferred_global_request_id()); | 1545 entry.transferred_global_request_id()); |
1546 } else { | 1546 } else { |
1547 // Also make sure the old render view stops, in case a load is in | |
1548 // progress. (We don't want to do this for transfers, since it will | |
1549 // interrupt the transfer with an unexpected DidStopLoading.) | |
1550 render_frame_host_->render_view_host()->Send(new ViewMsg_Stop( | |
Charlie Reis
2014/08/19 21:32:32
Can you remind me why this is unsafe to remove? I
nasko
2014/08/20 14:15:17
RF::OnSwapOut does the stop, but I realized that t
| |
1551 render_frame_host_->render_view_host()->GetRoutingID())); | |
1552 | |
1553 pending_render_frame_host_->SetNavigationsSuspended(true, | 1547 pending_render_frame_host_->SetNavigationsSuspended(true, |
1554 base::TimeTicks()); | 1548 base::TimeTicks()); |
1555 | 1549 |
1556 // Tell the CrossSiteRequestManager that this RFH has a pending cross-site | 1550 // Tell the CrossSiteRequestManager that this RFH has a pending cross-site |
1557 // request, so that ResourceDispatcherHost will know to tell us to run the | 1551 // request, so that ResourceDispatcherHost will know to tell us to run the |
1558 // old page's unload handler before it sends the response. | 1552 // old page's unload handler before it sends the response. |
1559 pending_render_frame_host_->SetHasPendingCrossSiteRequest(true); | 1553 pending_render_frame_host_->SetHasPendingCrossSiteRequest(true); |
1560 } | 1554 } |
1561 | 1555 |
1562 // We now have a pending RFH. | 1556 // We now have a pending RFH. |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1720 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 1714 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
1721 SiteInstance* instance) { | 1715 SiteInstance* instance) { |
1722 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 1716 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
1723 if (iter != proxy_hosts_.end()) { | 1717 if (iter != proxy_hosts_.end()) { |
1724 delete iter->second; | 1718 delete iter->second; |
1725 proxy_hosts_.erase(iter); | 1719 proxy_hosts_.erase(iter); |
1726 } | 1720 } |
1727 } | 1721 } |
1728 | 1722 |
1729 } // namespace content | 1723 } // namespace content |
OLD | NEW |