| 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 2080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2091 expiry_date_ = CanonExpiration(pc, creation_date_, CookieOptions()); | 2091 expiry_date_ = CanonExpiration(pc, creation_date_, CookieOptions()); |
| 2092 else | 2092 else |
| 2093 SetSessionCookieExpiryTime(); | 2093 SetSessionCookieExpiryTime(); |
| 2094 | 2094 |
| 2095 // Do the best we can with the domain. | 2095 // Do the best we can with the domain. |
| 2096 std::string cookie_domain; | 2096 std::string cookie_domain; |
| 2097 std::string domain_string; | 2097 std::string domain_string; |
| 2098 if (pc.HasDomain()) { | 2098 if (pc.HasDomain()) { |
| 2099 domain_string = pc.Domain(); | 2099 domain_string = pc.Domain(); |
| 2100 } | 2100 } |
| 2101 bool result | 2101 GetCookieDomainWithString(url, domain_string, |
| 2102 = GetCookieDomainWithString(url, domain_string, | |
| 2103 &cookie_domain); | 2102 &cookie_domain); |
| 2104 // Caller is responsible for passing in good arguments. | 2103 // Caller is responsible for passing in good arguments. |
| 2105 DCHECK(result); | |
| 2106 domain_ = cookie_domain; | 2104 domain_ = cookie_domain; |
| 2107 } | 2105 } |
| 2108 | 2106 |
| 2109 CookieMonster::CanonicalCookie::~CanonicalCookie() { | 2107 CookieMonster::CanonicalCookie::~CanonicalCookie() { |
| 2110 } | 2108 } |
| 2111 | 2109 |
| 2112 std::string CookieMonster::CanonicalCookie::GetCookieSourceFromURL( | 2110 std::string CookieMonster::CanonicalCookie::GetCookieSourceFromURL( |
| 2113 const GURL& url) { | 2111 const GURL& url) { |
| 2114 if (url.SchemeIsFile()) | 2112 if (url.SchemeIsFile()) |
| 2115 return url.spec(); | 2113 return url.spec(); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2257 std::string CookieMonster::CanonicalCookie::DebugString() const { | 2255 std::string CookieMonster::CanonicalCookie::DebugString() const { |
| 2258 return base::StringPrintf( | 2256 return base::StringPrintf( |
| 2259 "name: %s value: %s domain: %s path: %s creation: %" | 2257 "name: %s value: %s domain: %s path: %s creation: %" |
| 2260 PRId64, | 2258 PRId64, |
| 2261 name_.c_str(), value_.c_str(), | 2259 name_.c_str(), value_.c_str(), |
| 2262 domain_.c_str(), path_.c_str(), | 2260 domain_.c_str(), path_.c_str(), |
| 2263 static_cast<int64>(creation_date_.ToTimeT())); | 2261 static_cast<int64>(creation_date_.ToTimeT())); |
| 2264 } | 2262 } |
| 2265 | 2263 |
| 2266 } // namespace | 2264 } // namespace |
| OLD | NEW |