OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "webkit/glue/webcookie.h" | 5 #include "webkit/glue/webcookie.h" |
6 | 6 |
| 7 #include "net/cookies/canonical_cookie.h" |
| 8 |
7 namespace webkit_glue { | 9 namespace webkit_glue { |
8 | 10 |
9 WebCookie::WebCookie() | 11 WebCookie::WebCookie() |
10 : expires(0), | 12 : expires(0), |
11 http_only(false), | 13 http_only(false), |
12 secure(false), | 14 secure(false), |
13 session(false) { | 15 session(false) { |
14 } | 16 } |
15 | 17 |
16 WebCookie::WebCookie(const net::CookieMonster::CanonicalCookie& c) | 18 WebCookie::WebCookie(const net::CanonicalCookie& c) |
17 : name(c.Name()), | 19 : name(c.Name()), |
18 value(c.Value()), | 20 value(c.Value()), |
19 domain(c.Domain()), | 21 domain(c.Domain()), |
20 path(c.Path()), | 22 path(c.Path()), |
21 expires(c.ExpiryDate().ToDoubleT() * 1000), | 23 expires(c.ExpiryDate().ToDoubleT() * 1000), |
22 http_only(c.IsHttpOnly()), | 24 http_only(c.IsHttpOnly()), |
23 secure(c.IsSecure()), | 25 secure(c.IsSecure()), |
24 session(!c.IsPersistent()) { | 26 session(!c.IsPersistent()) { |
25 } | 27 } |
26 | 28 |
27 WebCookie::WebCookie(const std::string& name, const std::string& value, | 29 WebCookie::WebCookie(const std::string& name, const std::string& value, |
28 const std::string& domain, const std::string& path, | 30 const std::string& domain, const std::string& path, |
29 double expires, bool http_only, bool secure, bool session) | 31 double expires, bool http_only, bool secure, bool session) |
30 : name(name), | 32 : name(name), |
31 value(value), | 33 value(value), |
32 domain(domain), | 34 domain(domain), |
33 path(path), | 35 path(path), |
34 expires(expires), | 36 expires(expires), |
35 http_only(http_only), | 37 http_only(http_only), |
36 secure(secure), | 38 secure(secure), |
37 session(session) { | 39 session(session) { |
38 } | 40 } |
39 | 41 |
40 WebCookie::~WebCookie() { | 42 WebCookie::~WebCookie() { |
41 } | 43 } |
42 | 44 |
43 } // namespace webkit_glue | 45 } // namespace webkit_glue |
OLD | NEW |