Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: net/cookies/cookie_util.cc

Issue 1200053004: Move more string_util functions to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/base/net_util_icu.cc ('k') | net/http/http_content_disposition.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/base/net_util_icu.cc ('k') | net/http/http_content_disposition.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698