Index: content/renderer/content_security_policy_util.cc |
diff --git a/content/renderer/content_security_policy_util.cc b/content/renderer/content_security_policy_util.cc |
index 2f79fb79b8d0cba9ff29e2d824ffa092f031fcdb..d7e787e579ae10a9646c46b85112906a91a8e4ca 100644 |
--- a/content/renderer/content_security_policy_util.cc |
+++ b/content/renderer/content_security_policy_util.cc |
@@ -3,7 +3,6 @@ |
// found in the LICENSE file. |
#include "content/renderer/content_security_policy_util.h" |
-#include "third_party/WebKit/public/platform/WebContentSecurityPolicyStruct.h" |
namespace content { |
@@ -52,4 +51,24 @@ CSPPolicy BuildCSPPolicy(const blink::WebContentSecurityPolicyPolicy& policy) { |
report_endpoints); // report_endpoints |
} |
+blink::WebContentSecurityPolicyViolation BuildWebContentSecurityPolicyViolation( |
+ const content::CSPViolationParams& violation_params) { |
+ blink::WebContentSecurityPolicyViolation violation; |
+ violation.directive = blink::WebString::fromASCII(violation_params.directive); |
+ violation.effectiveDirective = |
+ blink::WebString::fromASCII(violation_params.effective_directive); |
+ violation.consoleMessage = |
+ blink::WebString::fromASCII(violation_params.console_message); |
+ violation.blockedUrl = violation_params.blocked_url; |
+ violation.reportEndpoints = blink::WebVector<blink::WebString>( |
+ violation_params.report_endpoints.size()); |
+ for (size_t i = 0; i < violation_params.report_endpoints.size(); ++i) |
+ violation.reportEndpoints[i] = |
+ blink::WebString::fromASCII(violation_params.report_endpoints[i]); |
+ violation.header = blink::WebString::fromASCII(violation_params.header); |
+ violation.disposition = violation_params.disposition; |
+ violation.followedRedirect = violation_params.followed_redirect; |
+ return violation; |
+} |
+ |
} // namespace content |