diff options
author | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-12 22:12:49 +0000 |
---|---|---|
committer | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-12 22:12:49 +0000 |
commit | 34a160dad4c51a0b16263a91722865a5a92df2eb (patch) | |
tree | cdf69aee87316cced9b3c94b0baef82d180d8cf0 /net/base/cookie_store.h | |
parent | 69401287af172586685346e5dd6b7e22b923f224 (diff) | |
download | chromium_src-34a160dad4c51a0b16263a91722865a5a92df2eb.zip chromium_src-34a160dad4c51a0b16263a91722865a5a92df2eb.tar.gz chromium_src-34a160dad4c51a0b16263a91722865a5a92df2eb.tar.bz2 |
MAC Cookies (patch 3 of N)
Prepare the cookie monster for MAC cookies. According to the perftests in this
patch, the change to the cookie monster has a small but measurable effect
(83.963ms => 88.299ms).
Review URL: http://codereview.chromium.org/6901147
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85200 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/cookie_store.h')
-rw-r--r-- | net/base/cookie_store.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/net/base/cookie_store.h b/net/base/cookie_store.h index 7d64ee8..0d55ce4 100644 --- a/net/base/cookie_store.h +++ b/net/base/cookie_store.h @@ -26,18 +26,45 @@ class CookieMonster; // be thread safe as its methods can be accessed from IO as well as UI threads. class CookieStore : public base::RefCountedThreadSafe<CookieStore> { public: + // This struct contains additional consumer-specific information that might + // be stored with cookies; currently just MAC information, see: + // http://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac + struct CookieInfo { + // The name of the cookie. + std::string name; + // TODO(abarth): Add value if any clients need it. + + // The value of the MAC-Key and MAC-Algorithm attributes, if present. + std::string mac_key; + std::string mac_algorithm; + + // The URL from which we received the cookie. + std::string source; + }; + // Sets a single cookie. Expects a cookie line, like "a=1; domain=b.com". virtual bool SetCookieWithOptions(const GURL& url, const std::string& cookie_line, const CookieOptions& options) = 0; - // TODO what if the total size of all the cookies >4k, can we have a header - // that big or do we need multiple Cookie: headers? + // TODO(???): what if the total size of all the cookies >4k, can we have a + // header that big or do we need multiple Cookie: headers? + // Note: Some sites, such as Facebook, occationally use Cookie headers >4k. + // // Simple interface, gets a cookie string "a=b; c=d" for the given URL. // Use options to access httponly cookies. virtual std::string GetCookiesWithOptions(const GURL& url, const CookieOptions& options) = 0; + // This function is similar to GetCookiesWithOptions same functionality as + // GetCookiesWithOptions except that it additionaly provides detailed + // information about the cookie contained in the cookie line. See |struct + // CookieInfo| above for details. + virtual void GetCookiesWithInfo(const GURL& url, + const CookieOptions& options, + std::string* cookie_line, + std::vector<CookieInfo>* cookie_info) = 0; + // Deletes the passed in cookie for the specified URL. virtual void DeleteCookie(const GURL& url, const std::string& cookie_name) = 0; |