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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2704383007: Always restart the hung page timer after a beforeunload dialog. (Closed)
Patch Set: fixes Created 3 years, 10 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/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 069f5b5d1fb9e89f780a74048084610515efd789..f541c6b760e24ca65c3ab75b3afba37c456d998c 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1669,7 +1669,9 @@ void RenderFrameHostImpl::OnRunJavaScriptDialog(
JavaScriptDialogType dialog_type,
IPC::Message* reply_msg) {
if (!is_active()) {
- JavaScriptDialogClosed(reply_msg, true, base::string16(), true);
+ JavaScriptDialogClosed(reply_msg, true, base::string16(),
+ /*is_before_unload_dialog=*/false,
+ /*dialog_was_suppressed=*/true);
return;
}
@@ -2605,9 +2607,10 @@ void RenderFrameHostImpl::JavaScriptDialogClosed(
IPC::Message* reply_msg,
bool success,
const base::string16& user_input,
+ bool is_before_unload_dialog,
bool dialog_was_suppressed) {
GetProcess()->SetIgnoreInputEvents(false);
- bool is_waiting = is_waiting_for_beforeunload_ack_ || IsWaitingForUnloadACK();
+ bool is_waiting = is_before_unload_dialog || IsWaitingForUnloadACK();
// If we are executing as part of (before)unload event handling, we don't
// want to use the regular hung_renderer_delay_ms_ if the user has agreed to
@@ -2617,7 +2620,7 @@ void RenderFrameHostImpl::JavaScriptDialogClosed(
RendererUnresponsiveType type =
RendererUnresponsiveType::RENDERER_UNRESPONSIVE_DIALOG_CLOSED;
if (success) {
- type = is_waiting_for_beforeunload_ack_
+ type = is_before_unload_dialog
? RendererUnresponsiveType::RENDERER_UNRESPONSIVE_BEFORE_UNLOAD
: RendererUnresponsiveType::RENDERER_UNRESPONSIVE_UNLOAD;
}
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698