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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2612793002: Implement ContentSecurityPolicy on the browser-side. (Closed)
Patch Set: Add the TODO and bug ids that was forgotten. Created 3 years, 10 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_impl.h ('k') | content/renderer/render_frame_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 6e997a6cfe974dc547b3f019220b96c4654d0ff7..a2c64fe4c55ec089c14c048ddf7560c66e7dc815 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -53,6 +53,7 @@
#include "content/common/associated_interfaces.mojom.h"
#include "content/common/clipboard_messages.h"
#include "content/common/content_constants_internal.h"
+#include "content/common/content_security_policy/csp_context.h"
#include "content/common/content_security_policy_header.h"
#include "content/common/download/mhtml_save_status.h"
#include "content/common/edit_command.h"
@@ -95,6 +96,7 @@
#include "content/renderer/browser_plugin/browser_plugin.h"
#include "content/renderer/browser_plugin/browser_plugin_manager.h"
#include "content/renderer/child_frame_compositing_helper.h"
+#include "content/renderer/content_security_policy_util.h"
#include "content/renderer/context_menu_params_builder.h"
#include "content/renderer/devtools/devtools_agent.h"
#include "content/renderer/dom_automation_controller.h"
@@ -3215,15 +3217,19 @@ void RenderFrameImpl::didSetFeaturePolicyHeader(
void RenderFrameImpl::didAddContentSecurityPolicy(
const blink::WebString& header_value,
blink::WebContentSecurityPolicyType type,
- blink::WebContentSecurityPolicySource source) {
- if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
- return;
-
+ blink::WebContentSecurityPolicySource source,
+ const std::vector<blink::WebContentSecurityPolicyPolicy>& policies) {
ContentSecurityPolicyHeader header;
header.header_value = header_value.utf8();
header.type = type;
header.source = source;
- Send(new FrameHostMsg_DidAddContentSecurityPolicy(routing_id_, header));
+
+ std::vector<ContentSecurityPolicy> content_policies;
+ for (const auto& policy : policies)
+ content_policies.push_back(BuildContentSecurityPolicy(policy));
+
+ Send(new FrameHostMsg_DidAddContentSecurityPolicy(routing_id_, header,
+ content_policies));
}
void RenderFrameImpl::didChangeFrameOwnerProperties(
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_frame_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698