summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/page/ContentSecurityPolicy.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/page/ContentSecurityPolicy.h')
-rw-r--r--Source/WebCore/page/ContentSecurityPolicy.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/Source/WebCore/page/ContentSecurityPolicy.h b/Source/WebCore/page/ContentSecurityPolicy.h
index 0eebd05..a7cd216 100644
--- a/Source/WebCore/page/ContentSecurityPolicy.h
+++ b/Source/WebCore/page/ContentSecurityPolicy.h
@@ -32,26 +32,32 @@
namespace WebCore {
class CSPDirective;
+class KURL;
+class SecurityOrigin;
class ContentSecurityPolicy : public RefCounted<ContentSecurityPolicy> {
public:
- static PassRefPtr<ContentSecurityPolicy> create() { return adoptRef(new ContentSecurityPolicy); }
+ static PassRefPtr<ContentSecurityPolicy> create(SecurityOrigin* origin = 0)
+ {
+ return adoptRef(new ContentSecurityPolicy(origin));
+ }
~ContentSecurityPolicy();
void didReceiveHeader(const String&);
bool allowJavaScriptURLs() const;
- // FIXME: Rename canLoadExternalScriptFromSrc to allowScriptFromURL.
- bool canLoadExternalScriptFromSrc(const String& url) const;
+ bool allowInlineEventHandlers() const;
+ bool allowScriptFromSource(const KURL&) const;
private:
- ContentSecurityPolicy();
+ explicit ContentSecurityPolicy(SecurityOrigin*);
void parse(const String&);
- void parseDirective(const UChar*& pos, const UChar* end, Vector<UChar, 32>& name, Vector<UChar, 64>& value);
- void emitDirective(const String& name, const String& value);
+ bool parseDirective(const UChar* begin, const UChar* end, String& name, String& value);
+ void addDirective(const String& name, const String& value);
bool m_havePolicy;
+ RefPtr<SecurityOrigin> m_origin;
OwnPtr<CSPDirective> m_scriptSrc;
};