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

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

Issue 2889703002: Ensure that all code paths which call FrameTreeNode::ResetNavigationRequest set NavigationHandle::G… (Closed)
Patch Set: review comments 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 4b35a18caf4cf2822ef5984ae939dbae9cce6855..2d631b73ac90f235026199a87dd3a52489dda44f 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -961,6 +961,8 @@ void RenderFrameHostImpl::RenderProcessGone(SiteInstanceImpl* site_instance) {
DCHECK_EQ(site_instance_.get(), site_instance);
// The renderer process is gone, so this frame can no longer be loading.
+ if (navigation_handle_)
+ navigation_handle_->set_net_error_code(net::ERR_ABORTED);
ResetLoadingState();
// Any future UpdateState or UpdateTitle messages from this or a recreated
@@ -2894,6 +2896,12 @@ void RenderFrameHostImpl::DispatchBeforeUnload(bool for_navigation,
if (IsBrowserSideNavigationEnabled() && !for_navigation) {
// Cancel any pending navigations, to avoid their navigation commit/fail
// event from wiping out the is_waiting_for_beforeunload_ack_ state.
+ if (frame_tree_node_->navigation_request() &&
+ frame_tree_node_->navigation_request()->navigation_handle()) {
+ frame_tree_node_->navigation_request()
+ ->navigation_handle()
+ ->set_net_error_code(net::ERR_ABORTED);
+ }
frame_tree_node_->ResetNavigationRequest(false, true);
}
@@ -3124,6 +3132,8 @@ void RenderFrameHostImpl::FailedNavigation(
// An error page is expected to commit, hence why is_loading_ is set to true.
is_loading_ = true;
+ if (navigation_handle_)
+ DCHECK_NE(net::OK, navigation_handle_->GetNetErrorCode());
frame_tree_node_->ResetNavigationRequest(true, true);
}
« no previous file with comments | « content/browser/frame_host/navigator_impl.cc ('k') | content/browser/frame_host/render_frame_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698