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

Unified Diff: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp

Issue 2372563002: Adding Embedding-CSP HTTP header (Closed)
Patch Set: Rebasing Created 4 years, 3 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/html/HTMLFrameOwnerElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
index f48c327d1759bc01c79c10820b3bea924ce6eae8..13ce64109c85e1af270ace3008153432899a8ff2 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
@@ -34,6 +34,7 @@
#include "core/loader/FrameLoader.h"
#include "core/loader/FrameLoaderClient.h"
#include "core/plugins/PluginView.h"
+#include "platform/RuntimeEnabledFeatures.h"
#include "platform/weborigin/SecurityOrigin.h"
namespace blink {
@@ -328,6 +329,10 @@ bool HTMLFrameOwnerElement::loadOrRedirectSubframe(const KURL& url, const Atomic
if (policy != ReferrerPolicyDefault)
frameLoadRequest.resourceRequest().setHTTPReferrer(SecurityPolicy::generateReferrer(policy, url, document().outgoingReferrer()));
+ if (RuntimeEnabledFeatures::embedderCSPEnforcementEnabled() && hasAttribute(HTMLNames::cspAttr) && !getAttribute(HTMLNames::cspAttr).isNull()) {
+ frameLoadRequest.resourceRequest().setHTTPHeaderField(HTTPNames::Embedding_CSP, getAttribute(HTMLNames::cspAttr));
+ }
Mike West 2016/09/27 12:14:50 I think this is going to end up being the wrong pl
+
return parentFrame->loader().client()->createFrame(frameLoadRequest, frameName, this);
}

Powered by Google App Engine
This is Rietveld 408576698