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 4c24485495582a9779114f52df872e9a33ff8b8c..21014587fb9b11a49838d0364b600a82504a68a8 100644 |
| --- a/content/browser/frame_host/navigation_request.cc |
| +++ b/content/browser/frame_host/navigation_request.cc |
| @@ -379,17 +379,7 @@ void NavigationRequest::OnResponseStarted( |
| DCHECK(state_ == STARTED); |
| state_ = RESPONSE_STARTED; |
| - // HTTP 204 (No Content) and HTTP 205 (Reset Content) responses should not |
| - // commit; they leave the frame showing the previous page. |
| DCHECK(response); |
| - if (response->head.headers.get() && |
| - (response->head.headers->response_code() == 204 || |
| - response->head.headers->response_code() == 205)) { |
|
clamy
2016/11/21 16:57:14
If the issue is just the error code in the Navigat
yzshen1
2016/11/21 17:52:50
At least MetricsWebContentsObserver::DidFinishNavi
|
| - frame_tree_node_->navigator()->DiscardPendingEntryIfNeeded( |
| - navigation_handle_.get()); |
| - frame_tree_node_->ResetNavigationRequest(false); |
| - return; |
| - } |
| // Update the service worker params of the request params. |
| bool did_create_service_worker_host = |
| @@ -568,9 +558,13 @@ void NavigationRequest::OnWillProcessResponseChecksComplete( |
| CHECK(result != NavigationThrottle::DEFER); |
| // Abort the request if needed. This will destroy the NavigationRequest. |
| - if (result == NavigationThrottle::CANCEL_AND_IGNORE || |
| - result == NavigationThrottle::CANCEL) { |
| - // TODO(clamy): distinguish between CANCEL and CANCEL_AND_IGNORE. |
| + if (result == NavigationThrottle::CANCEL_AND_IGNORE) { |
| + frame_tree_node_->navigator()->DiscardPendingEntryIfNeeded( |
| + navigation_handle_.get()); |
| + frame_tree_node_->ResetNavigationRequest(false); |
| + return; |
| + } |
| + if (result == NavigationThrottle::CANCEL) { |
| frame_tree_node_->ResetNavigationRequest(false); |
| return; |
| } |