Chromium Code Reviews| Index: content/browser/frame_host/navigation_request.cc |
| diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc |
| index a047b10686475e946f87bc5cd09d262fbb5026a3..61908d02407ea7fe04091a417394c977383a6590 100644 |
| --- a/content/browser/frame_host/navigation_request.cc |
| +++ b/content/browser/frame_host/navigation_request.cc |
| @@ -575,7 +575,9 @@ void NavigationRequest::OnStartChecksComplete( |
| if (result == NavigationThrottle::CANCEL_AND_IGNORE || |
| result == NavigationThrottle::CANCEL) { |
| // TODO(clamy): distinguish between CANCEL and CANCEL_AND_IGNORE. |
| - frame_tree_node_->ResetNavigationRequest(false); |
| + OnRequestFailed(false, net::ERR_ABORTED); |
|
clamy
2017/01/26 15:33:45
OnRequestFailed will set the error code on the Nav
|
| + // DO NOT ADD CODE after this. The previous call to OnRequestFailed has |
| + // destroyed the NavigationRequest. |
| return; |
| } |
| @@ -668,7 +670,9 @@ void NavigationRequest::OnRedirectChecksComplete( |
| if (result == NavigationThrottle::CANCEL_AND_IGNORE || |
| result == NavigationThrottle::CANCEL) { |
| // TODO(clamy): distinguish between CANCEL and CANCEL_AND_IGNORE. |
| - frame_tree_node_->ResetNavigationRequest(false); |
| + OnRequestFailed(false, net::ERR_ABORTED); |
| + // DO NOT ADD CODE after this. The previous call to OnRequestFailed has |
| + // destroyed the NavigationRequest. |
| return; |
| } |
| @@ -685,9 +689,9 @@ void NavigationRequest::OnWillProcessResponseChecksComplete( |
| if (result == NavigationThrottle::CANCEL_AND_IGNORE || |
| result == NavigationThrottle::CANCEL || !response_should_be_rendered_) { |
| // TODO(clamy): distinguish between CANCEL and CANCEL_AND_IGNORE. |
| - frame_tree_node_->navigator()->DiscardPendingEntryIfNeeded( |
| - navigation_handle_.get()); |
| - frame_tree_node_->ResetNavigationRequest(false); |
| + OnRequestFailed(false, net::ERR_ABORTED); |
| + // DO NOT ADD CODE after this. The previous call to OnRequestFailed has |
| + // destroyed the NavigationRequest. |
| return; |
| } |