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

Unified Diff: content/common/frame_messages.h

Issue 2190183002: Forward CSP violation reporting from RenderFrameProxy to RenderFrameImpl. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sanitize report endpoints from IPC against actual CSP contents. Created 4 years, 4 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/content_security_policy_structs.cc ('k') | content/common/frame_replication_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/frame_messages.h
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h
index 5a649f33c11cac3a225292ede4805162231b013b..44b0c19f65a7895fc12337de0770d853d6a88a31 100644
--- a/content/common/frame_messages.h
+++ b/content/common/frame_messages.h
@@ -18,7 +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_header.h"
+#include "content/common/content_security_policy_structs.h"
#include "content/common/frame_message_enums.h"
#include "content/common/frame_owner_properties.h"
#include "content/common/frame_replication_state.h"
@@ -557,6 +557,17 @@ IPC_STRUCT_BEGIN(FrameHostMsg_CreateChildFrame_Params)
IPC_STRUCT_MEMBER(content::FrameOwnerProperties, frame_owner_properties)
IPC_STRUCT_END()
+IPC_STRUCT_TRAITS_BEGIN(content::ContentSecurityPolicyViolation)
+ IPC_STRUCT_TRAITS_MEMBER(directive_text)
+ IPC_STRUCT_TRAITS_MEMBER(effective_directive)
+ IPC_STRUCT_TRAITS_MEMBER(console_message)
+ IPC_STRUCT_TRAITS_MEMBER(blocked_url)
+ IPC_STRUCT_TRAITS_MEMBER(report_endpoints)
+ IPC_STRUCT_TRAITS_MEMBER(header)
+ IPC_STRUCT_TRAITS_MEMBER(violation_type)
+ IPC_STRUCT_TRAITS_MEMBER(followed_redirect)
+IPC_STRUCT_TRAITS_END()
+
IPC_STRUCT_TRAITS_BEGIN(content::ContentSecurityPolicyHeader)
IPC_STRUCT_TRAITS_MEMBER(header_value)
IPC_STRUCT_TRAITS_MEMBER(type)
@@ -811,6 +822,17 @@ IPC_MESSAGE_ROUTED1(FrameMsg_AddContentSecurityPolicy,
// Resets ContentSecurityPolicy in a frame proxy / in RemoteSecurityContext.
IPC_MESSAGE_ROUTED0(FrameMsg_ResetContentSecurityPolicy)
+// Asks the frame to report a Content Security Policy violation that was
+// detected in another process (i.e. in another renderer process -
+// https://crbug.com/611232 [e.g. when frame-src is violated when the
+// parent frame is remote] or [in the future] in the browser process -
+// https://crbug.com/376522). In this case we use the IPC message below
+// to notify the frame where Content Security Policy originated from, so
+// that *this* frame can raise SecurityPolicyViolationEvent event and
+// finish reporting the violation.
+IPC_MESSAGE_ROUTED1(FrameMsg_ReportContentSecurityPolicyViolation,
+ content::ContentSecurityPolicyViolation)
+
// Update a proxy's replicated enforcement of insecure request policy.
// Used when the frame's policy is changed in another process.
IPC_MESSAGE_ROUTED1(FrameMsg_EnforceInsecureRequestPolicy,
@@ -1066,6 +1088,14 @@ IPC_MESSAGE_ROUTED2(FrameHostMsg_DidChangeName,
IPC_MESSAGE_ROUTED1(FrameHostMsg_DidAddContentSecurityPolicy,
content::ContentSecurityPolicyHeader)
+// Asks the browser to forward a Content Security Policy violation from a frame
+// proxy to the real frame. See also
+// FrameMsg_ReportContentSecurityPolicyViolation.
+IPC_MESSAGE_ROUTED2(
+ FrameHostMsg_ForwardContentSecurityPolicyViolation,
+ url::Origin /* Origin of frame declaring the violated CSP */,
+ content::ContentSecurityPolicyViolation)
+
// Sent when the frame starts enforcing an insecure request policy. Sending
// this information in DidCommitProvisionalLoad isn't sufficient; this
// message is needed because, for example, a document can dynamically insert
« no previous file with comments | « content/common/content_security_policy_structs.cc ('k') | content/common/frame_replication_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698