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

Unified Diff: content/browser/frame_host/render_frame_host_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: Correct order of checks 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/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 de78df1b008a679665336147ce250c5ad9bf3a98..a9ed5518369cdb73b6c48b144a73e96e4f59260b 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -2124,6 +2124,12 @@ void RenderFrameHostImpl::DispatchBeforeUnload(bool for_navigation) {
}
}
+void RenderFrameHostImpl::SimulateBeforeUnloadAck() {
+ DCHECK(is_waiting_for_beforeunload_ack_);
+ base::TimeTicks approx_renderer_start_time = send_before_unload_start_time_;
+ OnBeforeUnloadACK(true, approx_renderer_start_time, base::TimeTicks::Now());
+}
+
bool RenderFrameHostImpl::ShouldDispatchBeforeUnload() {
// TODO(creis): Support beforeunload on subframes.
return !GetParent() && IsRenderFrameLive();
« 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