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

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: 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/frame/csp/ContentSecurityPolicy.cpp
diff --git a/Source/core/frame/csp/ContentSecurityPolicy.cpp b/Source/core/frame/csp/ContentSecurityPolicy.cpp
index 3a17d992d178f27499432c74fded97f6e7afdeac..5842fd3a09f28a8519a8a6b1134bb79ac2f7b33a 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"
@@ -648,6 +649,9 @@ void ContentSecurityPolicy::reportViolation(const String& directiveText, const S
if (!document)
return;
+ if (document->settings()->CSPViolationReportsUploadOptOut())
Mike West 2014/09/24 09:07:55 This should happen after the DOM Event fires on li
Mayur Kankanwadi 2014/09/25 08:40:37 Done.
+ return;
+
LocalFrame* frame = document->frame();
if (!frame)
return;

Powered by Google App Engine
This is Rietveld 408576698