diff options
Diffstat (limited to 'WebKit/chromium/public/WebSecurityOrigin.h')
-rw-r--r-- | WebKit/chromium/public/WebSecurityOrigin.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/WebKit/chromium/public/WebSecurityOrigin.h b/WebKit/chromium/public/WebSecurityOrigin.h index 1285b10..a241682 100644 --- a/WebKit/chromium/public/WebSecurityOrigin.h +++ b/WebKit/chromium/public/WebSecurityOrigin.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2010 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -42,6 +42,7 @@ namespace WebKit { class WebSecurityOriginPrivate; class WebString; +class WebURL; class WebSecurityOrigin { public: @@ -55,9 +56,9 @@ public: return *this; } - // FIXME: This should return a WebSecurityOrigin, not a pointer to one. - WEBKIT_API static WebSecurityOrigin* createFromDatabaseIdentifier(const WebString& databaseIdentifier); + WEBKIT_API static WebSecurityOrigin createFromDatabaseIdentifier(const WebString& databaseIdentifier); WEBKIT_API static WebSecurityOrigin createFromString(const WebString&); + WEBKIT_API static WebSecurityOrigin create(const WebURL&); WEBKIT_API void reset(); WEBKIT_API void assign(const WebSecurityOrigin&); @@ -71,6 +72,17 @@ public: // The empty WebSecurityOrigin is the least privileged WebSecurityOrigin. WEBKIT_API bool isEmpty() const; + // Returns true if this WebSecurityOrigin can script objects in the given + // SecurityOrigin. For example, call this function before allowing + // script from one security origin to read or write objects from + // another SecurityOrigin. + WEBKIT_API bool canAccess(const WebSecurityOrigin&) const; + + // Returns true if this WebSecurityOrigin can read content retrieved from + // the given URL. For example, call this function before allowing script + // from a given security origin to receive contents from a given URL. + WEBKIT_API bool canRequest(const WebURL&) const; + // Returns a string representation of the WebSecurityOrigin. The empty // WebSecurityOrigin is represented by "null". The representation of a // non-empty WebSecurityOrigin resembles a standard URL. @@ -78,12 +90,17 @@ public: // Returns a string representation of this WebSecurityOrigin that can // be used as a file. Should be used in storage APIs only. - WEBKIT_API WebString databaseIdentifier(); + WEBKIT_API WebString databaseIdentifier() const; + + // Returns true if this WebSecurityOrigin can access usernames and + // passwords stored in password manager. + WEBKIT_API bool canAccessPasswordManager() const; #if WEBKIT_IMPLEMENTATION WebSecurityOrigin(const WTF::PassRefPtr<WebCore::SecurityOrigin>&); WebSecurityOrigin& operator=(const WTF::PassRefPtr<WebCore::SecurityOrigin>&); operator WTF::PassRefPtr<WebCore::SecurityOrigin>() const; + WebCore::SecurityOrigin* get() const; #endif private: |