| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "net/cookies/cookie_util.h" | 5 #include "net/cookies/cookie_util.h" |
| 6 | 6 |
| 7 #include <cstdio> | 7 #include <cstdio> |
| 8 #include <cstdlib> | 8 #include <cstdlib> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 base::StringTokenizer tokenizer(time_string, kDelimiters); | 111 base::StringTokenizer tokenizer(time_string, kDelimiters); |
| 112 | 112 |
| 113 bool found_day_of_month = false; | 113 bool found_day_of_month = false; |
| 114 bool found_month = false; | 114 bool found_month = false; |
| 115 bool found_time = false; | 115 bool found_time = false; |
| 116 bool found_year = false; | 116 bool found_year = false; |
| 117 | 117 |
| 118 while (tokenizer.GetNext()) { | 118 while (tokenizer.GetNext()) { |
| 119 const std::string token = tokenizer.token(); | 119 const std::string token = tokenizer.token(); |
| 120 DCHECK(!token.empty()); | 120 DCHECK(!token.empty()); |
| 121 bool numerical = IsAsciiDigit(token[0]); | 121 bool numerical = base::IsAsciiDigit(token[0]); |
| 122 | 122 |
| 123 // String field | 123 // String field |
| 124 if (!numerical) { | 124 if (!numerical) { |
| 125 if (!found_month) { | 125 if (!found_month) { |
| 126 for (int i = 0; i < kMonthsLen; ++i) { | 126 for (int i = 0; i < kMonthsLen; ++i) { |
| 127 // Match prefix, so we could match January, etc | 127 // Match prefix, so we could match January, etc |
| 128 if (base::strncasecmp(token.c_str(), kMonths[i], 3) == 0) { | 128 if (base::strncasecmp(token.c_str(), kMonths[i], 3) == 0) { |
| 129 exploded.month = i + 1; | 129 exploded.month = i + 1; |
| 130 found_month = true; | 130 found_month = true; |
| 131 break; | 131 break; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 buffer.append("; "); | 261 buffer.append("; "); |
| 262 buffer.append(i->first.begin(), i->first.end()); | 262 buffer.append(i->first.begin(), i->first.end()); |
| 263 buffer.push_back('='); | 263 buffer.push_back('='); |
| 264 buffer.append(i->second.begin(), i->second.end()); | 264 buffer.append(i->second.begin(), i->second.end()); |
| 265 } | 265 } |
| 266 return buffer; | 266 return buffer; |
| 267 } | 267 } |
| 268 | 268 |
| 269 } // namespace cookie_util | 269 } // namespace cookie_util |
| 270 } // namespace net | 270 } // namespace net |
| OLD | NEW |