| 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 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1572 maxage_index_(0), | 1572 maxage_index_(0), |
| 1573 secure_index_(0), | 1573 secure_index_(0), |
| 1574 httponly_index_(0) { | 1574 httponly_index_(0) { |
| 1575 | 1575 |
| 1576 if (cookie_line.size() > kMaxCookieSize) { | 1576 if (cookie_line.size() > kMaxCookieSize) { |
| 1577 VLOG(1) << "Not parsing cookie, too large: " << cookie_line.size(); | 1577 VLOG(1) << "Not parsing cookie, too large: " << cookie_line.size(); |
| 1578 return; | 1578 return; |
| 1579 } | 1579 } |
| 1580 | 1580 |
| 1581 ParseTokenValuePairs(cookie_line); | 1581 ParseTokenValuePairs(cookie_line); |
| 1582 if (pairs_.size() > 0) { | 1582 if (!pairs_.empty()) { |
| 1583 is_valid_ = true; | 1583 is_valid_ = true; |
| 1584 SetupAttributes(); | 1584 SetupAttributes(); |
| 1585 } | 1585 } |
| 1586 } | 1586 } |
| 1587 | 1587 |
| 1588 CookieMonster::ParsedCookie::~ParsedCookie() { | 1588 CookieMonster::ParsedCookie::~ParsedCookie() { |
| 1589 } | 1589 } |
| 1590 | 1590 |
| 1591 // Returns true if |c| occurs in |chars| | 1591 // Returns true if |c| occurs in |chars| |
| 1592 // TODO maybe make this take an iterator, could check for end also? | 1592 // TODO maybe make this take an iterator, could check for end also? |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2034 std::string CookieMonster::CanonicalCookie::DebugString() const { | 2034 std::string CookieMonster::CanonicalCookie::DebugString() const { |
| 2035 return base::StringPrintf( | 2035 return base::StringPrintf( |
| 2036 "name: %s value: %s domain: %s path: %s creation: %" | 2036 "name: %s value: %s domain: %s path: %s creation: %" |
| 2037 PRId64, | 2037 PRId64, |
| 2038 name_.c_str(), value_.c_str(), | 2038 name_.c_str(), value_.c_str(), |
| 2039 domain_.c_str(), path_.c_str(), | 2039 domain_.c_str(), path_.c_str(), |
| 2040 static_cast<int64>(creation_date_.ToTimeT())); | 2040 static_cast<int64>(creation_date_.ToTimeT())); |
| 2041 } | 2041 } |
| 2042 | 2042 |
| 2043 } // namespace | 2043 } // namespace |
| OLD | NEW |