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

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

Issue 2768873006: Ensure that when a new navigation cancels an existing one, the old navigation's DidFinishNavigati... (Closed)
Patch Set: add test Created 3 years, 9 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
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_handle_impl_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/frame_tree_node.cc
diff --git a/content/browser/frame_host/frame_tree_node.cc b/content/browser/frame_host/frame_tree_node.cc
index de1df6f7b5efef341dddfa48a57c8b324b3b1400..5cde38fb9c146cb462eecf55a63f2c22b393c99e 100644
--- a/content/browser/frame_host/frame_tree_node.cc
+++ b/content/browser/frame_host/frame_tree_node.cc
@@ -383,8 +383,14 @@ void FrameTreeNode::CreatedNavigationRequest(
// There's no need to reset the state: there's still an ongoing load, and the
// RenderFrameHostManager will take care of updates to the speculative
// RenderFrameHost in DidCreateNavigationRequest below.
- if (was_previously_loading)
+ if (was_previously_loading) {
+ if (navigation_request_) {
+ // Mark the old request as aborted.
+ navigation_request_->navigation_handle()->set_net_error_code(
Charlie Reis 2017/03/24 20:11:09 I'm curious if this belongs in ResetNavigationRequ
jam 2017/03/24 22:08:26 That's a good question; I didn't see any obvious p
+ net::ERR_ABORTED);
+ }
ResetNavigationRequest(true, true);
+ }
navigation_request_ = std::move(navigation_request);
render_manager()->DidCreateNavigationRequest(navigation_request_.get());
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_handle_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698