diff options
author | ycxiao@chromium.org <ycxiao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-04 23:28:15 +0000 |
---|---|---|
committer | ycxiao@chromium.org <ycxiao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-04 23:28:15 +0000 |
commit | a4d965d6457ad587e19821eb5541082e3d17fdc9 (patch) | |
tree | 783cce366834675ed1080c23885a2484500a8f52 /net | |
parent | 199f0db1e6024df05750b6560cd6a672909864c2 (diff) | |
download | chromium_src-a4d965d6457ad587e19821eb5541082e3d17fdc9.zip chromium_src-a4d965d6457ad587e19821eb5541082e3d17fdc9.tar.gz chromium_src-a4d965d6457ad587e19821eb5541082e3d17fdc9.tar.bz2 |
Creat BrowsingDataCookieHelper and CannedBrowsingDataCookieHelper for logging cookies at UI thread.
BUG=XXX
TEST=XXX
Review URL: http://codereview.chromium.org/7355025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95534 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/cookie_monster.cc | 22 | ||||
-rw-r--r-- | net/base/cookie_monster.h | 6 |
2 files changed, 28 insertions, 0 deletions
diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc index 5ef86cb..36cd919 100644 --- a/net/base/cookie_monster.cc +++ b/net/base/cookie_monster.cc @@ -2152,6 +2152,28 @@ void CookieMonster::CanonicalCookie::SetSessionCookieExpiryTime() { } CookieMonster::CanonicalCookie* CookieMonster::CanonicalCookie::Create( + const GURL& url, + const ParsedCookie& pc) { + std::string domain_string; + if (pc.HasDomain()) + domain_string = pc.Domain(); + std::string path_string; + if (pc.HasPath()) + path_string = pc.Path(); + std::string mac_key = pc.HasMACKey() ? pc.MACKey() : std::string(); + std::string mac_algorithm = pc.HasMACAlgorithm() ? + pc.MACAlgorithm() : std::string(); + Time creation_time = Time::Now(); + Time expiration_time; + if (pc.HasExpires()) + expiration_time = net::CookieMonster::ParseCookieTime(pc.Expires()); + + return (Create(url, pc.Name(), pc.Value(), domain_string, path_string, + mac_key, mac_algorithm, creation_time, expiration_time, + pc.IsSecure(), pc.IsHttpOnly())); +} + +CookieMonster::CanonicalCookie* CookieMonster::CanonicalCookie::Create( const GURL& url, const std::string& name, const std::string& value, diff --git a/net/base/cookie_monster.h b/net/base/cookie_monster.h index d6161ce..039f00c 100644 --- a/net/base/cookie_monster.h +++ b/net/base/cookie_monster.h @@ -617,6 +617,12 @@ class NET_API CookieMonster::CanonicalCookie { // Supports the default copy constructor. + // Creates a canonical cookie from parsed cookie. + // Canonicalizes and validates inputs. May return NULL if an attribute + // value is invalid. + static CanonicalCookie* Create(const GURL& url, + const ParsedCookie& pc); + // Creates a canonical cookie from unparsed attribute values. // Canonicalizes and validates inputs. May return NULL if an attribute // value is invalid. |