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

Unified Diff: net/cookies/cookie_options.h

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/cookie_monster.cc ('k') | net/cookies/cookie_store_unittest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_options.h
diff --git a/net/cookies/cookie_options.h b/net/cookies/cookie_options.h
index 8370702af9abae8206b91c2d9c09d551514b2a09..ed5e2ef3a4772e5d8b08cec859cbf25bb3d806a9 100644
--- a/net/cookies/cookie_options.h
+++ b/net/cookies/cookie_options.h
@@ -15,15 +15,26 @@ class CookieOptions {
// - reading operations will not return httponly cookies.
// - writing operations will not write httponly cookies.
CookieOptions()
- : exclude_httponly_(true) {
+ : exclude_httponly_(true),
+ server_time_() {
}
void set_exclude_httponly() { exclude_httponly_ = true; }
void set_include_httponly() { exclude_httponly_ = false; }
bool exclude_httponly() const { return exclude_httponly_; }
+ // |server_time| indicates what the server sending us the Cookie thought the
+ // current time was when the cookie was produced. This is used to adjust for
+ // clock skew between server and host.
+ void set_server_time(const base::Time& server_time) {
+ server_time_ = server_time;
+ }
+ bool has_server_time() const { return !server_time_.is_null(); }
+ base::Time server_time() const { return server_time_; }
+
private:
bool exclude_httponly_;
+ base::Time server_time_;
};
} // namespace net
« no previous file with comments | « net/cookies/cookie_monster.cc ('k') | net/cookies/cookie_store_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698