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

Side by Side Diff: net/ftp/ftp_network_transaction.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/ftp/ftp_directory_listing_parser_vms.cc ('k') | net/http/http_auth_handler_factory.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/ftp/ftp_network_transaction.h" 5 #include "net/ftp/ftp_network_transaction.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 switch (GetErrorClass(response.status_code)) { 813 switch (GetErrorClass(response.status_code)) {
814 case ERROR_CLASS_INITIATED: 814 case ERROR_CLASS_INITIATED:
815 return Stop(ERR_INVALID_RESPONSE); 815 return Stop(ERR_INVALID_RESPONSE);
816 case ERROR_CLASS_OK: { 816 case ERROR_CLASS_OK: {
817 // All important info should be on the first line. 817 // All important info should be on the first line.
818 std::string line = response.lines[0]; 818 std::string line = response.lines[0];
819 // The response should be ASCII, which allows us to do case-insensitive 819 // The response should be ASCII, which allows us to do case-insensitive
820 // comparisons easily. If it is not ASCII, we leave the system type 820 // comparisons easily. If it is not ASCII, we leave the system type
821 // as unknown. 821 // as unknown.
822 if (base::IsStringASCII(line)) { 822 if (base::IsStringASCII(line)) {
823 line = base::StringToLowerASCII(line); 823 line = base::ToLowerASCII(line);
824 824
825 // Remove all whitespace, to correctly handle cases like fancy "V M S" 825 // Remove all whitespace, to correctly handle cases like fancy "V M S"
826 // response instead of "VMS". 826 // response instead of "VMS".
827 base::RemoveChars(line, base::kWhitespaceASCII, &line); 827 base::RemoveChars(line, base::kWhitespaceASCII, &line);
828 828
829 // The "magic" strings we test for below have been gathered by an 829 // The "magic" strings we test for below have been gathered by an
830 // empirical study. VMS needs to come first because some VMS systems 830 // empirical study. VMS needs to come first because some VMS systems
831 // also respond with "UNIX emulation", which is not perfect. It is much 831 // also respond with "UNIX emulation", which is not perfect. It is much
832 // more reliable to talk to these servers in their native language. 832 // more reliable to talk to these servers in their native language.
833 if (line.find("vms") != std::string::npos) { 833 if (line.find("vms") != std::string::npos) {
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 if (!had_error_type[type]) { 1373 if (!had_error_type[type]) {
1374 had_error_type[type] = true; 1374 had_error_type[type] = true;
1375 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened", 1375 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened",
1376 type, NUM_OF_NET_ERROR_TYPES); 1376 type, NUM_OF_NET_ERROR_TYPES);
1377 } 1377 }
1378 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount", 1378 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount",
1379 type, NUM_OF_NET_ERROR_TYPES); 1379 type, NUM_OF_NET_ERROR_TYPES);
1380 } 1380 }
1381 1381
1382 } // namespace net 1382 } // namespace net
OLDNEW
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_vms.cc ('k') | net/http/http_auth_handler_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698