OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_request.h" | 5 #include "content/browser/frame_host/navigation_request.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "content/browser/appcache/appcache_navigation_handle.h" | 10 #include "content/browser/appcache/appcache_navigation_handle.h" |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 if (result == NavigationThrottle::CANCEL_AND_IGNORE || | 708 if (result == NavigationThrottle::CANCEL_AND_IGNORE || |
709 result == NavigationThrottle::CANCEL) { | 709 result == NavigationThrottle::CANCEL) { |
710 // TODO(clamy): distinguish between CANCEL and CANCEL_AND_IGNORE. | 710 // TODO(clamy): distinguish between CANCEL and CANCEL_AND_IGNORE. |
711 OnRequestFailed(false, net::ERR_ABORTED); | 711 OnRequestFailed(false, net::ERR_ABORTED); |
712 | 712 |
713 // DO NOT ADD CODE after this. The previous call to OnRequestFailed has | 713 // DO NOT ADD CODE after this. The previous call to OnRequestFailed has |
714 // destroyed the NavigationRequest. | 714 // destroyed the NavigationRequest. |
715 return; | 715 return; |
716 } | 716 } |
717 | 717 |
| 718 if (result == NavigationThrottle::BLOCK_REQUEST) { |
| 719 OnRequestFailed(false, net::ERR_BLOCKED_BY_CLIENT); |
| 720 |
| 721 // DO NOT ADD CODE after this. The previous call to OnRequestFailed has |
| 722 // destroyed the NavigationRequest. |
| 723 return; |
| 724 } |
| 725 |
718 loader_->FollowRedirect(); | 726 loader_->FollowRedirect(); |
719 } | 727 } |
720 | 728 |
721 void NavigationRequest::OnWillProcessResponseChecksComplete( | 729 void NavigationRequest::OnWillProcessResponseChecksComplete( |
722 NavigationThrottle::ThrottleCheckResult result) { | 730 NavigationThrottle::ThrottleCheckResult result) { |
723 DCHECK(result != NavigationThrottle::DEFER); | 731 DCHECK(result != NavigationThrottle::DEFER); |
724 | 732 |
725 // Abort the request if needed. This includes requests that were blocked by | 733 // Abort the request if needed. This includes requests that were blocked by |
726 // NavigationThrottles and requests that should not commit (e.g. downloads, | 734 // NavigationThrottles and requests that should not commit (e.g. downloads, |
727 // 204/205s). This will destroy the NavigationRequest. | 735 // 204/205s). This will destroy the NavigationRequest. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); | 777 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); |
770 | 778 |
771 render_frame_host->CommitNavigation(response_.get(), std::move(body_), | 779 render_frame_host->CommitNavigation(response_.get(), std::move(body_), |
772 common_params_, request_params_, | 780 common_params_, request_params_, |
773 is_view_source_); | 781 is_view_source_); |
774 | 782 |
775 frame_tree_node_->ResetNavigationRequest(true); | 783 frame_tree_node_->ResetNavigationRequest(true); |
776 } | 784 } |
777 | 785 |
778 } // namespace content | 786 } // namespace content |
OLD | NEW |