| 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 if (cross_site_transferring_request_.get() && | 239 if (cross_site_transferring_request_.get() && |
| 240 cross_site_transferring_request_->request_id() == | 240 cross_site_transferring_request_->request_id() == |
| 241 entry.transferred_global_request_id()) { | 241 entry.transferred_global_request_id()) { |
| 242 cross_site_transferring_request_->ReleaseRequest(); | 242 cross_site_transferring_request_->ReleaseRequest(); |
| 243 } | 243 } |
| 244 | 244 |
| 245 return dest_render_frame_host; | 245 return dest_render_frame_host; |
| 246 } | 246 } |
| 247 | 247 |
| 248 void RenderFrameHostManager::Stop() { | 248 void RenderFrameHostManager::Stop() { |
| 249 render_frame_host_->render_view_host()->Stop(); | 249 render_frame_host_->Stop(); |
| 250 | 250 |
| 251 // If we are cross-navigating, we should stop the pending renderers. This | 251 // If we are cross-navigating, we should stop the pending renderers. This |
| 252 // will lead to a DidFailProvisionalLoad, which will properly destroy them. | 252 // will lead to a DidFailProvisionalLoad, which will properly destroy them. |
| 253 if (cross_navigation_pending_) { | 253 if (cross_navigation_pending_) { |
| 254 pending_render_frame_host_->render_view_host()->Send(new ViewMsg_Stop( | 254 pending_render_frame_host_->Send(new FrameMsg_Stop( |
| 255 pending_render_frame_host_->render_view_host()->GetRoutingID())); | 255 pending_render_frame_host_->GetRoutingID())); |
| 256 } | 256 } |
| 257 } | 257 } |
| 258 | 258 |
| 259 void RenderFrameHostManager::SetIsLoading(bool is_loading) { | 259 void RenderFrameHostManager::SetIsLoading(bool is_loading) { |
| 260 render_frame_host_->render_view_host()->SetIsLoading(is_loading); | 260 render_frame_host_->render_view_host()->SetIsLoading(is_loading); |
| 261 if (pending_render_frame_host_) | 261 if (pending_render_frame_host_) |
| 262 pending_render_frame_host_->render_view_host()->SetIsLoading(is_loading); | 262 pending_render_frame_host_->render_view_host()->SetIsLoading(is_loading); |
| 263 } | 263 } |
| 264 | 264 |
| 265 bool RenderFrameHostManager::ShouldCloseTabOnUnresponsiveRenderer() { | 265 bool RenderFrameHostManager::ShouldCloseTabOnUnresponsiveRenderer() { |
| (...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1496 entry.transferred_global_request_id() != GlobalRequestID(); | 1496 entry.transferred_global_request_id() != GlobalRequestID(); |
| 1497 if (is_transfer) { | 1497 if (is_transfer) { |
| 1498 // We don't need to stop the old renderer or run beforeunload/unload | 1498 // We don't need to stop the old renderer or run beforeunload/unload |
| 1499 // handlers, because those have already been done. | 1499 // handlers, because those have already been done. |
| 1500 DCHECK(cross_site_transferring_request_->request_id() == | 1500 DCHECK(cross_site_transferring_request_->request_id() == |
| 1501 entry.transferred_global_request_id()); | 1501 entry.transferred_global_request_id()); |
| 1502 } else { | 1502 } else { |
| 1503 // Also make sure the old render view stops, in case a load is in | 1503 // Also make sure the old render view stops, in case a load is in |
| 1504 // progress. (We don't want to do this for transfers, since it will | 1504 // progress. (We don't want to do this for transfers, since it will |
| 1505 // interrupt the transfer with an unexpected DidStopLoading.) | 1505 // interrupt the transfer with an unexpected DidStopLoading.) |
| 1506 render_frame_host_->render_view_host()->Send(new ViewMsg_Stop( | 1506 render_frame_host_->Send(new FrameMsg_Stop( |
| 1507 render_frame_host_->render_view_host()->GetRoutingID())); | 1507 render_frame_host_->GetRoutingID())); |
| 1508 | |
| 1509 pending_render_frame_host_->SetNavigationsSuspended(true, | 1508 pending_render_frame_host_->SetNavigationsSuspended(true, |
| 1510 base::TimeTicks()); | 1509 base::TimeTicks()); |
| 1511 } | 1510 } |
| 1512 | 1511 |
| 1513 // We now have a pending RFH. | 1512 // We now have a pending RFH. |
| 1514 DCHECK(!cross_navigation_pending_); | 1513 DCHECK(!cross_navigation_pending_); |
| 1515 cross_navigation_pending_ = true; | 1514 cross_navigation_pending_ = true; |
| 1516 | 1515 |
| 1517 // Unless we are transferring an existing request, we should now | 1516 // Unless we are transferring an existing request, we should now |
| 1518 // tell the old render view to run its beforeunload handler, since it | 1517 // tell the old render view to run its beforeunload handler, since it |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1673 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 1672 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
| 1674 SiteInstance* instance) { | 1673 SiteInstance* instance) { |
| 1675 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 1674 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
| 1676 if (iter != proxy_hosts_.end()) { | 1675 if (iter != proxy_hosts_.end()) { |
| 1677 delete iter->second; | 1676 delete iter->second; |
| 1678 proxy_hosts_.erase(iter); | 1677 proxy_hosts_.erase(iter); |
| 1679 } | 1678 } |
| 1680 } | 1679 } |
| 1681 | 1680 |
| 1682 } // namespace content | 1681 } // namespace content |
| OLD | NEW |