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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2612793002: Implement ContentSecurityPolicy on the browser-side. (Closed)
Patch Set: Temporary re-add the parser + transmit parsed CSP over IPC. Created 3 years, 11 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/common/frame_messages.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 11e7198d70cf15b155ba0bac452aacadb0a4cd91..c0c9445683f0dd2cc48d7aa183289784df785d9a 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -52,6 +52,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"
@@ -3196,14 +3197,16 @@ void RenderFrameImpl::didAddContentSecurityPolicy(
const blink::WebString& header_value,
blink::WebContentSecurityPolicyType type,
blink::WebContentSecurityPolicySource source) {
- if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
- return;
+ //if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
nasko 2017/01/23 22:54:50 nit: Hopefully not committing this, right? :)
+ //return;
ContentSecurityPolicyHeader header;
header.header_value = base::UTF16ToUTF8(base::StringPiece16(header_value));
header.type = type;
header.source = source;
- Send(new FrameHostMsg_DidAddContentSecurityPolicy(routing_id_, header));
+ CSPContext context;
+ Send(new FrameHostMsg_DidAddContentSecurityPolicy(
+ routing_id_, header, CSPPolicy::Parse(&context, header)));
}
void RenderFrameImpl::didChangeFrameOwnerProperties(
« no previous file with comments | « content/common/frame_messages.h ('k') | content/renderer/render_frame_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698