| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_BASE_COOKIE_OPTIONS_H_ | 7 #ifndef NET_BASE_COOKIE_OPTIONS_H_ |
| 8 #define NET_BASE_COOKIE_OPTIONS_H_ | 8 #define NET_BASE_COOKIE_OPTIONS_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 namespace net { | 11 namespace net { |
| 12 | 12 |
| 13 class CookieOptions { | 13 class CookieOptions { |
| 14 public: | 14 public: |
| 15 // Default is to exclude httponly, which means: | 15 // Default is for |
| 16 // - reading operations will not return httponly cookies. | 16 // - reading operations will not return httponly or origin cookies. |
| 17 // - writing operations will not write httponly cookies. | 17 // - writing operations will not write httponly cookies. |
| 18 CookieOptions() | 18 CookieOptions() |
| 19 : exclude_httponly_(true), | 19 : exclude_httponly_(true), |
| 20 force_session_(false) { | 20 force_session_(false), |
| 21 read_origin_(false) { |
| 21 } | 22 } |
| 22 | 23 |
| 23 void set_exclude_httponly() { exclude_httponly_ = true; } | 24 void set_exclude_httponly() { exclude_httponly_ = true; } |
| 24 void set_include_httponly() { exclude_httponly_ = false; } | 25 void set_include_httponly() { exclude_httponly_ = false; } |
| 25 bool exclude_httponly() const { return exclude_httponly_; } | 26 bool exclude_httponly() const { return exclude_httponly_; } |
| 26 | 27 |
| 27 // Forces a cookie to be saved as a session cookie. | 28 // Forces a cookie to be saved as a session cookie. |
| 28 void set_force_session() { force_session_ = true; } | 29 void set_force_session() { force_session_ = true; } |
| 29 bool force_session() const { return force_session_; } | 30 bool force_session() const { return force_session_; } |
| 30 | 31 |
| 32 void set_read_origin(bool flag) { read_origin_ = flag; } |
| 33 bool read_origin() const { return read_origin_; } |
| 34 |
| 31 private: | 35 private: |
| 36 // TODO(abarth): These member variable names should be nouns and not verbs. |
| 32 bool exclude_httponly_; | 37 bool exclude_httponly_; |
| 33 bool force_session_; | 38 bool force_session_; |
| 39 bool read_origin_; |
| 34 }; | 40 }; |
| 35 } // namespace net | 41 } // namespace net |
| 36 | 42 |
| 37 #endif // NET_BASE_COOKIE_OPTIONS_H_ | 43 #endif // NET_BASE_COOKIE_OPTIONS_H_ |
| 38 | 44 |
| OLD | NEW |