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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 857213003: Refactor sudden termination (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Charlie's comments Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index ff003ddb3c808f2ecd7ce45abb86207620d9d2bd..a4b3a4c6e773520cc0945810b12d3656512cbd9d 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1101,8 +1101,8 @@ bool WebContentsImpl::NeedToFireBeforeUnload() {
// TODO(creis): Should we fire even for interstitial pages?
return WillNotifyDisconnection() &&
!ShowingInterstitialPage() &&
- !static_cast<RenderViewHostImpl*>(
- GetRenderViewHost())->SuddenTerminationAllowed();
+ !static_cast<RenderFrameHostImpl*>(
+ GetMainFrame())->SuddenTerminationAllowed();
Charlie Reis 2015/01/29 23:20:41 This doesn't seem quite right to me. What if the
clamy 2015/02/02 16:16:27 RenderFrameHostImpl::DispatchBeforeUnload skips ex
}
void WebContentsImpl::DispatchBeforeUnload(bool for_cross_site_transition) {
@@ -4035,7 +4035,7 @@ void WebContentsImpl::RendererUnresponsive(RenderViewHost* render_view_host) {
rfhi->IsWaitingForUnloadACK()) {
// Hang occurred while firing the beforeunload/unload handler.
// Pretend the handler fired so tab closing continues as if it had.
- rvhi->set_sudden_termination_allowed(true);
+ rfhi->set_override_sudden_termination_status(true);
Charlie Reis 2015/01/29 23:20:42 Again, this is only the main frame. We'll eventua
clamy 2015/02/02 16:16:27 Done.
if (!GetRenderManager()->ShouldCloseTabOnUnresponsiveRenderer())
return;

Powered by Google App Engine
This is Rietveld 408576698