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

Side by Side Diff: net/base/cookie_monster.cc

Issue 17014: Remove compatibility #defines in string_util.h (Closed)
Patch Set: Created 11 years, 11 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 | « chrome/test/chrome_plugin/test_chrome_plugin.cc ('k') | no next file » | 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) 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
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
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
OLDNEW
« no previous file with comments | « chrome/test/chrome_plugin/test_chrome_plugin.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698