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

Side by Side Diff: content/browser/frame_host/navigation_request.cc

Issue 2698623006: PlzNavigate: add support for BLOCK_REQUEST during redirects (Closed)
Patch Set: Abandon support of BLOCK_REQUEST on redirect without PlzNavigate. Created 3 years, 9 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 unified diff | Download patch
OLDNEW
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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 if (result == NavigationThrottle::CANCEL_AND_IGNORE || 728 if (result == NavigationThrottle::CANCEL_AND_IGNORE ||
729 result == NavigationThrottle::CANCEL) { 729 result == NavigationThrottle::CANCEL) {
730 // TODO(clamy): distinguish between CANCEL and CANCEL_AND_IGNORE. 730 // TODO(clamy): distinguish between CANCEL and CANCEL_AND_IGNORE.
731 OnRequestFailed(false, net::ERR_ABORTED); 731 OnRequestFailed(false, net::ERR_ABORTED);
732 732
733 // DO NOT ADD CODE after this. The previous call to OnRequestFailed has 733 // DO NOT ADD CODE after this. The previous call to OnRequestFailed has
734 // destroyed the NavigationRequest. 734 // destroyed the NavigationRequest.
735 return; 735 return;
736 } 736 }
737 737
738 if (result == NavigationThrottle::BLOCK_REQUEST) {
739 OnRequestFailed(false, net::ERR_BLOCKED_BY_CLIENT);
740
741 // DO NOT ADD CODE after this. The previous call to OnRequestFailed has
742 // destroyed the NavigationRequest.
743 return;
744 }
745
738 loader_->FollowRedirect(); 746 loader_->FollowRedirect();
739 } 747 }
740 748
741 void NavigationRequest::OnWillProcessResponseChecksComplete( 749 void NavigationRequest::OnWillProcessResponseChecksComplete(
742 NavigationThrottle::ThrottleCheckResult result) { 750 NavigationThrottle::ThrottleCheckResult result) {
743 DCHECK(result != NavigationThrottle::DEFER); 751 DCHECK(result != NavigationThrottle::DEFER);
744 752
745 // Abort the request if needed. This includes requests that were blocked by 753 // Abort the request if needed. This includes requests that were blocked by
746 // NavigationThrottles and requests that should not commit (e.g. downloads, 754 // NavigationThrottles and requests that should not commit (e.g. downloads,
747 // 204/205s). This will destroy the NavigationRequest. 755 // 204/205s). This will destroy the NavigationRequest.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); 797 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture);
790 798
791 render_frame_host->CommitNavigation(response_.get(), std::move(body_), 799 render_frame_host->CommitNavigation(response_.get(), std::move(body_),
792 common_params_, request_params_, 800 common_params_, request_params_,
793 is_view_source_); 801 is_view_source_);
794 802
795 frame_tree_node_->ResetNavigationRequest(true); 803 frame_tree_node_->ResetNavigationRequest(true);
796 } 804 }
797 805
798 } // namespace content 806 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl_browsertest.cc ('k') | content/public/browser/navigation_throttle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698