summaryrefslogtreecommitdiff
path: root/chromium/net/cookies/cookie_options.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/cookies/cookie_options.h')
-rw-r--r--chromium/net/cookies/cookie_options.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/chromium/net/cookies/cookie_options.h b/chromium/net/cookies/cookie_options.h
new file mode 100644
index 00000000000..ed5e2ef3a47
--- /dev/null
+++ b/chromium/net/cookies/cookie_options.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Brought to you by number 42.
+
+#ifndef NET_COOKIES_COOKIE_OPTIONS_H_
+#define NET_COOKIES_COOKIE_OPTIONS_H_
+
+namespace net {
+
+class CookieOptions {
+ public:
+ // Default is to exclude httponly, which means:
+ // - reading operations will not return httponly cookies.
+ // - writing operations will not write httponly cookies.
+ CookieOptions()
+ : exclude_httponly_(true),
+ server_time_() {
+ }
+
+ void set_exclude_httponly() { exclude_httponly_ = true; }
+ void set_include_httponly() { exclude_httponly_ = false; }
+ bool exclude_httponly() const { return exclude_httponly_; }
+
+ // |server_time| indicates what the server sending us the Cookie thought the
+ // current time was when the cookie was produced. This is used to adjust for
+ // clock skew between server and host.
+ void set_server_time(const base::Time& server_time) {
+ server_time_ = server_time;
+ }
+ bool has_server_time() const { return !server_time_.is_null(); }
+ base::Time server_time() const { return server_time_; }
+
+ private:
+ bool exclude_httponly_;
+ base::Time server_time_;
+};
+} // namespace net
+
+#endif // NET_COOKIES_COOKIE_OPTIONS_H_
+