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

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: 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 5b891f5487de5e086e1618da88c14d677e59a059..e93737f8292d34be976562bed748dc685b3f7a96 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*>(
Charlie Reis 2015/01/23 06:01:32 We shouldn't need this cast. Just return RenderFr
clamy 2015/01/26 16:38:40 WebContentsImpl::GetMainFrame returns a RenderFram
Charlie Reis 2015/01/29 23:20:40 You can make WebContentsImpl::GetMainFrame return
+ GetMainFrame())->SuddenTerminationAllowed();
}
void WebContentsImpl::DispatchBeforeUnload(bool for_cross_site_transition) {
@@ -4025,7 +4025,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);
if (!GetRenderManager()->ShouldCloseTabOnUnresponsiveRenderer())
return;

Powered by Google App Engine
This is Rietveld 408576698