| 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 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2110 expiry_date_ = CanonExpiration(pc, creation_date_, CookieOptions()); | 2110 expiry_date_ = CanonExpiration(pc, creation_date_, CookieOptions()); |
| 2111 else | 2111 else |
| 2112 SetSessionCookieExpiryTime(); | 2112 SetSessionCookieExpiryTime(); |
| 2113 | 2113 |
| 2114 // Do the best we can with the domain. | 2114 // Do the best we can with the domain. |
| 2115 std::string cookie_domain; | 2115 std::string cookie_domain; |
| 2116 std::string domain_string; | 2116 std::string domain_string; |
| 2117 if (pc.HasDomain()) { | 2117 if (pc.HasDomain()) { |
| 2118 domain_string = pc.Domain(); | 2118 domain_string = pc.Domain(); |
| 2119 } | 2119 } |
| 2120 bool result | 2120 GetCookieDomainWithString(url, domain_string, |
| 2121 = GetCookieDomainWithString(url, domain_string, | |
| 2122 &cookie_domain); | 2121 &cookie_domain); |
| 2123 // Caller is responsible for passing in good arguments. | 2122 // Caller is responsible for passing in good arguments. |
| 2124 DCHECK(result); | |
| 2125 domain_ = cookie_domain; | 2123 domain_ = cookie_domain; |
| 2126 } | 2124 } |
| 2127 | 2125 |
| 2128 CookieMonster::CanonicalCookie::~CanonicalCookie() { | 2126 CookieMonster::CanonicalCookie::~CanonicalCookie() { |
| 2129 } | 2127 } |
| 2130 | 2128 |
| 2131 std::string CookieMonster::CanonicalCookie::GetCookieSourceFromURL( | 2129 std::string CookieMonster::CanonicalCookie::GetCookieSourceFromURL( |
| 2132 const GURL& url) { | 2130 const GURL& url) { |
| 2133 if (url.SchemeIsFile()) | 2131 if (url.SchemeIsFile()) |
| 2134 return url.spec(); | 2132 return url.spec(); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2276 std::string CookieMonster::CanonicalCookie::DebugString() const { | 2274 std::string CookieMonster::CanonicalCookie::DebugString() const { |
| 2277 return base::StringPrintf( | 2275 return base::StringPrintf( |
| 2278 "name: %s value: %s domain: %s path: %s creation: %" | 2276 "name: %s value: %s domain: %s path: %s creation: %" |
| 2279 PRId64, | 2277 PRId64, |
| 2280 name_.c_str(), value_.c_str(), | 2278 name_.c_str(), value_.c_str(), |
| 2281 domain_.c_str(), path_.c_str(), | 2279 domain_.c_str(), path_.c_str(), |
| 2282 static_cast<int64>(creation_date_.ToTimeT())); | 2280 static_cast<int64>(creation_date_.ToTimeT())); |
| 2283 } | 2281 } |
| 2284 | 2282 |
| 2285 } // namespace | 2283 } // namespace |
| OLD | NEW |