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

Side by Side 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, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/cookies/cookie_monster.cc ('k') | net/cookies/cookie_store_unittest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Brought to you by number 42. 5 // Brought to you by number 42.
6 6
7 #ifndef NET_COOKIES_COOKIE_OPTIONS_H_ 7 #ifndef NET_COOKIES_COOKIE_OPTIONS_H_
8 #define NET_COOKIES_COOKIE_OPTIONS_H_ 8 #define NET_COOKIES_COOKIE_OPTIONS_H_
9 9
10 namespace net { 10 namespace net {
11 11
12 class CookieOptions { 12 class CookieOptions {
13 public: 13 public:
14 // Default is to exclude httponly, which means: 14 // Default is to exclude httponly, which means:
15 // - reading operations will not return httponly cookies. 15 // - reading operations will not return httponly cookies.
16 // - writing operations will not write httponly cookies. 16 // - writing operations will not write httponly cookies.
17 CookieOptions() 17 CookieOptions()
18 : exclude_httponly_(true) { 18 : exclude_httponly_(true),
19 server_time_() {
19 } 20 }
20 21
21 void set_exclude_httponly() { exclude_httponly_ = true; } 22 void set_exclude_httponly() { exclude_httponly_ = true; }
22 void set_include_httponly() { exclude_httponly_ = false; } 23 void set_include_httponly() { exclude_httponly_ = false; }
23 bool exclude_httponly() const { return exclude_httponly_; } 24 bool exclude_httponly() const { return exclude_httponly_; }
24 25
26 // |server_time| indicates what the server sending us the Cookie thought the
27 // current time was when the cookie was produced. This is used to adjust for
28 // clock skew between server and host.
29 void set_server_time(const base::Time& server_time) {
30 server_time_ = server_time;
31 }
32 bool has_server_time() const { return !server_time_.is_null(); }
33 base::Time server_time() const { return server_time_; }
34
25 private: 35 private:
26 bool exclude_httponly_; 36 bool exclude_httponly_;
37 base::Time server_time_;
27 }; 38 };
28 } // namespace net 39 } // namespace net
29 40
30 #endif // NET_COOKIES_COOKIE_OPTIONS_H_ 41 #endif // NET_COOKIES_COOKIE_OPTIONS_H_
31 42
OLDNEW
« 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