OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Portions of this code based on Mozilla: | 5 // Portions of this code based on Mozilla: |
6 // (netwerk/cookie/src/nsCookieService.cpp) | 6 // (netwerk/cookie/src/nsCookieService.cpp) |
7 /* ***** BEGIN LICENSE BLOCK ***** | 7 /* ***** BEGIN LICENSE BLOCK ***** |
8 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 8 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
9 * | 9 * |
10 * The contents of this file are subject to the Mozilla Public License Version | 10 * The contents of this file are subject to the Mozilla Public License Version |
(...skipping 2613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2624 std::string mac_key = pc.HasMACKey() ? pc.MACKey() : std::string(); | 2624 std::string mac_key = pc.HasMACKey() ? pc.MACKey() : std::string(); |
2625 std::string mac_algorithm = pc.HasMACAlgorithm() ? | 2625 std::string mac_algorithm = pc.HasMACAlgorithm() ? |
2626 pc.MACAlgorithm() : std::string(); | 2626 pc.MACAlgorithm() : std::string(); |
2627 Time creation_time = Time::Now(); | 2627 Time creation_time = Time::Now(); |
2628 Time expiration_time; | 2628 Time expiration_time; |
2629 if (pc.HasExpires()) | 2629 if (pc.HasExpires()) |
2630 expiration_time = net::CookieMonster::ParseCookieTime(pc.Expires()); | 2630 expiration_time = net::CookieMonster::ParseCookieTime(pc.Expires()); |
2631 | 2631 |
2632 return (Create(url, pc.Name(), pc.Value(), domain_string, path_string, | 2632 return (Create(url, pc.Name(), pc.Value(), domain_string, path_string, |
2633 mac_key, mac_algorithm, creation_time, expiration_time, | 2633 mac_key, mac_algorithm, creation_time, expiration_time, |
2634 pc.IsSecure(), pc.IsHttpOnly(), pc.HasExpires())); | 2634 pc.IsSecure(), pc.IsHttpOnly(), !expiration_time.is_null())); |
2635 } | 2635 } |
2636 | 2636 |
2637 CookieMonster::CanonicalCookie* CookieMonster::CanonicalCookie::Create( | 2637 CookieMonster::CanonicalCookie* CookieMonster::CanonicalCookie::Create( |
2638 const GURL& url, | 2638 const GURL& url, |
2639 const std::string& name, | 2639 const std::string& name, |
2640 const std::string& value, | 2640 const std::string& value, |
2641 const std::string& domain, | 2641 const std::string& domain, |
2642 const std::string& path, | 2642 const std::string& path, |
2643 const std::string& mac_key, | 2643 const std::string& mac_key, |
2644 const std::string& mac_algorithm, | 2644 const std::string& mac_algorithm, |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2762 std::string CookieMonster::CanonicalCookie::DebugString() const { | 2762 std::string CookieMonster::CanonicalCookie::DebugString() const { |
2763 return base::StringPrintf( | 2763 return base::StringPrintf( |
2764 "name: %s value: %s domain: %s path: %s creation: %" | 2764 "name: %s value: %s domain: %s path: %s creation: %" |
2765 PRId64, | 2765 PRId64, |
2766 name_.c_str(), value_.c_str(), | 2766 name_.c_str(), value_.c_str(), |
2767 domain_.c_str(), path_.c_str(), | 2767 domain_.c_str(), path_.c_str(), |
2768 static_cast<int64>(creation_date_.ToTimeT())); | 2768 static_cast<int64>(creation_date_.ToTimeT())); |
2769 } | 2769 } |
2770 | 2770 |
2771 } // namespace | 2771 } // namespace |
OLD | NEW |