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 // 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 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1607 return NULL; | 1607 return NULL; |
1608 std::string parsed_value = ParsedCookie::ParseValueString(value); | 1608 std::string parsed_value = ParsedCookie::ParseValueString(value); |
1609 if (parsed_value != value) | 1609 if (parsed_value != value) |
1610 return NULL; | 1610 return NULL; |
1611 | 1611 |
1612 std::string parsed_domain = ParsedCookie::ParseValueString(domain); | 1612 std::string parsed_domain = ParsedCookie::ParseValueString(domain); |
1613 if (parsed_domain != domain) | 1613 if (parsed_domain != domain) |
1614 return NULL; | 1614 return NULL; |
1615 std::string cookie_domain; | 1615 std::string cookie_domain; |
1616 if (!GetCookieDomainKeyWithString(url, parsed_domain, &cookie_domain)) | 1616 if (!GetCookieDomainKeyWithString(url, parsed_domain, &cookie_domain)) |
1617 return false; | 1617 return NULL; |
1618 | 1618 |
1619 std::string parsed_path = ParsedCookie::ParseValueString(path); | 1619 std::string parsed_path = ParsedCookie::ParseValueString(path); |
1620 if (parsed_path != path) | 1620 if (parsed_path != path) |
1621 return NULL; | 1621 return NULL; |
1622 | 1622 |
1623 std::string cookie_path = CanonPathWithString(url, parsed_path); | 1623 std::string cookie_path = CanonPathWithString(url, parsed_path); |
1624 // Expect that the path was either not specified (empty), or is valid. | 1624 // Expect that the path was either not specified (empty), or is valid. |
1625 if (!parsed_path.empty() && cookie_path != parsed_path) | 1625 if (!parsed_path.empty() && cookie_path != parsed_path) |
1626 return NULL; | 1626 return NULL; |
1627 // Canonicalize path again to make sure it escapes characters as needed. | 1627 // Canonicalize path again to make sure it escapes characters as needed. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1678 std::string CookieMonster::CanonicalCookie::DebugString() const { | 1678 std::string CookieMonster::CanonicalCookie::DebugString() const { |
1679 return StringPrintf("name: %s value: %s domain: %s path: %s creation: %" | 1679 return StringPrintf("name: %s value: %s domain: %s path: %s creation: %" |
1680 PRId64, | 1680 PRId64, |
1681 name_.c_str(), value_.c_str(), | 1681 name_.c_str(), value_.c_str(), |
1682 domain_.c_str(), path_.c_str(), | 1682 domain_.c_str(), path_.c_str(), |
1683 static_cast<int64>(creation_date_.ToTimeT())); | 1683 static_cast<int64>(creation_date_.ToTimeT())); |
1684 } | 1684 } |
1685 | 1685 |
1686 } // namespace | 1686 } // namespace |
1687 | 1687 |
OLD | NEW |