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

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

Issue 1282363003: Convert remaining StringToLowerASCII to ToLowerASCII (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/cookies/cookie_constants.cc ('k') | net/dns/dns_config_service_win.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 // 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 391
392 // OK, now try to parse a value. 392 // OK, now try to parse a value.
393 std::string::const_iterator value_start, value_end; 393 std::string::const_iterator value_start, value_end;
394 ParseValue(&it, end, &value_start, &value_end); 394 ParseValue(&it, end, &value_start, &value_end);
395 395
396 // OK, we're finished with a Token/Value. 396 // OK, we're finished with a Token/Value.
397 pair.second = std::string(value_start, value_end); 397 pair.second = std::string(value_start, value_end);
398 398
399 // From RFC2109: "Attributes (names) (attr) are case-insensitive." 399 // From RFC2109: "Attributes (names) (attr) are case-insensitive."
400 if (pair_num != 0) 400 if (pair_num != 0)
401 base::StringToLowerASCII(&pair.first); 401 pair.first = base::ToLowerASCII(pair.first);
402 // Ignore Set-Cookie directives contaning control characters. See 402 // Ignore Set-Cookie directives contaning control characters. See
403 // http://crbug.com/238041. 403 // http://crbug.com/238041.
404 if (!IsValidCookieAttributeValue(pair.first) || 404 if (!IsValidCookieAttributeValue(pair.first) ||
405 !IsValidCookieAttributeValue(pair.second)) { 405 !IsValidCookieAttributeValue(pair.second)) {
406 pairs_.clear(); 406 pairs_.clear();
407 break; 407 break;
408 } 408 }
409 409
410 pairs_.push_back(pair); 410 pairs_.push_back(pair);
411 411
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 for (size_t i = 0; i < arraysize(indexes); ++i) { 501 for (size_t i = 0; i < arraysize(indexes); ++i) {
502 if (*indexes[i] == index) 502 if (*indexes[i] == index)
503 *indexes[i] = 0; 503 *indexes[i] = 0;
504 else if (*indexes[i] > index) 504 else if (*indexes[i] > index)
505 --*indexes[i]; 505 --*indexes[i];
506 } 506 }
507 pairs_.erase(pairs_.begin() + index); 507 pairs_.erase(pairs_.begin() + index);
508 } 508 }
509 509
510 } // namespace 510 } // namespace
OLDNEW
« no previous file with comments | « net/cookies/cookie_constants.cc ('k') | net/dns/dns_config_service_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698