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 2fdd79c55b1d9dc58ea8b75bce1127ca4e190dbb..ee394a607ab5e7cadf5abfc96f44a58bddddd9d9 100644 |
--- a/content/browser/frame_host/frame_tree_node.cc |
+++ b/content/browser/frame_host/frame_tree_node.cc |
@@ -384,7 +384,7 @@ void FrameTreeNode::CreatedNavigationRequest( |
// RenderFrameHostManager will take care of updates to the speculative |
// RenderFrameHost in DidCreateNavigationRequest below. |
if (was_previously_loading) |
- ResetNavigationRequest(true); |
+ ResetNavigationRequest(true, true); |
navigation_request_ = std::move(navigation_request); |
render_manager()->DidCreateNavigationRequest(navigation_request_.get()); |
@@ -395,7 +395,8 @@ void FrameTreeNode::CreatedNavigationRequest( |
DidStartLoading(to_different_document, was_previously_loading); |
} |
-void FrameTreeNode::ResetNavigationRequest(bool keep_state) { |
+void FrameTreeNode::ResetNavigationRequest(bool keep_state, |
+ bool inform_renderer) { |
CHECK(IsBrowserSideNavigationEnabled()); |
if (!navigation_request_) |
return; |
@@ -420,8 +421,11 @@ void FrameTreeNode::ResetNavigationRequest(bool keep_state) { |
} |
// If the navigation is renderer-initiated, the renderer should also be |
- // informed that the navigation stopped. |
- if (was_renderer_initiated) { |
+ // informed that the navigation stopped if needed. In the case the renderer |
+ // process asked for the navigation to be aborted, e.g. following a |
+ // document.open, do not send an IPC to the renderer process as it already |
+ // expects the navigation to stop. |
+ if (was_renderer_initiated && inform_renderer) { |
current_frame_host()->Send( |
new FrameMsg_Stop(current_frame_host()->GetRoutingID())); |
} |
@@ -500,7 +504,7 @@ bool FrameTreeNode::StopLoading() { |
navigation_request_->navigation_handle()->set_net_error_code( |
net::ERR_ABORTED); |
} |
- ResetNavigationRequest(false); |
+ ResetNavigationRequest(false, true); |
} |
// TODO(nasko): see if child frames should send IPCs in site-per-process |