OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 while (tokenizer.GetNext()) { | 166 while (tokenizer.GetNext()) { |
167 const std::string token = tokenizer.token(); | 167 const std::string token = tokenizer.token(); |
168 DCHECK(!token.empty()); | 168 DCHECK(!token.empty()); |
169 bool numerical = IsAsciiDigit(token[0]); | 169 bool numerical = IsAsciiDigit(token[0]); |
170 | 170 |
171 // String field | 171 // String field |
172 if (!numerical) { | 172 if (!numerical) { |
173 if (!found_month) { | 173 if (!found_month) { |
174 for (int i = 0; i < kMonthsLen; ++i) { | 174 for (int i = 0; i < kMonthsLen; ++i) { |
175 // Match prefix, so we could match January, etc | 175 // Match prefix, so we could match January, etc |
176 if (StrNCaseCmp(token.c_str(), kMonths[i], 3) == 0) { | 176 if (base::strncasecmp(token.c_str(), kMonths[i], 3) == 0) { |
177 exploded.month = i + 1; | 177 exploded.month = i + 1; |
178 found_month = true; | 178 found_month = true; |
179 break; | 179 break; |
180 } | 180 } |
181 } | 181 } |
182 } else { | 182 } else { |
183 // If we've gotten here, it means we've already found and parsed our | 183 // If we've gotten here, it means we've already found and parsed our |
184 // month, and we have another string, which we would expect to be the | 184 // month, and we have another string, which we would expect to be the |
185 // the time zone name. According to the RFC and my experiments with | 185 // the time zone name. According to the RFC and my experiments with |
186 // how sites format their expirations, we don't have much of a reason | 186 // how sites format their expirations, we don't have much of a reason |
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 } | 1111 } |
1112 | 1112 |
1113 std::string CookieMonster::CanonicalCookie::DebugString() const { | 1113 std::string CookieMonster::CanonicalCookie::DebugString() const { |
1114 return StringPrintf("name: %s value: %s path: %s creation: %llu", | 1114 return StringPrintf("name: %s value: %s path: %s creation: %llu", |
1115 name_.c_str(), value_.c_str(), path_.c_str(), | 1115 name_.c_str(), value_.c_str(), path_.c_str(), |
1116 creation_date_.ToTimeT()); | 1116 creation_date_.ToTimeT()); |
1117 } | 1117 } |
1118 | 1118 |
1119 } // namespace | 1119 } // namespace |
1120 | 1120 |
OLD | NEW |