Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 632043002: Revert of Remove stale RFHM check now that unload runs in the background. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 } 273 }
274 274
275 bool RenderFrameHostManager::ShouldCloseTabOnUnresponsiveRenderer() { 275 bool RenderFrameHostManager::ShouldCloseTabOnUnresponsiveRenderer() {
276 if (!cross_navigation_pending_) 276 if (!cross_navigation_pending_)
277 return true; 277 return true;
278 278
279 // We should always have a pending RFH when there's a cross-process navigation 279 // We should always have a pending RFH when there's a cross-process navigation
280 // in progress. Sanity check this for http://crbug.com/276333. 280 // in progress. Sanity check this for http://crbug.com/276333.
281 CHECK(pending_render_frame_host_); 281 CHECK(pending_render_frame_host_);
282 282
283 // Unload handlers run in the background, so we should never get an 283 // If the tab becomes unresponsive during {before}unload while doing a
284 // unresponsiveness warning for them.
285 CHECK(!render_frame_host_->IsWaitingForUnloadACK());
286
287 // If the tab becomes unresponsive during beforeunload while doing a
288 // cross-site navigation, proceed with the navigation. (This assumes that 284 // cross-site navigation, proceed with the navigation. (This assumes that
289 // the pending RenderFrameHost is still responsive.) 285 // the pending RenderFrameHost is still responsive.)
290 if (render_frame_host_->is_waiting_for_beforeunload_ack()) { 286 if (render_frame_host_->IsWaitingForUnloadACK()) {
287 // The request has been started and paused while we're waiting for the
288 // unload handler to finish. We'll pretend that it did. The pending
289 // renderer will then be swapped in as part of the usual DidNavigate logic.
290 // (If the unload handler later finishes, this call will be ignored because
291 // the pending_nav_params_ state will already be cleaned up.)
292 current_frame_host()->OnSwappedOut();
293 } else if (render_frame_host_->is_waiting_for_beforeunload_ack()) {
291 // Haven't gotten around to starting the request, because we're still 294 // Haven't gotten around to starting the request, because we're still
292 // waiting for the beforeunload handler to finish. We'll pretend that it 295 // waiting for the beforeunload handler to finish. We'll pretend that it
293 // did finish, to let the navigation proceed. Note that there's a danger 296 // did finish, to let the navigation proceed. Note that there's a danger
294 // that the beforeunload handler will later finish and possibly return 297 // that the beforeunload handler will later finish and possibly return
295 // false (meaning the navigation should not proceed), but we'll ignore it 298 // false (meaning the navigation should not proceed), but we'll ignore it
296 // in this case because it took too long. 299 // in this case because it took too long.
297 if (pending_render_frame_host_->are_navigations_suspended()) { 300 if (pending_render_frame_host_->are_navigations_suspended()) {
298 pending_render_frame_host_->SetNavigationsSuspended( 301 pending_render_frame_host_->SetNavigationsSuspended(
299 false, base::TimeTicks::Now()); 302 false, base::TimeTicks::Now());
300 } 303 }
(...skipping 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1705 void RenderFrameHostManager::DeleteRenderFrameProxyHost( 1708 void RenderFrameHostManager::DeleteRenderFrameProxyHost(
1706 SiteInstance* instance) { 1709 SiteInstance* instance) {
1707 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); 1710 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId());
1708 if (iter != proxy_hosts_.end()) { 1711 if (iter != proxy_hosts_.end()) {
1709 delete iter->second; 1712 delete iter->second;
1710 proxy_hosts_.erase(iter); 1713 proxy_hosts_.erase(iter);
1711 } 1714 }
1712 } 1715 }
1713 1716
1714 } // namespace content 1717 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698