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

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

Issue 2727253005: Move beforeunload hang timer duties to its own timer. (Closed)
Patch Set: rev 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.h
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h
index 74ee70b1b2541002d192b8df3fbf34ed5a768c1a..37e0998ab57bd3c844c19e18fb7e7b6761d03b9a 100644
--- a/content/browser/frame_host/render_frame_host_impl.h
+++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -38,6 +38,7 @@
#include "content/common/image_downloader/image_downloader.mojom.h"
#include "content/common/navigation_params.h"
#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/renderer_unresponsive_type.h"
#include "content/public/common/javascript_dialog_type.h"
#include "content/public/common/previews_state.h"
#include "media/mojo/interfaces/interface_factory.mojom.h"
@@ -879,6 +880,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
@@ -983,6 +987,14 @@ 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_;
+
+ // If beforeunload_timeout_ is active, the type of the timeout.
+ RendererUnresponsiveType beforeunload_timeout_type_;
+
// 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