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