Misc. cleanup for HistoryURLProvider. No functional changes.
[chromium-blink-merge.git] / net / cookies / cookie_options.h
blobed5e2ef3a4772e5d8b08cec859cbf25bb3d806a9
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
3 // found in the LICENSE file.
5 // Brought to you by number 42.
7 #ifndef NET_COOKIES_COOKIE_OPTIONS_H_
8 #define NET_COOKIES_COOKIE_OPTIONS_H_
10 namespace net {
12 class CookieOptions {
13 public:
14 // Default is to exclude httponly, which means:
15 // - reading operations will not return httponly cookies.
16 // - writing operations will not write httponly cookies.
17 CookieOptions()
18 : exclude_httponly_(true),
19 server_time_() {
22 void set_exclude_httponly() { exclude_httponly_ = true; }
23 void set_include_httponly() { exclude_httponly_ = false; }
24 bool exclude_httponly() const { return exclude_httponly_; }
26 // |server_time| indicates what the server sending us the Cookie thought the
27 // current time was when the cookie was produced. This is used to adjust for
28 // clock skew between server and host.
29 void set_server_time(const base::Time& server_time) {
30 server_time_ = server_time;
32 bool has_server_time() const { return !server_time_.is_null(); }
33 base::Time server_time() const { return server_time_; }
35 private:
36 bool exclude_httponly_;
37 base::Time server_time_;
39 } // namespace net
41 #endif // NET_COOKIES_COOKIE_OPTIONS_H_