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

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

Issue 2655463006: PlzNavigate: Enforce 'frame-src' CSP on the browser. (Closed)
Patch Set: Fix tests. Created 3 years, 10 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 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 if (result == NavigationThrottle::CANCEL_AND_IGNORE || 686 if (result == NavigationThrottle::CANCEL_AND_IGNORE ||
687 result == NavigationThrottle::CANCEL) { 687 result == NavigationThrottle::CANCEL) {
688 // TODO(clamy): distinguish between CANCEL and CANCEL_AND_IGNORE. 688 // TODO(clamy): distinguish between CANCEL and CANCEL_AND_IGNORE.
689 OnRequestFailed(false, net::ERR_ABORTED); 689 OnRequestFailed(false, net::ERR_ABORTED);
690 690
691 // DO NOT ADD CODE after this. The previous call to OnRequestFailed has 691 // DO NOT ADD CODE after this. The previous call to OnRequestFailed has
692 // destroyed the NavigationRequest. 692 // destroyed the NavigationRequest.
693 return; 693 return;
694 } 694 }
695 695
696 if (result == NavigationThrottle::BLOCK_REQUEST) {
697 OnRequestFailed(false, net::ERR_BLOCKED_BY_CLIENT);
698 // DO NOT ADD CODE after this. The previous call to OnRequestFailed has
699 // destroyed the NavigationRequest.
700 return;
701 }
702
696 loader_->FollowRedirect(); 703 loader_->FollowRedirect();
697 } 704 }
698 705
699 void NavigationRequest::OnWillProcessResponseChecksComplete( 706 void NavigationRequest::OnWillProcessResponseChecksComplete(
700 NavigationThrottle::ThrottleCheckResult result) { 707 NavigationThrottle::ThrottleCheckResult result) {
701 DCHECK(result != NavigationThrottle::DEFER); 708 DCHECK(result != NavigationThrottle::DEFER);
702 709
703 // Abort the request if needed. This includes requests that were blocked by 710 // Abort the request if needed. This includes requests that were blocked by
704 // NavigationThrottles and requests that should not commit (e.g. downloads, 711 // NavigationThrottles and requests that should not commit (e.g. downloads,
705 // 204/205s). This will destroy the NavigationRequest. 712 // 204/205s). This will destroy the NavigationRequest.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); 754 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture);
748 755
749 render_frame_host->CommitNavigation(response_.get(), std::move(body_), 756 render_frame_host->CommitNavigation(response_.get(), std::move(body_),
750 common_params_, request_params_, 757 common_params_, request_params_,
751 is_view_source_); 758 is_view_source_);
752 759
753 frame_tree_node_->ResetNavigationRequest(true); 760 frame_tree_node_->ResetNavigationRequest(true);
754 } 761 }
755 762
756 } // namespace content 763 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698