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

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

Issue 1968933002: Fix: tabs slow to response to beforeunload are closed prematurely. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revisited solution Created 4 years, 7 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 3362cc1b63417be749ef6832eabd73c03b175083..9779af39ede349e55b19f490bf760b1c63f1f7ef 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4552,7 +4552,6 @@ void WebContentsImpl::RendererUnresponsive(
// See http://crbug.com/65458
if (DevToolsAgentHost::IsDebuggerAttached(this))
return;
-
if (rfhi->is_waiting_for_beforeunload_ack() ||
rfhi->IsWaitingForUnloadACK()) {
// Hang occurred while firing the beforeunload/unload handler.
@@ -4571,6 +4570,10 @@ void WebContentsImpl::RendererUnresponsive(
bool close = true;
if (rfhi->is_waiting_for_beforeunload_ack() && delegate_) {
delegate_->BeforeUnloadFired(this, true, &close);
+ // Reset flag so we don't get duplicate of of ACK or run into
+ // situation when we have both |is_waiting_for_beforeunload_ack| and
+ // |IsWaitingForUnloadACK| on.
+ rfhi->DontWaitForBeforeUnloadAck();
Charlie Reis 2016/05/13 22:24:01 I wonder if we should expose and call RFHI::OnBefo
Mikhail Goncharov 2016/05/16 05:02:01 I have inspected RenderFrameHostImpl::OnBeforeUnlo
}
if (close)
Close();

Powered by Google App Engine
This is Rietveld 408576698