OLD | NEW |
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 15 matching lines...) Expand all Loading... |
26 // will be returned. | 26 // will be returned. |
27 CookieOptions(); | 27 CookieOptions(); |
28 | 28 |
29 void set_exclude_httponly() { exclude_httponly_ = true; } | 29 void set_exclude_httponly() { exclude_httponly_ = true; } |
30 void set_include_httponly() { exclude_httponly_ = false; } | 30 void set_include_httponly() { exclude_httponly_ = false; } |
31 bool exclude_httponly() const { return exclude_httponly_; } | 31 bool exclude_httponly() const { return exclude_httponly_; } |
32 | 32 |
33 void set_include_first_party_only() { include_first_party_only_ = true; } | 33 void set_include_first_party_only() { include_first_party_only_ = true; } |
34 bool include_first_party_only() const { return include_first_party_only_; } | 34 bool include_first_party_only() const { return include_first_party_only_; } |
35 | 35 |
36 void set_first_party(const url::Origin& origin) { first_party_ = origin; } | |
37 const url::Origin& first_party() const { return first_party_; } | |
38 | |
39 // TODO(estark): Remove once we decide whether to ship cookie | 36 // TODO(estark): Remove once we decide whether to ship cookie |
40 // prefixes. https://crbug.com/541511 | 37 // prefixes. https://crbug.com/541511 |
41 void set_enforce_prefixes() { enforce_prefixes_ = true; } | 38 void set_enforce_prefixes() { enforce_prefixes_ = true; } |
42 bool enforce_prefixes() const { return enforce_prefixes_; } | 39 bool enforce_prefixes() const { return enforce_prefixes_; } |
43 | 40 |
44 // |server_time| indicates what the server sending us the Cookie thought the | 41 // |server_time| indicates what the server sending us the Cookie thought the |
45 // current time was when the cookie was produced. This is used to adjust for | 42 // current time was when the cookie was produced. This is used to adjust for |
46 // clock skew between server and host. | 43 // clock skew between server and host. |
47 void set_server_time(const base::Time& server_time) { | 44 void set_server_time(const base::Time& server_time) { |
48 server_time_ = server_time; | 45 server_time_ = server_time; |
49 } | 46 } |
50 bool has_server_time() const { return !server_time_.is_null(); } | 47 bool has_server_time() const { return !server_time_.is_null(); } |
51 base::Time server_time() const { return server_time_; } | 48 base::Time server_time() const { return server_time_; } |
52 | 49 |
53 private: | 50 private: |
54 bool exclude_httponly_; | 51 bool exclude_httponly_; |
55 bool include_first_party_only_; | 52 bool include_first_party_only_; |
56 url::Origin first_party_; | |
57 bool enforce_prefixes_; | 53 bool enforce_prefixes_; |
58 base::Time server_time_; | 54 base::Time server_time_; |
59 }; | 55 }; |
60 | 56 |
61 } // namespace net | 57 } // namespace net |
62 | 58 |
63 #endif // NET_COOKIES_COOKIE_OPTIONS_H_ | 59 #endif // NET_COOKIES_COOKIE_OPTIONS_H_ |
OLD | NEW |