Index: Source/core/page/ContentSecurityPolicy.cpp |
diff --git a/Source/core/page/ContentSecurityPolicy.cpp b/Source/core/page/ContentSecurityPolicy.cpp |
index 6a4fb5a5ee8ae872842e306dc2e6d8a455da6f58..07a3e00437b9e2c15649b81e2438717b5d39fee4 100644 |
--- a/Source/core/page/ContentSecurityPolicy.cpp |
+++ b/Source/core/page/ContentSecurityPolicy.cpp |
@@ -29,6 +29,7 @@ |
#include "Console.h" |
#include "DOMStringList.h" |
#include "Document.h" |
+#include "DeprecationAgent.h" |
#include "UseCounter.h" |
#include "FormData.h" |
#include "FormDataList.h" |
@@ -1457,12 +1458,11 @@ void ContentSecurityPolicy::didReceiveHeader(const String& header, HeaderType ty |
{ |
if (m_scriptExecutionContext->isDocument()) { |
Document* document = toDocument(m_scriptExecutionContext); |
- if (document->domWindow()) |
- UseCounter::observe(document->domWindow(), getUseCounterType(type)); |
- } |
+ UseCounter::observe(document, getUseCounterType(type)); |
- if (type == PrefixedReport || type == PrefixedEnforce) |
- reportDeprecatedHeader(type); |
+ if (type == PrefixedReport || type == PrefixedEnforce) |
+ DeprecationAgent::notify(document, DeprecationAgent::PrefixedContentSecurityPolicyHeader); |
+ } |
// RFC2616, section 4.2 specifies that headers appearing multiple times can |
// be combined with a comma. Walk the header string, and parse each comma |
@@ -1804,12 +1804,6 @@ void ContentSecurityPolicy::reportUnsupportedDirective(const String& name) const |
logToConsole(message); |
} |
-void ContentSecurityPolicy::reportDeprecatedHeader(HeaderType type) const |
-{ |
- ASSERT(type == PrefixedEnforce || type == PrefixedReport); |
- logToConsole(makeString("The '", type == PrefixedEnforce ? "X-WebKit-CSP" : "X-WebKit-CSP-Report-Only", "' header is deprecated. Please consider using the unprefixed '", type == PrefixedEnforce ? "Content-Security-Policy" : "Content-Security-Policy-Report-Only", "' header instead.")); |
-} |
- |
void ContentSecurityPolicy::reportDirectiveAsSourceExpression(const String& directiveName, const String& sourceExpression) const |
{ |
String message = "The Content Security Policy directive '" + directiveName + "' contains '" + sourceExpression + "' as a source expression. Did you mean '" + directiveName + " ...; " + sourceExpression + "...' (note the semicolon)?"; |