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

Unified Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index 3ebeeceaf812cbefbdf05167d1eb918708a8860c..633fece76ab6ff624c8d5b387c7693a435b9f27c 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -2099,6 +2099,11 @@ bool WebLocalFrameImpl::maybeRenderFallbackContent(
// is infringed.
void WebLocalFrameImpl::reportContentSecurityPolicyViolation(
const blink::WebContentSecurityPolicyViolation& violation) {
+ addMessageToConsole(blink::WebConsoleMessage(
+ WebConsoleMessage::LevelError, violation.consoleMessage,
+ violation.sourceLocation.url, violation.sourceLocation.lineNumber,
+ violation.sourceLocation.columnNumber));
+
DCHECK(frame() && frame()->document());
Document* document = frame()->document();
Vector<String> reportEndpoints;
@@ -2117,10 +2122,8 @@ void WebLocalFrameImpl::reportContentSecurityPolicyViolation(
nullptr, /* LocalFrame */
violation.afterRedirect ? RedirectStatus::FollowedRedirect
: RedirectStatus::NoRedirect,
- // TODO(arthursonzogni, clamy) Provide the context line number here.
- // See http://crbug.com/690946
- 0, /* contextLine */
- nullptr); /* Element */
+ violation.sourceLocation.lineNumber, /* contextLine */
+ nullptr); /* Element */
}
bool WebLocalFrameImpl::isLoading() const {

Powered by Google App Engine
This is Rietveld 408576698