| 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" |
| 11 #include "net/base/net_export.h" |
| 10 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 11 | 13 |
| 12 namespace net { | 14 namespace net { |
| 13 | 15 |
| 14 class CookieOptions { | 16 class NET_EXPORT CookieOptions { |
| 15 public: | 17 public: |
| 16 // Default is to exclude httponly completely, and exclude first-party from | 18 // Default is to exclude httponly completely, and exclude first-party from |
| 17 // being read, which means: | 19 // being read, which means: |
| 18 // - reading operations will not return httponly or first-party cookies. | 20 // - reading operations will not return httponly or first-party cookies. |
| 19 // - writing operations will not write httponly cookies (first-party will be | 21 // - writing operations will not write httponly cookies (first-party will be |
| 20 // written). | 22 // written). |
| 21 // | 23 // |
| 22 // If a first-party URL is set, then first-party cookies which match that URL | 24 // If a first-party URL is set, then first-party cookies which match that URL |
| 23 // will be returned. | 25 // will be returned. |
| 24 CookieOptions() | 26 CookieOptions(); |
| 25 : exclude_httponly_(true), | |
| 26 include_first_party_only_(false), | |
| 27 server_time_() {} | |
| 28 | 27 |
| 29 void set_exclude_httponly() { exclude_httponly_ = true; } | 28 void set_exclude_httponly() { exclude_httponly_ = true; } |
| 30 void set_include_httponly() { exclude_httponly_ = false; } | 29 void set_include_httponly() { exclude_httponly_ = false; } |
| 31 bool exclude_httponly() const { return exclude_httponly_; } | 30 bool exclude_httponly() const { return exclude_httponly_; } |
| 32 | 31 |
| 33 void set_include_first_party_only() { include_first_party_only_ = true; } | 32 void set_include_first_party_only() { include_first_party_only_ = true; } |
| 34 bool include_first_party_only() const { return include_first_party_only_; } | 33 bool include_first_party_only() const { return include_first_party_only_; } |
| 35 | 34 |
| 36 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; } |
| 37 GURL first_party_url() const { return first_party_url_; } | 36 GURL first_party_url() const { return first_party_url_; } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 48 private: | 47 private: |
| 49 bool exclude_httponly_; | 48 bool exclude_httponly_; |
| 50 bool include_first_party_only_; | 49 bool include_first_party_only_; |
| 51 GURL first_party_url_; | 50 GURL first_party_url_; |
| 52 base::Time server_time_; | 51 base::Time server_time_; |
| 53 }; | 52 }; |
| 54 | 53 |
| 55 } // namespace net | 54 } // namespace net |
| 56 | 55 |
| 57 #endif // NET_COOKIES_COOKIE_OPTIONS_H_ | 56 #endif // NET_COOKIES_COOKIE_OPTIONS_H_ |
| OLD | NEW |