diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 04:27:47 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 04:27:47 +0000 |
commit | 4f79b3f0a594fab40f6afa6577503b7e33d866f2 (patch) | |
tree | d6ef4256e95e0d188880e65c49773a23b1990cb0 /net/base/cookie_policy.h | |
parent | f79b6495a07ca8c54ef9ccc2113304bf754b5fe2 (diff) | |
download | chromium_src-4f79b3f0a594fab40f6afa6577503b7e33d866f2.zip chromium_src-4f79b3f0a594fab40f6afa6577503b7e33d866f2.tar.gz chromium_src-4f79b3f0a594fab40f6afa6577503b7e33d866f2.tar.bz2 |
Implement backend support for forcing cookies to be saved as
session cookies.
Introduces a new CookiePolicy result code OK_FOR_SESSION_ONLY.
R=eroman
BUG=34571
TEST=none
Review URL: http://codereview.chromium.org/577013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38179 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/cookie_policy.h')
-rw-r--r-- | net/base/cookie_policy.h | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/net/base/cookie_policy.h b/net/base/cookie_policy.h index d2df2f5..f502e64d 100644 --- a/net/base/cookie_policy.h +++ b/net/base/cookie_policy.h @@ -11,12 +11,22 @@ class GURL; namespace net { +// Alternative success codes for CookiePolicy::Can{Get,Set}Cookie(s). +enum { + OK_FOR_SESSION_ONLY = 1, // The cookie may be set but not persisted. +}; + class CookiePolicy { public: - // Determines if the URL's cookies may be read. Returns OK if allowed to - // read cookies for the given URL. Returns ERR_IO_PENDING to indicate that - // the completion callback will be notified (asynchronously and on the - // current thread) of the final result. Note: The completion callback must + // Determines if the URL's cookies may be read. + // + // Returns: + // OK - if allowed to read cookies + // ERR_ACCESS_DENIED - if not allowed to read cookies + // ERR_IO_PENDING - if the result will be determined asynchronously + // + // If the return value is ERR_IO_PENDING, then the given callback will be + // notified once the final result is determined. Note: The callback must // remain valid until notified. virtual int CanGetCookies(const GURL& url, const GURL& first_party_for_cookies, @@ -27,6 +37,19 @@ class CookiePolicy { // the completion callback will be notified (asynchronously and on the // current thread) of the final result. Note: The completion callback must // remain valid until notified. + + // Determines if the URL's cookies may be written. + // + // Returns: + // OK - if allowed to write cookies + // OK_FOR_SESSION_ONLY - if allowed to write cookies, but forces them to + // be stored as session cookies + // ERR_ACCESS_DENIED - if not allowed to write cookies + // ERR_IO_PENDING - if the result will be determined asynchronously + // + // If the return value is ERR_IO_PENDING, then the given callback will be + // notified once the final result is determined. Note: The callback must + // remain valid until notified. virtual int CanSetCookie(const GURL& url, const GURL& first_party_for_cookies, const std::string& cookie_line, |