Chromium Code Reviews| Index: content/browser/frame_host/navigation_handle_impl.cc |
| diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc |
| index f2b2f133ddb19e898c42a356464ef428bd77a875..3475b22914cbb57b44074da1bf33f801a9706b0d 100644 |
| --- a/content/browser/frame_host/navigation_handle_impl.cc |
| +++ b/content/browser/frame_host/navigation_handle_impl.cc |
| @@ -623,6 +623,16 @@ NavigationHandleImpl::CheckWillProcessResponse() { |
| DCHECK(state_ == WILL_PROCESS_RESPONSE || state_ == DEFERRING_RESPONSE); |
| DCHECK(state_ != WILL_PROCESS_RESPONSE || next_index_ == 0); |
| DCHECK(state_ != DEFERRING_RESPONSE || next_index_ != 0); |
| + |
| + // HTTP 204 (No Content) and HTTP 205 (Reset Content) responses should not |
| + // commit; they leave the frame showing the previous page. |
| + if (response_headers_ && (response_headers_->response_code() == 204 || |
| + response_headers_->response_code() == 205)) { |
| + net_error_code_ = net::ERR_ABORTED; |
|
yzshen1
2016/11/18 00:10:53
Changing the net error code seems weird. But it ma
|
| + state_ = CANCELING; |
| + return NavigationThrottle::CANCEL_AND_IGNORE; |
| + } |
| + |
| for (size_t i = next_index_; i < throttles_.size(); ++i) { |
| NavigationThrottle::ThrottleCheckResult result = |
| throttles_[i]->WillProcessResponse(); |