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

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

Issue 2738943002: Move beforeunload hang timer duties to its own timer. (Closed)
Patch Set: with test 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/frame_host/render_frame_host_impl.h
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h
index c59708b16aa2b515e6812f3d192bf3548e2e187f..b58f1ac7591bc01df6c829e9609bb24a72d024d1 100644
--- a/content/browser/frame_host/render_frame_host_impl.h
+++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -458,7 +458,6 @@ class CONTENT_EXPORT RenderFrameHostImpl
void JavaScriptDialogClosed(IPC::Message* reply_msg,
bool success,
const base::string16& user_input,
- bool is_before_unload_dialog,
bool dialog_was_suppressed);
// Get the accessibility mode from the delegate and Send a message to the
@@ -888,6 +887,9 @@ class CONTENT_EXPORT RenderFrameHostImpl
std::unique_ptr<NavigationHandleImpl> TakeNavigationHandleForCommit(
const FrameHostMsg_DidCommitProvisionalLoad_Params& params);
+ // Called by |beforeunload_timeout_| when the beforeunload timeout fires.
+ void BeforeUnloadTimeout();
+
// For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a
// refcount that calls Shutdown when it reaches zero. This allows each
// RenderFrameHostManager to just care about RenderFrameHosts, while ensuring
@@ -992,6 +994,11 @@ class CONTENT_EXPORT RenderFrameHostImpl
// PlzNavigate: all navigations require a beforeUnload ACK.
bool unload_ack_is_for_navigation_;
+ // The timeout monitor that runs from when the beforeunload is started in
+ // DispatchBeforeUnload() until either the render process ACKs it with an IPC
+ // to OnBeforeUnloadACK(), or until the timeout triggers.
+ std::unique_ptr<TimeoutMonitor> beforeunload_timeout_;
+
// Indicates whether this RenderFrameHost is in the process of loading a
// document or not.
bool is_loading_;

Powered by Google App Engine
This is Rietveld 408576698