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

Unified Diff: chrome/browser/browsing_data/browsing_data_cookie_helper.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 | « build/android/gtest_filter/net_unittests_disabled ('k') | chrome_frame/test/net/fake_external_tab.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browsing_data/browsing_data_cookie_helper.cc
diff --git a/chrome/browser/browsing_data/browsing_data_cookie_helper.cc b/chrome/browser/browsing_data/browsing_data_cookie_helper.cc
index 016464e50db899a9baddec853691c3373f5796d2..d5fd0b1214d2b1563506eac9b8bb8ce04d7b19df 100644
--- a/chrome/browser/browsing_data/browsing_data_cookie_helper.cc
+++ b/chrome/browser/browsing_data/browsing_data_cookie_helper.cc
@@ -139,6 +139,11 @@ void CannedBrowsingDataCookieHelper::AddChangedCookie(
const std::string& cookie_line,
const net::CookieOptions& options) {
base::Time creation_time = base::Time::Now();
+ base::Time server_time;
+ if (options.has_server_time())
+ server_time = options.server_time();
+ else
+ server_time = creation_time;
net::ParsedCookie pc(cookie_line);
if (!pc.IsValid())
@@ -161,7 +166,7 @@ void CannedBrowsingDataCookieHelper::AddChangedCookie(
pc.MACAlgorithm() : std::string();
base::Time cookie_expires =
- net::CanonicalCookie::CanonExpiration(pc, creation_time);
+ net::CanonicalCookie::CanonExpiration(pc, creation_time, server_time);
scoped_ptr<net::CanonicalCookie> cookie(
new net::CanonicalCookie(url, pc.Name(), pc.Value(), cookie_domain,
« no previous file with comments | « build/android/gtest_filter/net_unittests_disabled ('k') | chrome_frame/test/net/fake_external_tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698