| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/content_security_policy_util.h" | 5 #include "content/renderer/content_security_policy_util.h" |
| 6 | 6 |
| 7 namespace content { | 7 namespace content { |
| 8 | 8 |
| 9 CSPSource BuildCSPSource( | 9 CSPSource BuildCSPSource( |
| 10 const blink::WebContentSecurityPolicySourceExpression& source) { | 10 const blink::WebContentSecurityPolicySourceExpression& source) { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 violation.blockedUrl = violation_params.blocked_url; | 63 violation.blockedUrl = violation_params.blocked_url; |
| 64 violation.reportEndpoints = blink::WebVector<blink::WebString>( | 64 violation.reportEndpoints = blink::WebVector<blink::WebString>( |
| 65 violation_params.report_endpoints.size()); | 65 violation_params.report_endpoints.size()); |
| 66 for (size_t i = 0; i < violation_params.report_endpoints.size(); ++i) { | 66 for (size_t i = 0; i < violation_params.report_endpoints.size(); ++i) { |
| 67 violation.reportEndpoints[i] = | 67 violation.reportEndpoints[i] = |
| 68 blink::WebString::fromASCII(violation_params.report_endpoints[i]); | 68 blink::WebString::fromASCII(violation_params.report_endpoints[i]); |
| 69 } | 69 } |
| 70 violation.header = blink::WebString::fromASCII(violation_params.header); | 70 violation.header = blink::WebString::fromASCII(violation_params.header); |
| 71 violation.disposition = violation_params.disposition; | 71 violation.disposition = violation_params.disposition; |
| 72 violation.afterRedirect = violation_params.after_redirect; | 72 violation.afterRedirect = violation_params.after_redirect; |
| 73 violation.sourceLocation.url = |
| 74 blink::WebString::fromLatin1(violation_params.source_location.url); |
| 75 violation.sourceLocation.lineNumber = |
| 76 violation_params.source_location.line_number; |
| 77 violation.sourceLocation.columnNumber = |
| 78 violation_params.source_location.column_number; |
| 73 return violation; | 79 return violation; |
| 74 } | 80 } |
| 75 | 81 |
| 76 } // namespace content | 82 } // namespace content |
| OLD | NEW |