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

Unified Diff: content/browser/frame_host/ancestor_throttle.cc

Issue 2909513002: Move PlzNavigate frame-src CSP check to NavigationRequest (Closed)
Patch Set: rebase Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/frame_host/ancestor_throttle.h ('k') | content/browser/frame_host/navigation_request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/ancestor_throttle.cc
diff --git a/content/browser/frame_host/ancestor_throttle.cc b/content/browser/frame_host/ancestor_throttle.cc
index 26b31201e988aaeed4e17605bf0281a8b4e46db6..a2d7f05dbe9424c949ec841edda6b7022c0f85e0 100644
--- a/content/browser/frame_host/ancestor_throttle.cc
+++ b/content/browser/frame_host/ancestor_throttle.cc
@@ -175,45 +175,6 @@ const char* AncestorThrottle::GetNameForLogging() {
return "AncestorThrottle";
}
-NavigationThrottle::ThrottleCheckResult
-AncestorThrottle::CheckContentSecurityPolicyFrameSrc(bool is_redirect) {
- // If PlzNavigate is enabled, "frame-src" is enforced on the browser side,
- // else on the renderer side.
- if (!IsBrowserSideNavigationEnabled())
- return NavigationThrottle::PROCEED;
-
- const GURL& url = navigation_handle()->GetURL();
- if (url.SchemeIs(url::kAboutScheme))
- return NavigationThrottle::PROCEED;
-
- NavigationHandleImpl* handle =
- static_cast<NavigationHandleImpl*>(navigation_handle());
-
- if (handle->should_check_main_world_csp() == CSPDisposition::DO_NOT_CHECK)
- return NavigationThrottle::PROCEED;
-
- FrameTreeNode* parent_ftn = handle->frame_tree_node()->parent();
- DCHECK(parent_ftn);
- RenderFrameHostImpl* parent = parent_ftn->current_frame_host();
- DCHECK(parent);
-
- if (parent->IsAllowedByCsp(CSPDirective::FrameSrc, url, is_redirect,
- handle->source_location())) {
- return NavigationThrottle::PROCEED;
- }
-
- return NavigationThrottle::BLOCK_REQUEST;
-}
-
-NavigationThrottle::ThrottleCheckResult AncestorThrottle::WillStartRequest() {
- return CheckContentSecurityPolicyFrameSrc(false);
-}
-
-NavigationThrottle::ThrottleCheckResult
-AncestorThrottle::WillRedirectRequest() {
- return CheckContentSecurityPolicyFrameSrc(true);
-}
-
AncestorThrottle::AncestorThrottle(NavigationHandle* handle)
: NavigationThrottle(handle) {}
« no previous file with comments | « content/browser/frame_host/ancestor_throttle.h ('k') | content/browser/frame_host/navigation_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698