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