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

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: Fixed function case inconsistency. 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
« no previous file with comments | « Source/core/frame/csp/ContentSecurityPolicy.cpp ('k') | Source/web/WebSettingsImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..390dd7d1a819b2348e394addb0a2505040170e3f 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()->XSSViolationReportsEnabled())
PingLoader::sendViolationReport(m_document->frame(), m_reportURL, generateViolationReport(xssInfo), PingLoader::XSSAuditorViolationReport);
}
« no previous file with comments | « Source/core/frame/csp/ContentSecurityPolicy.cpp ('k') | Source/web/WebSettingsImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698