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

Unified Diff: content/renderer/render_frame_proxy.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
« no previous file with comments | « content/renderer/render_frame_proxy.h ('k') | third_party/WebKit/Source/core/frame/LocalFrameClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_proxy.cc
diff --git a/content/renderer/render_frame_proxy.cc b/content/renderer/render_frame_proxy.cc
index d6a89cef094a7691e07988a6f390865fcd5af42a..92790fcd62996dd163f5fbba1c2afe5f4955656e 100644
--- a/content/renderer/render_frame_proxy.cc
+++ b/content/renderer/render_frame_proxy.cc
@@ -231,8 +231,7 @@ void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) {
web_frame_->setHasReceivedUserGesture();
web_frame_->resetReplicatedContentSecurityPolicy();
- for (const auto& header : state.accumulated_csp_headers)
- OnAddContentSecurityPolicy(header);
+ OnAddContentSecurityPolicies(state.accumulated_csp_headers);
}
// Update the proxy's SecurityContext and FrameOwner with new sandbox flags
@@ -276,8 +275,8 @@ bool RenderFrameProxy::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags)
IPC_MESSAGE_HANDLER(FrameMsg_DispatchLoad, OnDispatchLoad)
IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateName, OnDidUpdateName)
- IPC_MESSAGE_HANDLER(FrameMsg_AddContentSecurityPolicy,
- OnAddContentSecurityPolicy)
+ IPC_MESSAGE_HANDLER(FrameMsg_AddContentSecurityPolicies,
+ OnAddContentSecurityPolicies)
IPC_MESSAGE_HANDLER(FrameMsg_ResetContentSecurityPolicy,
OnResetContentSecurityPolicy)
IPC_MESSAGE_HANDLER(FrameMsg_EnforceInsecureRequestPolicy,
@@ -351,11 +350,13 @@ void RenderFrameProxy::OnDidUpdateName(const std::string& name,
unique_name_ = unique_name;
}
-void RenderFrameProxy::OnAddContentSecurityPolicy(
- const ContentSecurityPolicyHeader& header) {
- web_frame_->addReplicatedContentSecurityPolicyHeader(
- blink::WebString::fromUTF8(header.header_value), header.type,
- header.source);
+void RenderFrameProxy::OnAddContentSecurityPolicies(
+ const std::vector<ContentSecurityPolicyHeader>& headers) {
+ for (const auto& header : headers) {
+ web_frame_->addReplicatedContentSecurityPolicyHeader(
+ blink::WebString::fromUTF8(header.header_value), header.type,
+ header.source);
+ }
}
void RenderFrameProxy::OnResetContentSecurityPolicy() {
« no previous file with comments | « content/renderer/render_frame_proxy.h ('k') | third_party/WebKit/Source/core/frame/LocalFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698