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

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

Issue 1890493002: PlzNavigate: properly execute BeforeUnload on renderer initiated navigations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed dcheng's comments 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 9e15211fecddc2047ecbfd92bbe3600eccaa0524..07aa261757141e260a6d079cd354d9ec1b70e4ac 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -2084,7 +2084,10 @@ void RenderFrameHostImpl::Stop() {
Send(new FrameMsg_Stop(routing_id_));
}
-void RenderFrameHostImpl::DispatchBeforeUnload(bool for_navigation) {
+void RenderFrameHostImpl::DispatchBeforeUnload(bool for_navigation,
+ bool is_reload) {
+ DCHECK(for_navigation || !is_reload);
+
// TODO(creis): Support beforeunload on subframes. For now just pretend that
// the handler ran and allowed the navigation to proceed.
if (!ShouldDispatchBeforeUnload()) {
@@ -2119,7 +2122,7 @@ void RenderFrameHostImpl::DispatchBeforeUnload(bool for_navigation) {
render_view_host_->GetWidget()->StartHangMonitorTimeout(
TimeDelta::FromMilliseconds(RenderViewHostImpl::kUnloadTimeoutMS));
send_before_unload_start_time_ = base::TimeTicks::Now();
- Send(new FrameMsg_BeforeUnload(routing_id_));
+ Send(new FrameMsg_BeforeUnload(routing_id_, is_reload));
}
}

Powered by Google App Engine
This is Rietveld 408576698