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

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2453093003: child-src and frame-src CSP are not applicable when navigating a new window. (Closed)
Patch Set: Address a CR feedback nit - get rid of unnecessary parens. Created 4 years, 2 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
Index: third_party/WebKit/Source/core/loader/FrameLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index 12a5819756dd187cc107b9ce227baafbe2b4509e..50c8e7b3dbad8272e18c19ac1b28775bfa5620f2 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -1564,10 +1564,11 @@ bool FrameLoader::shouldContinueForNavigationPolicy(
if (request.url().isEmpty() || substituteData.isValid())
return true;
- // If we're loading content into a subframe, check against the parent's
- // Content Security Policy and kill the load if that check fails, unless we
- // should bypass the main world's CSP.
- if (shouldCheckMainWorldContentSecurityPolicy == CheckContentSecurityPolicy) {
+ // If we're loading content into |m_frame| (NavigationPolicyCurrentTab), check
+ // against the parent's Content Security Policy and kill the load if that
+ // check fails, unless we should bypass the main world's CSP.
+ if (policy == NavigationPolicyCurrentTab &&
+ shouldCheckMainWorldContentSecurityPolicy == CheckContentSecurityPolicy) {
Frame* parentFrame = m_frame->tree().parent();
if (parentFrame) {
ContentSecurityPolicy* parentPolicy =
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/frame-src-vs-shift-click-target.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698