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

Unified Diff: Source/core/frame/csp/ContentSecurityPolicy.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/Settings.in ('k') | Source/core/html/parser/XSSAuditorDelegate.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/csp/ContentSecurityPolicy.cpp
diff --git a/Source/core/frame/csp/ContentSecurityPolicy.cpp b/Source/core/frame/csp/ContentSecurityPolicy.cpp
index 3a17d992d178f27499432c74fded97f6e7afdeac..fc2ec907293787fe8114f537132db2a4e4ef5b38 100644
--- a/Source/core/frame/csp/ContentSecurityPolicy.cpp
+++ b/Source/core/frame/csp/ContentSecurityPolicy.cpp
@@ -33,6 +33,7 @@
#include "core/events/SecurityPolicyViolationEvent.h"
#include "core/frame/LocalDOMWindow.h"
#include "core/frame/LocalFrame.h"
+#include "core/frame/Settings.h"
#include "core/frame/UseCounter.h"
#include "core/frame/csp/CSPDirectiveList.h"
#include "core/frame/csp/CSPSource.h"
@@ -658,7 +659,7 @@ void ContentSecurityPolicy::reportViolation(const String& directiveText, const S
if (experimentalFeaturesEnabled())
frame->domWindow()->enqueueDocumentEvent(SecurityPolicyViolationEvent::create(EventTypeNames::securitypolicyviolation, violationData));
- if (reportEndpoints.isEmpty())
+ if (!document->settings()->CSPViolationReportsEnabled() || reportEndpoints.isEmpty())
return;
// We need to be careful here when deciding what information to send to the
« no previous file with comments | « Source/core/frame/Settings.in ('k') | Source/core/html/parser/XSSAuditorDelegate.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698