diff options
author | Ben Murdoch <benm@google.com> | 2010-07-29 17:14:53 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-08-04 14:29:45 +0100 |
commit | c407dc5cd9bdc5668497f21b26b09d988ab439de (patch) | |
tree | 7eaf8707c0309516bdb042ad976feedaf72b0bb1 /webkit/glue/webcookie.h | |
parent | 0998b1cdac5733f299c12d88bc31ef9c8035b8fa (diff) | |
download | external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.zip external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.tar.gz external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.tar.bz2 |
Merge Chromium src@r53293
Change-Id: Ia79acf8670f385cee48c45b0a75371d8e950af34
Diffstat (limited to 'webkit/glue/webcookie.h')
-rw-r--r-- | webkit/glue/webcookie.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/webkit/glue/webcookie.h b/webkit/glue/webcookie.h new file mode 100644 index 0000000..e2f11e2 --- /dev/null +++ b/webkit/glue/webcookie.h @@ -0,0 +1,77 @@ +// Copyright (c) 2006-2008 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. +// +// A struct for managing data being dropped on a webview. This represents a +// union of all the types of data that can be dropped in a platform neutral +// way. + +#ifndef WEBKIT_GLUE_WEBCOOKIE_H_ +#define WEBKIT_GLUE_WEBCOOKIE_H_ + +#include "net/base/cookie_monster.h" + +namespace webkit_glue { + +struct WebCookie { + + WebCookie(const std::string& name, const std::string& value, + const std::string& domain, const std::string& path, double expires, + bool http_only, bool secure, bool session) + : name(name), + value(value), + domain(domain), + path(path), + expires(expires), + http_only(http_only), + secure(secure), + session(session) { + } + + explicit WebCookie(const net::CookieMonster::CanonicalCookie& c) + : name(c.Name()), + value(c.Value()), + domain(c.Domain()), + path(c.Path()), + expires(c.ExpiryDate().ToDoubleT() * 1000), + http_only(c.IsHttpOnly()), + secure(c.IsSecure()), + session(!c.IsPersistent()) { + } + + // For default constructions. + WebCookie() + : expires(0), + http_only(false), + secure(false), + session(false) { + } + + // Cookie name. + std::string name; + + // Cookie value. + std::string value; + + // Cookie domain. + std::string domain; + + // Cookie path. + std::string path; + + // Cookie expires param if any. + double expires; + + // Cookie HTTPOnly param. + bool http_only; + + // Cookie secure param. + bool secure; + + // Session cookie flag. + bool session; +}; + +} // namespace webkit_glue + +#endif // WEBKIT_GLUE_WEBCOOKIE_H_ |