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

Unified Diff: Source/core/frame/csp/ContentSecurityPolicy.h

Issue 553423002: CSP: Use a specified frame for reporting 'frame-ancestors' violations. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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.h
diff --git a/Source/core/frame/csp/ContentSecurityPolicy.h b/Source/core/frame/csp/ContentSecurityPolicy.h
index 0ced7ac653c4b153c266112c6f0748bca6ca0bc0..7d4cb2c5b7c7b002a41a5339b3d9d68ffe652695 100644
--- a/Source/core/frame/csp/ContentSecurityPolicy.h
+++ b/Source/core/frame/csp/ContentSecurityPolicy.h
@@ -125,7 +125,7 @@ public:
bool allowConnectToSource(const KURL&, ReportingStatus = SendReport) const;
bool allowFormAction(const KURL&, ReportingStatus = SendReport) const;
bool allowBaseURI(const KURL&, ReportingStatus = SendReport) const;
- bool allowAncestors(LocalFrame*, ReportingStatus = SendReport) const;
+ bool allowAncestors(LocalFrame*, const KURL&, ReportingStatus = SendReport) const;
bool allowChildContextFromSource(const KURL&, ReportingStatus = SendReport) const;
bool allowWorkerContextFromSource(const KURL&, ReportingStatus = SendReport) const;
@@ -153,7 +153,9 @@ public:
bool isActive() const;
- void logToConsole(PassRefPtr<ConsoleMessage>);
+ // If a frame is passed in, the message will be logged to its active document's console.
+ // Otherwise, the message will be logged to this object's |m_executionContext|.
+ void logToConsole(PassRefPtr<ConsoleMessage>, LocalFrame* = 0);
void reportDirectiveAsSourceExpression(const String& directiveName, const String& sourceExpression);
void reportDuplicateDirective(const String&);
@@ -169,7 +171,11 @@ public:
void reportInvalidReferrer(const String&);
void reportReportOnlyInMeta(const String&);
void reportMetaOutsideHead(const String&);
- void reportViolation(const String& directiveText, const String& effectiveDirective, const String& consoleMessage, const KURL& blockedURL, const Vector<String>& reportEndpoints, const String& header);
+
+ // If a frame is passed in, the report will be sent using it as a context. If no frame is
+ // passed in, the report will be sent via this object's |m_executionContext| (or dropped
+ // on the floor if no such context is available).
+ void reportViolation(const String& directiveText, const String& effectiveDirective, const String& consoleMessage, const KURL& blockedURL, const Vector<String>& reportEndpoints, const String& header, LocalFrame* = 0);
void reportBlockedScriptExecutionToInspector(const String& directiveText) const;

Powered by Google App Engine
This is Rietveld 408576698