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

Side by Side Diff: content/renderer/content_security_policy_util.cc

Issue 2761153003: PlzNavigate & CSP. Use the SourceLocation in violation reports. (Closed)
Patch Set: Nit. Created 3 years, 9 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 unified diff | Download patch
OLDNEW
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 violation.blockedUrl = violation_params.blocked_url; 64 violation.blockedUrl = violation_params.blocked_url;
65 violation.reportEndpoints = blink::WebVector<blink::WebString>( 65 violation.reportEndpoints = blink::WebVector<blink::WebString>(
66 violation_params.report_endpoints.size()); 66 violation_params.report_endpoints.size());
67 for (size_t i = 0; i < violation_params.report_endpoints.size(); ++i) { 67 for (size_t i = 0; i < violation_params.report_endpoints.size(); ++i) {
68 violation.reportEndpoints[i] = 68 violation.reportEndpoints[i] =
69 blink::WebString::fromASCII(violation_params.report_endpoints[i]); 69 blink::WebString::fromASCII(violation_params.report_endpoints[i]);
70 } 70 }
71 violation.header = blink::WebString::fromASCII(violation_params.header); 71 violation.header = blink::WebString::fromASCII(violation_params.header);
72 violation.disposition = violation_params.disposition; 72 violation.disposition = violation_params.disposition;
73 violation.afterRedirect = violation_params.after_redirect; 73 violation.afterRedirect = violation_params.after_redirect;
74 violation.sourceLocation.url =
75 blink::WebString::fromLatin1(violation_params.source_location.url);
76 violation.sourceLocation.lineNumber =
77 violation_params.source_location.line_number;
78 violation.sourceLocation.columnNumber =
79 violation_params.source_location.column_number;
74 return violation; 80 return violation;
75 } 81 }
76 82
77 } // namespace content 83 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698