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

Side by Side Diff: net/cookies/cookie_options.h

Issue 2633663003: Implements strict secure cookies as the default behavior in //net (Closed)
Patch Set: Rebase on ToT Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « net/cookies/cookie_monster_unittest.cc ('k') | net/cookies/cookie_options.cc » ('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 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 bool exclude_httponly() const { return exclude_httponly_; } 43 bool exclude_httponly() const { return exclude_httponly_; }
44 44
45 // Default is to exclude 'same_site' cookies. 45 // Default is to exclude 'same_site' cookies.
46 void set_same_site_cookie_mode(SameSiteCookieMode mode) { 46 void set_same_site_cookie_mode(SameSiteCookieMode mode) {
47 same_site_cookie_mode_ = mode; 47 same_site_cookie_mode_ = mode;
48 } 48 }
49 SameSiteCookieMode same_site_cookie_mode() const { 49 SameSiteCookieMode same_site_cookie_mode() const {
50 return same_site_cookie_mode_; 50 return same_site_cookie_mode_;
51 } 51 }
52 52
53 // TODO(jww): Remove once we decide whether to ship modifying 'secure' cookies
54 // only from secure schemes. https://crbug.com/546820
55 void set_enforce_strict_secure() { enforce_strict_secure_ = true; }
56 bool enforce_strict_secure() const { return enforce_strict_secure_; }
57
58 // |server_time| indicates what the server sending us the Cookie thought the 53 // |server_time| indicates what the server sending us the Cookie thought the
59 // current time was when the cookie was produced. This is used to adjust for 54 // current time was when the cookie was produced. This is used to adjust for
60 // clock skew between server and host. 55 // clock skew between server and host.
61 void set_server_time(const base::Time& server_time) { 56 void set_server_time(const base::Time& server_time) {
62 server_time_ = server_time; 57 server_time_ = server_time;
63 } 58 }
64 bool has_server_time() const { return !server_time_.is_null(); } 59 bool has_server_time() const { return !server_time_.is_null(); }
65 base::Time server_time() const { return server_time_; } 60 base::Time server_time() const { return server_time_; }
66 61
67 void set_do_not_update_access_time() { update_access_time_ = false; } 62 void set_do_not_update_access_time() { update_access_time_ = false; }
68 bool update_access_time() const { return update_access_time_; } 63 bool update_access_time() const { return update_access_time_; }
69 64
70 private: 65 private:
71 bool exclude_httponly_; 66 bool exclude_httponly_;
72 SameSiteCookieMode same_site_cookie_mode_; 67 SameSiteCookieMode same_site_cookie_mode_;
73 bool enforce_strict_secure_;
74 bool update_access_time_; 68 bool update_access_time_;
75 base::Time server_time_; 69 base::Time server_time_;
76 }; 70 };
77 71
78 } // namespace net 72 } // namespace net
79 73
80 #endif // NET_COOKIES_COOKIE_OPTIONS_H_ 74 #endif // NET_COOKIES_COOKIE_OPTIONS_H_
OLDNEW
« no previous file with comments | « net/cookies/cookie_monster_unittest.cc ('k') | net/cookies/cookie_options.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698