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

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

Issue 2764993002: CSP: group policies in didAddContentSecurityPolicy. (Closed)
Patch Set: Nit. Created 3 years, 9 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: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 9dc86b4f96263aa8249ac51ddd7ca8cb3f81fe1c..aa4bbbb5ceb1e79cae7dcdc8e2e6afa1ef846b27 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -769,8 +769,8 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeName, OnDidChangeName)
IPC_MESSAGE_HANDLER(FrameHostMsg_DidSetFeaturePolicyHeader,
OnDidSetFeaturePolicyHeader)
- IPC_MESSAGE_HANDLER(FrameHostMsg_DidAddContentSecurityPolicy,
- OnDidAddContentSecurityPolicy)
+ IPC_MESSAGE_HANDLER(FrameHostMsg_DidAddContentSecurityPolicies,
+ OnDidAddContentSecurityPolicies)
IPC_MESSAGE_HANDLER(FrameHostMsg_EnforceInsecureRequestPolicy,
OnEnforceInsecureRequestPolicy)
IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateToUniqueOrigin,
@@ -1927,12 +1927,14 @@ void RenderFrameHostImpl::OnDidSetFeaturePolicyHeader(
feature_policy_->SetHeaderPolicy(parsed_header);
}
-void RenderFrameHostImpl::OnDidAddContentSecurityPolicy(
- const ContentSecurityPolicyHeader& header,
+void RenderFrameHostImpl::OnDidAddContentSecurityPolicies(
const std::vector<ContentSecurityPolicy>& policies) {
- frame_tree_node()->AddContentSecurityPolicy(header);
- for (const ContentSecurityPolicy& policy : policies)
+ std::vector<ContentSecurityPolicyHeader> headers;
+ for (const ContentSecurityPolicy& policy : policies) {
AddContentSecurityPolicy(policy);
+ headers.push_back(policy.header);
alexmos 2017/03/25 01:46:27 Sanity check: your old comment on RFHI::OnDidAddCo
arthursonzogni 2017/03/27 12:03:52 The headers that contains multiple policies are sp
alexmos 2017/03/27 18:27:22 Acknowledged.
+ }
+ frame_tree_node()->AddContentSecurityPolicies(headers);
}
void RenderFrameHostImpl::OnEnforceInsecureRequestPolicy(

Powered by Google App Engine
This is Rietveld 408576698