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

Unified Diff: content/common/frame_messages.h

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
Index: content/common/frame_messages.h
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h
index c2d8c476b3220d512d45051c82d7c9e6019f13f5..4d9272c12302b8208d00f5133dc03bb5c9e8ac6f 100644
--- a/content/common/frame_messages.h
+++ b/content/common/frame_messages.h
@@ -18,6 +18,7 @@
#include "cc/surfaces/surface_sequence.h"
#include "content/common/content_export.h"
#include "content/common/content_param_traits.h"
+#include "content/common/content_security_policy/csp_policy.h"
#include "content/common/content_security_policy_header.h"
#include "content/common/download/mhtml_save_status.h"
#include "content/common/frame_message_enums.h"
@@ -109,6 +110,8 @@ IPC_ENUM_TRAITS_MIN_MAX_VALUE(content::PreviewsState,
content::PREVIEWS_STATE_LAST)
IPC_ENUM_TRAITS_MAX_VALUE(content::FileChooserParams::Mode,
content::FileChooserParams::Save)
+IPC_ENUM_TRAITS_MAX_VALUE(content::CSPDirective::Name,
+ content::CSPDirective::NAME_LAST);
IPC_STRUCT_TRAITS_BEGIN(blink::WebFindOptions)
IPC_STRUCT_TRAITS_MEMBER(forward)
@@ -527,6 +530,33 @@ IPC_STRUCT_BEGIN(FrameHostMsg_CreateChildFrame_Params)
IPC_STRUCT_MEMBER(content::FrameOwnerProperties, frame_owner_properties)
IPC_STRUCT_END()
+IPC_STRUCT_TRAITS_BEGIN(content::CSPSource)
+ IPC_STRUCT_TRAITS_MEMBER(scheme)
+ IPC_STRUCT_TRAITS_MEMBER(host)
+ IPC_STRUCT_TRAITS_MEMBER(is_host_wildcard)
+ IPC_STRUCT_TRAITS_MEMBER(port)
+ IPC_STRUCT_TRAITS_MEMBER(is_port_wildcard)
+ IPC_STRUCT_TRAITS_MEMBER(path)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(content::CSPSourceList)
+ IPC_STRUCT_TRAITS_MEMBER(allow_self)
+ IPC_STRUCT_TRAITS_MEMBER(allow_star)
+ IPC_STRUCT_TRAITS_MEMBER(source_list)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(content::CSPDirective)
+ IPC_STRUCT_TRAITS_MEMBER(name)
+ IPC_STRUCT_TRAITS_MEMBER(source_list)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(content::CSPPolicy)
+ IPC_STRUCT_TRAITS_MEMBER(disposition)
+ IPC_STRUCT_TRAITS_MEMBER(source)
+ IPC_STRUCT_TRAITS_MEMBER(directives)
+ IPC_STRUCT_TRAITS_MEMBER(report_end_points)
+IPC_STRUCT_TRAITS_END()
+
IPC_STRUCT_TRAITS_BEGIN(content::ContentSecurityPolicyHeader)
IPC_STRUCT_TRAITS_MEMBER(header_value)
IPC_STRUCT_TRAITS_MEMBER(type)
@@ -1027,8 +1057,9 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_DidSetFeaturePolicyHeader,
// headers and/or policies that might have been inherited from the parent frame)
// or when a new policy has been discovered afterwards (i.e. found in a
// dynamically added or a static <meta> element).
-IPC_MESSAGE_ROUTED1(FrameHostMsg_DidAddContentSecurityPolicy,
- content::ContentSecurityPolicyHeader)
+IPC_MESSAGE_ROUTED2(FrameHostMsg_DidAddContentSecurityPolicy,
+ content::ContentSecurityPolicyHeader,
+ content::CSPPolicy);
// Sent when the frame starts enforcing an insecure request policy. Sending
// this information in DidCommitProvisionalLoad isn't sufficient; this

Powered by Google App Engine
This is Rietveld 408576698