Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: net/cookies/cookie_monster.cc

Issue 11339032: Account for server vs host clock skew in cookie expiration times. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable test on Android as there's no test server Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cookies/canonical_cookie.cc ('k') | net/cookies/cookie_options.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_monster.cc
diff --git a/net/cookies/cookie_monster.cc b/net/cookies/cookie_monster.cc
index d1f342680ca3a4d1b1a0155414b92d7debffc66a..eab2e0e050f62a670d3b116aae8335e5626fb606 100644
--- a/net/cookies/cookie_monster.cc
+++ b/net/cookies/cookie_monster.cc
@@ -1703,6 +1703,11 @@ bool CookieMonster::SetCookieWithCreationTimeAndOptions(
creation_time = CurrentTime();
last_time_seen_ = creation_time;
}
+ Time server_time;
+ if (options.has_server_time())
+ server_time = options.server_time();
+ else
+ server_time = creation_time;
// Parse the cookie.
ParsedCookie pc(cookie_line);
@@ -1728,7 +1733,8 @@ bool CookieMonster::SetCookieWithCreationTimeAndOptions(
pc.MACAlgorithm() : std::string();
scoped_ptr<CanonicalCookie> cc;
- Time cookie_expires = CanonicalCookie::CanonExpiration(pc, creation_time);
+ Time cookie_expires =
+ CanonicalCookie::CanonExpiration(pc, creation_time, server_time);
cc.reset(new CanonicalCookie(url, pc.Name(), pc.Value(), cookie_domain,
cookie_path, mac_key, mac_algorithm,
« no previous file with comments | « net/cookies/canonical_cookie.cc ('k') | net/cookies/cookie_options.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698