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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 if (cross_site_transferring_request_.get() && | 238 if (cross_site_transferring_request_.get() && |
239 cross_site_transferring_request_->request_id() == | 239 cross_site_transferring_request_->request_id() == |
240 entry.transferred_global_request_id()) { | 240 entry.transferred_global_request_id()) { |
241 cross_site_transferring_request_->ReleaseRequest(); | 241 cross_site_transferring_request_->ReleaseRequest(); |
242 } | 242 } |
243 | 243 |
244 return dest_render_frame_host; | 244 return dest_render_frame_host; |
245 } | 245 } |
246 | 246 |
247 void RenderFrameHostManager::Stop() { | 247 void RenderFrameHostManager::Stop() { |
248 render_frame_host_->render_view_host()->Stop(); | 248 render_frame_host_->Stop(); |
249 | 249 |
250 // If we are cross-navigating, we should stop the pending renderers. This | 250 // If we are cross-navigating, we should stop the pending renderers. This |
251 // will lead to a DidFailProvisionalLoad, which will properly destroy them. | 251 // will lead to a DidFailProvisionalLoad, which will properly destroy them. |
252 if (cross_navigation_pending_) { | 252 if (cross_navigation_pending_) { |
253 pending_render_frame_host_->render_view_host()->Send(new ViewMsg_Stop( | 253 pending_render_frame_host_->Send(new FrameMsg_Stop( |
254 pending_render_frame_host_->render_view_host()->GetRoutingID())); | 254 pending_render_frame_host_->GetRoutingID())); |
255 } | 255 } |
256 } | 256 } |
257 | 257 |
258 void RenderFrameHostManager::SetIsLoading(bool is_loading) { | 258 void RenderFrameHostManager::SetIsLoading(bool is_loading) { |
259 render_frame_host_->render_view_host()->SetIsLoading(is_loading); | 259 render_frame_host_->render_view_host()->SetIsLoading(is_loading); |
260 if (pending_render_frame_host_) | 260 if (pending_render_frame_host_) |
261 pending_render_frame_host_->render_view_host()->SetIsLoading(is_loading); | 261 pending_render_frame_host_->render_view_host()->SetIsLoading(is_loading); |
262 } | 262 } |
263 | 263 |
264 bool RenderFrameHostManager::ShouldCloseTabOnUnresponsiveRenderer() { | 264 bool RenderFrameHostManager::ShouldCloseTabOnUnresponsiveRenderer() { |
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1475 entry.transferred_global_request_id() != GlobalRequestID(); | 1475 entry.transferred_global_request_id() != GlobalRequestID(); |
1476 if (is_transfer) { | 1476 if (is_transfer) { |
1477 // We don't need to stop the old renderer or run beforeunload/unload | 1477 // We don't need to stop the old renderer or run beforeunload/unload |
1478 // handlers, because those have already been done. | 1478 // handlers, because those have already been done. |
1479 DCHECK(cross_site_transferring_request_->request_id() == | 1479 DCHECK(cross_site_transferring_request_->request_id() == |
1480 entry.transferred_global_request_id()); | 1480 entry.transferred_global_request_id()); |
1481 } else { | 1481 } else { |
1482 // Also make sure the old render view stops, in case a load is in | 1482 // Also make sure the old render view stops, in case a load is in |
1483 // progress. (We don't want to do this for transfers, since it will | 1483 // progress. (We don't want to do this for transfers, since it will |
1484 // interrupt the transfer with an unexpected DidStopLoading.) | 1484 // interrupt the transfer with an unexpected DidStopLoading.) |
1485 render_frame_host_->render_view_host()->Send(new ViewMsg_Stop( | 1485 render_frame_host_->Send(new FrameMsg_Stop( |
1486 render_frame_host_->render_view_host()->GetRoutingID())); | 1486 render_frame_host_->GetRoutingID())); |
1487 | |
1488 pending_render_frame_host_->SetNavigationsSuspended(true, | 1487 pending_render_frame_host_->SetNavigationsSuspended(true, |
1489 base::TimeTicks()); | 1488 base::TimeTicks()); |
1490 } | 1489 } |
1491 | 1490 |
1492 // We now have a pending RFH. | 1491 // We now have a pending RFH. |
1493 DCHECK(!cross_navigation_pending_); | 1492 DCHECK(!cross_navigation_pending_); |
1494 cross_navigation_pending_ = true; | 1493 cross_navigation_pending_ = true; |
1495 | 1494 |
1496 // Unless we are transferring an existing request, we should now | 1495 // Unless we are transferring an existing request, we should now |
1497 // tell the old render view to run its beforeunload handler, since it | 1496 // tell the old render view to run its beforeunload handler, since it |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1650 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 1649 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
1651 SiteInstance* instance) { | 1650 SiteInstance* instance) { |
1652 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 1651 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
1653 if (iter != proxy_hosts_.end()) { | 1652 if (iter != proxy_hosts_.end()) { |
1654 delete iter->second; | 1653 delete iter->second; |
1655 proxy_hosts_.erase(iter); | 1654 proxy_hosts_.erase(iter); |
1656 } | 1655 } |
1657 } | 1656 } |
1658 | 1657 |
1659 } // namespace content | 1658 } // namespace content |
OLD | NEW |