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

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

Issue 19940002: [HTML Import] Respect Content Security Policy Model (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix Mac build failure Created 7 years, 5 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 | « Source/core/html/HTMLImportsController.cpp ('k') | Source/core/loader/cache/CachedResource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FrameLoader.cpp
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index 2ae9b9f1f0236c5614ce0981d051f1367877cac0..af6ce6e5c0d3ca041fb34de2ad52fe459e44ec84 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -536,7 +536,7 @@ void FrameLoader::didBeginDocument(bool dispatch)
if (dispatch)
dispatchDidClearWindowObjectsInAllWorlds();
- m_frame->document()->initContentSecurityPolicy();
+ m_frame->document()->initContentSecurityPolicy(m_documentLoader ? ContentSecurityPolicyResponseHeaders(m_documentLoader->response()) : ContentSecurityPolicyResponseHeaders());
Settings* settings = m_frame->document()->settings();
if (settings) {
@@ -549,22 +549,6 @@ void FrameLoader::didBeginDocument(bool dispatch)
if (!dnsPrefetchControl.isEmpty())
m_frame->document()->parseDNSPrefetchControlHeader(dnsPrefetchControl);
- String policyValue = m_documentLoader->response().httpHeaderField("Content-Security-Policy");
- if (!policyValue.isEmpty())
- m_frame->document()->contentSecurityPolicy()->didReceiveHeader(policyValue, ContentSecurityPolicy::Enforce);
-
- policyValue = m_documentLoader->response().httpHeaderField("Content-Security-Policy-Report-Only");
- if (!policyValue.isEmpty())
- m_frame->document()->contentSecurityPolicy()->didReceiveHeader(policyValue, ContentSecurityPolicy::Report);
-
- policyValue = m_documentLoader->response().httpHeaderField("X-WebKit-CSP");
- if (!policyValue.isEmpty())
- m_frame->document()->contentSecurityPolicy()->didReceiveHeader(policyValue, ContentSecurityPolicy::PrefixedEnforce);
-
- policyValue = m_documentLoader->response().httpHeaderField("X-WebKit-CSP-Report-Only");
- if (!policyValue.isEmpty())
- m_frame->document()->contentSecurityPolicy()->didReceiveHeader(policyValue, ContentSecurityPolicy::PrefixedReport);
-
String headerContentLanguage = m_documentLoader->response().httpHeaderField("Content-Language");
if (!headerContentLanguage.isEmpty()) {
size_t commaIndex = headerContentLanguage.find(',');
« no previous file with comments | « Source/core/html/HTMLImportsController.cpp ('k') | Source/core/loader/cache/CachedResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698