Index: content/renderer/render_frame_impl.cc |
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc |
index 3a2094408cf8e876b2f266deaa32c7dfd869c6c4..77474fe03d4b6ffe382b6fc46d020c3f86f592b4 100644 |
--- a/content/renderer/render_frame_impl.cc |
+++ b/content/renderer/render_frame_impl.cc |
@@ -49,7 +49,7 @@ |
#include "content/common/accessibility_messages.h" |
#include "content/common/clipboard_messages.h" |
#include "content/common/content_constants_internal.h" |
-#include "content/common/content_security_policy_header.h" |
+#include "content/common/content_security_policy_structs.h" |
#include "content/common/frame_messages.h" |
#include "content/common/frame_owner_properties.h" |
#include "content/common/frame_replication_state.h" |
@@ -1530,6 +1530,8 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) { |
IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs, |
OnSuppressFurtherDialogs) |
IPC_MESSAGE_HANDLER(FrameMsg_RunFileChooserResponse, OnFileChooserResponse) |
+ IPC_MESSAGE_HANDLER(FrameMsg_ReportContentSecurityPolicyViolation, |
+ OnReportContentSecurityPolicyViolation) |
#if defined(OS_ANDROID) |
IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult, |
OnActivateNearestFindResult) |
@@ -5240,6 +5242,23 @@ void RenderFrameImpl::OnFileChooserResponse( |
} |
} |
+void RenderFrameImpl::OnReportContentSecurityPolicyViolation( |
+ const ContentSecurityPolicyViolation& violation) { |
+ blink::WebVector<blink::WebString> web_report_endpoints( |
+ violation.report_endpoints.size()); |
+ for (size_t i = 0; i < web_report_endpoints.size(); i++) { |
+ web_report_endpoints[i] = |
+ WebString::fromUTF8(violation.report_endpoints[i]); |
+ } |
+ |
+ frame_->reportContentSecurityPolicyViolation( |
+ WebString::fromUTF8(violation.directive_text), |
+ WebString::fromUTF8(violation.effective_directive), |
+ WebString::fromUTF8(violation.console_message), violation.blocked_url, |
+ web_report_endpoints, WebString::fromUTF8(violation.header), |
+ violation.violation_type, violation.followed_redirect); |
+} |
+ |
#if defined(OS_ANDROID) |
void RenderFrameImpl::OnActivateNearestFindResult(int request_id, |
float x, |