| Index: Source/core/frame/csp/ContentSecurityPolicy.cpp
|
| diff --git a/Source/core/frame/csp/ContentSecurityPolicy.cpp b/Source/core/frame/csp/ContentSecurityPolicy.cpp
|
| index d06f0afb7cbc83840918a7ad298796d62ccb172c..d4777e18e99cfbdfb3432fbbf47b17607e03be6f 100644
|
| --- a/Source/core/frame/csp/ContentSecurityPolicy.cpp
|
| +++ b/Source/core/frame/csp/ContentSecurityPolicy.cpp
|
| @@ -137,6 +137,7 @@ ContentSecurityPolicy::ContentSecurityPolicy(ExecutionContext* executionContext)
|
| , m_scriptHashAlgorithmsUsed(ContentSecurityPolicyHashAlgorithmNone)
|
| , m_styleHashAlgorithmsUsed(ContentSecurityPolicyHashAlgorithmNone)
|
| {
|
| + m_selfSource = adoptPtr(new CSPSource(this, securityOrigin()->protocol(), securityOrigin()->host(), securityOrigin()->port(), String(), false, false));
|
| }
|
|
|
| ContentSecurityPolicy::~ContentSecurityPolicy()
|
| @@ -772,6 +773,19 @@ bool ContentSecurityPolicy::experimentalFeaturesEnabled() const
|
| return RuntimeEnabledFeatures::experimentalContentSecurityPolicyFeaturesEnabled();
|
| }
|
|
|
| +bool ContentSecurityPolicy::urlMatchesSelf(const KURL& url) const
|
| +{
|
| + return m_selfSource->matches(url);
|
| +}
|
| +
|
| +bool ContentSecurityPolicy::protocolMatchesSelf(const KURL& url) const
|
| +{
|
| + String protectedResourceScheme(securityOrigin()->protocol());
|
| + if (equalIgnoringCase("http", protectedResourceScheme))
|
| + return url.protocolIsInHTTPFamily();
|
| + return equalIgnoringCase(url.protocol(), protectedResourceScheme);
|
| +}
|
| +
|
| bool ContentSecurityPolicy::shouldBypassMainWorld(ExecutionContext* context)
|
| {
|
| if (context && context->isDocument()) {
|
|
|