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

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

Issue 2738943002: Move beforeunload hang timer duties to its own timer. (Closed)
Patch Set: rebase Created 3 years, 9 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 f8910b4bb042c1d641c669f7c47f640208a757d5..ac3004b38548b6abd3bdc5b9304b720558bc10a9 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4217,9 +4217,7 @@ void WebContentsImpl::RunBeforeUnloadConfirm(
delegate_->ShouldSuppressDialogs(this) ||
!delegate_->GetJavaScriptDialogManager(this);
if (suppress_this_message) {
- rfhi->JavaScriptDialogClosed(reply_msg, true, base::string16(),
- /*is_before_unload_dialog=*/true,
- /*dialog_was_suppressed=*/true);
+ rfhi->JavaScriptDialogClosed(reply_msg, true, base::string16(), true);
return;
}
@@ -4837,16 +4835,6 @@ void WebContentsImpl::RendererUnresponsive(
if (ShouldIgnoreUnresponsiveRenderer())
return;
- RenderFrameHostImpl* rfhi =
- static_cast<RenderFrameHostImpl*>(GetRenderViewHost()->GetMainFrame());
- if (rfhi->is_waiting_for_beforeunload_ack()) {
- // If the hang is in the beforeunload handler, pretend the beforeunload
- // listeners have all fired and allow the delegate to continue closing;
- // the user will not have the option of cancelling the close.
- rfhi->SimulateBeforeUnloadAck();
- return;
- }
-
if (!GetRenderViewHost() || !GetRenderViewHost()->IsRenderViewLive())
return;
@@ -5108,7 +5096,6 @@ void WebContentsImpl::OnDialogClosed(int render_process_id,
if (rfh) {
rfh->JavaScriptDialogClosed(reply_msg, success, user_input,
- is_showing_before_unload_dialog_,
dialog_was_suppressed);
} else {
// Don't leak the sync IPC reply if the RFH or process is gone.

Powered by Google App Engine
This is Rietveld 408576698