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

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

Issue 2764993002: CSP: group policies in didAddContentSecurityPolicy. (Closed)
Patch Set: Rebase. 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 902f9669b9a6985a3b8ec9db8fb736afd7f0ac09..acb7916dafaa6adc64f982046ca89ddb0ebc838d 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -770,8 +770,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,
@@ -1926,12 +1926,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);
+ }
+ frame_tree_node()->AddContentSecurityPolicies(headers);
}
void RenderFrameHostImpl::OnEnforceInsecureRequestPolicy(
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/frame_host/render_frame_host_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698