Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/frame_host/navigation_handle_impl.h" | 5 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 6 | 6 |
| 7 #include "base/debug/dump_without_crashing.h" | 7 #include "base/debug/dump_without_crashing.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "content/browser/browsing_data/clear_site_data_throttle.h" | 9 #include "content/browser/browsing_data/clear_site_data_throttle.h" |
| 10 #include "content/browser/child_process_security_policy_impl.h" | 10 #include "content/browser/child_process_security_policy_impl.h" |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 616 GetDelegate()->DidRedirectNavigation(this); | 616 GetDelegate()->DidRedirectNavigation(this); |
| 617 | 617 |
| 618 return NavigationThrottle::PROCEED; | 618 return NavigationThrottle::PROCEED; |
| 619 } | 619 } |
| 620 | 620 |
| 621 NavigationThrottle::ThrottleCheckResult | 621 NavigationThrottle::ThrottleCheckResult |
| 622 NavigationHandleImpl::CheckWillProcessResponse() { | 622 NavigationHandleImpl::CheckWillProcessResponse() { |
| 623 DCHECK(state_ == WILL_PROCESS_RESPONSE || state_ == DEFERRING_RESPONSE); | 623 DCHECK(state_ == WILL_PROCESS_RESPONSE || state_ == DEFERRING_RESPONSE); |
| 624 DCHECK(state_ != WILL_PROCESS_RESPONSE || next_index_ == 0); | 624 DCHECK(state_ != WILL_PROCESS_RESPONSE || next_index_ == 0); |
| 625 DCHECK(state_ != DEFERRING_RESPONSE || next_index_ != 0); | 625 DCHECK(state_ != DEFERRING_RESPONSE || next_index_ != 0); |
| 626 | |
| 627 // HTTP 204 (No Content) and HTTP 205 (Reset Content) responses should not | |
| 628 // commit; they leave the frame showing the previous page. | |
| 629 if (response_headers_ && (response_headers_->response_code() == 204 || | |
| 630 response_headers_->response_code() == 205)) { | |
| 631 net_error_code_ = net::ERR_ABORTED; | |
|
yzshen1
2016/11/18 00:10:53
Changing the net error code seems weird. But it ma
| |
| 632 state_ = CANCELING; | |
| 633 return NavigationThrottle::CANCEL_AND_IGNORE; | |
| 634 } | |
| 635 | |
| 626 for (size_t i = next_index_; i < throttles_.size(); ++i) { | 636 for (size_t i = next_index_; i < throttles_.size(); ++i) { |
| 627 NavigationThrottle::ThrottleCheckResult result = | 637 NavigationThrottle::ThrottleCheckResult result = |
| 628 throttles_[i]->WillProcessResponse(); | 638 throttles_[i]->WillProcessResponse(); |
| 629 switch (result) { | 639 switch (result) { |
| 630 case NavigationThrottle::PROCEED: | 640 case NavigationThrottle::PROCEED: |
| 631 continue; | 641 continue; |
| 632 | 642 |
| 633 case NavigationThrottle::CANCEL: | 643 case NavigationThrottle::CANCEL: |
| 634 case NavigationThrottle::CANCEL_AND_IGNORE: | 644 case NavigationThrottle::CANCEL_AND_IGNORE: |
| 635 state_ = CANCELING; | 645 state_ = CANCELING; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 771 throttles_to_register.push_back(std::move(clear_site_data_throttle)); | 781 throttles_to_register.push_back(std::move(clear_site_data_throttle)); |
| 772 | 782 |
| 773 if (throttles_to_register.size() > 0) { | 783 if (throttles_to_register.size() > 0) { |
| 774 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), | 784 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), |
| 775 throttles_to_register.end()); | 785 throttles_to_register.end()); |
| 776 throttles_to_register.weak_clear(); | 786 throttles_to_register.weak_clear(); |
| 777 } | 787 } |
| 778 } | 788 } |
| 779 | 789 |
| 780 } // namespace content | 790 } // namespace content |
| OLD | NEW |