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

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

Issue 2657813004: PlzNavigate: set the error code in NavigationHandle on abort (Closed)
Patch Set: Reverted throttle result change Created 3 years, 10 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/navigation_request.cc
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index 4b1bd89edc252d09ef42281fd9448fcd639c6142..1c31b8dfa9dd00f56deb93c7321f904536417945 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -582,7 +582,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);
+ // DO NOT ADD CODE after this. The previous call to OnRequestFailed has
nasko 2017/02/07 21:25:26 nit: I'd add an empty line above the comment to ma
clamy 2017/02/08 16:34:16 Done.
+ // destroyed the NavigationRequest.
return;
}
@@ -675,7 +677,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;
}
@@ -692,9 +696,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;
}

Powered by Google App Engine
This is Rietveld 408576698