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

Unified Diff: Source/core/html/parser/XSSAuditorDelegate.cpp

Issue 591413003: Add a mechanism for users to opt-out of CSP & XSS violations reports. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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: Source/core/html/parser/XSSAuditorDelegate.cpp
diff --git a/Source/core/html/parser/XSSAuditorDelegate.cpp b/Source/core/html/parser/XSSAuditorDelegate.cpp
index b13435db3fa1ec9b0dd144df6341095628655c93..6ca498a9ca1b4d8ef9835ba2018297218987c43d 100644
--- a/Source/core/html/parser/XSSAuditorDelegate.cpp
+++ b/Source/core/html/parser/XSSAuditorDelegate.cpp
@@ -28,6 +28,7 @@
#include "core/dom/Document.h"
#include "core/frame/LocalFrame.h"
+#include "core/frame/Settings.h"
#include "core/inspector/ConsoleMessage.h"
#include "core/loader/DocumentLoader.h"
#include "core/loader/FrameLoader.h"
@@ -117,7 +118,7 @@ void XSSAuditorDelegate::didBlockScript(const XSSInfo& xssInfo)
frameLoader.client()->didDetectXSS(m_document->url(), xssInfo.m_didBlockEntirePage);
- if (!m_reportURL.isEmpty())
+ if (!m_reportURL.isEmpty() && !m_document->settings()->xssViolationReportsUploadOptOut())
PingLoader::sendViolationReport(m_document->frame(), m_reportURL, generateViolationReport(xssInfo), PingLoader::XSSAuditorViolationReport);
}

Powered by Google App Engine
This is Rietveld 408576698