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

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

Issue 549163003: CSP: Change 'self' to ask the policy object whether a URL matches. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: httpfamily 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/csp/CSPSourceList.cpp ('k') | Source/core/frame/csp/ContentSecurityPolicy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/csp/ContentSecurityPolicy.h
diff --git a/Source/core/frame/csp/ContentSecurityPolicy.h b/Source/core/frame/csp/ContentSecurityPolicy.h
index 203b43325c65be4859700112ba1d9cb2de82abb4..1d5721960d2d2bb627722177fb7cbbfbae25402a 100644
--- a/Source/core/frame/csp/ContentSecurityPolicy.h
+++ b/Source/core/frame/csp/ContentSecurityPolicy.h
@@ -49,6 +49,7 @@ namespace blink {
class ContentSecurityPolicyResponseHeaders;
class CSPDirectiveList;
+class CSPSource;
class DOMStringList;
class Document;
class JSONObject;
@@ -168,10 +169,12 @@ public:
const KURL url() const;
KURL completeURL(const String&) const;
- SecurityOrigin* securityOrigin() const;
void enforceSandboxFlags(SandboxFlags) const;
String evalDisabledErrorMessage() const;
+ bool urlMatchesSelf(const KURL&) const;
+ bool protocolMatchesSelf(const KURL&) const;
+
bool experimentalFeaturesEnabled() const;
static bool shouldBypassMainWorld(ExecutionContext*);
@@ -184,6 +187,7 @@ private:
explicit ContentSecurityPolicy(ExecutionContext*);
Document* document() const;
+ SecurityOrigin* securityOrigin() const;
void logToConsole(const String& message, MessageLevel = ErrorMessageLevel) const;
void addPolicyFromHeaderValue(const String&, ContentSecurityPolicyHeaderType, ContentSecurityPolicyHeaderSource);
@@ -202,6 +206,8 @@ private:
// for validation.
uint8_t m_scriptHashAlgorithmsUsed;
uint8_t m_styleHashAlgorithmsUsed;
+
+ OwnPtr<CSPSource> m_selfSource;
};
}
« no previous file with comments | « Source/core/frame/csp/CSPSourceList.cpp ('k') | Source/core/frame/csp/ContentSecurityPolicy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698