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

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

Issue 2901833002: Create NavigationHandle after beforeunload with PlzNavigate. (Closed)
Patch Set: Rewrote BeforeUnload test Created 3 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 360aeb354eb03cbb657e73af9a27dc9a21335866..6b08d638fe20efb6cc0adf79cfa0a520e4cf60e1 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1667,12 +1667,11 @@ void RenderFrameHostImpl::OnBeforeUnloadACK(
if (IsBrowserSideNavigationEnabled() && unload_ack_is_for_navigation_) {
// TODO(clamy): see if before_unload_end_time should be transmitted to the
// Navigator.
- frame_tree_node_->navigator()->OnBeforeUnloadACK(
- frame_tree_node_, proceed);
+ frame_tree_node_->navigator()->OnBeforeUnloadACK(frame_tree_node_, proceed,
+ before_unload_end_time);
} else {
frame_tree_node_->render_manager()->OnBeforeUnloadACK(
- unload_ack_is_for_navigation_, proceed,
- before_unload_end_time);
+ unload_ack_is_for_navigation_, proceed, before_unload_end_time);
}
// If canceled, notify the delegate to cancel its pending navigation entry.
@@ -2967,6 +2966,7 @@ void RenderFrameHostImpl::DispatchBeforeUnload(bool for_navigation,
// handler.
is_waiting_for_beforeunload_ack_ = true;
unload_ack_is_for_navigation_ = for_navigation;
+ send_before_unload_start_time_ = base::TimeTicks::Now();
if (render_view_host_->GetDelegate()->IsJavaScriptDialogShowing()) {
// If there is a JavaScript dialog up, don't bother sending the renderer
// the unload event because it is known unresponsive, waiting for the
@@ -2977,7 +2977,6 @@ void RenderFrameHostImpl::DispatchBeforeUnload(bool for_navigation,
beforeunload_timeout_->Start(
TimeDelta::FromMilliseconds(RenderViewHostImpl::kUnloadTimeoutMS));
}
- send_before_unload_start_time_ = base::TimeTicks::Now();
Send(new FrameMsg_BeforeUnload(routing_id_, is_reload));
}
}

Powered by Google App Engine
This is Rietveld 408576698