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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 } | 232 } |
233 } | 233 } |
234 | 234 |
235 void RenderFrameHostManager::SetIsLoading(bool is_loading) { | 235 void RenderFrameHostManager::SetIsLoading(bool is_loading) { |
236 render_frame_host_->render_view_host()->SetIsLoading(is_loading); | 236 render_frame_host_->render_view_host()->SetIsLoading(is_loading); |
237 if (pending_render_frame_host_) | 237 if (pending_render_frame_host_) |
238 pending_render_frame_host_->render_view_host()->SetIsLoading(is_loading); | 238 pending_render_frame_host_->render_view_host()->SetIsLoading(is_loading); |
239 } | 239 } |
240 | 240 |
241 bool RenderFrameHostManager::ShouldCloseTabOnUnresponsiveRenderer() { | 241 bool RenderFrameHostManager::ShouldCloseTabOnUnresponsiveRenderer() { |
242 if (!cross_navigation_pending_) | 242 // If we're waiting for a close ACK, then the tab should close whether there's |
| 243 // a navigation in progress or not. Unfortunately, we also need to check for |
| 244 // cases that we arrive here with no navigation in progress, since there are |
| 245 // some tab closure paths that don't set is_waiting_for_close_ack to true. |
| 246 // TODO(creis): Clean this up in http://crbug.com/418266. |
| 247 if (!cross_navigation_pending_ || |
| 248 render_frame_host_->render_view_host()->is_waiting_for_close_ack()) |
243 return true; | 249 return true; |
244 | 250 |
245 // We should always have a pending RFH when there's a cross-process navigation | 251 // We should always have a pending RFH when there's a cross-process navigation |
246 // in progress. Sanity check this for http://crbug.com/276333. | 252 // in progress. Sanity check this for http://crbug.com/276333. |
247 CHECK(pending_render_frame_host_); | 253 CHECK(pending_render_frame_host_); |
248 | 254 |
249 // Unload handlers run in the background, so we should never get an | 255 // Unload handlers run in the background, so we should never get an |
250 // unresponsiveness warning for them. | 256 // unresponsiveness warning for them. |
251 CHECK(!render_frame_host_->IsWaitingForUnloadACK()); | 257 CHECK(!render_frame_host_->IsWaitingForUnloadACK()); |
252 | 258 |
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1588 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 1594 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
1589 SiteInstance* instance) { | 1595 SiteInstance* instance) { |
1590 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 1596 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
1591 if (iter != proxy_hosts_.end()) { | 1597 if (iter != proxy_hosts_.end()) { |
1592 delete iter->second; | 1598 delete iter->second; |
1593 proxy_hosts_.erase(iter); | 1599 proxy_hosts_.erase(iter); |
1594 } | 1600 } |
1595 } | 1601 } |
1596 | 1602 |
1597 } // namespace content | 1603 } // namespace content |
OLD | NEW |