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

Side by Side Diff: net/ftp/ftp_network_transaction.cc

Issue 448853002: Move StringToLowerASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_vms.cc ('k') | net/http/http_auth_gssapi_posix.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.h" 10 #include "base/metrics/histogram.h"
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 switch (GetErrorClass(response.status_code)) { 824 switch (GetErrorClass(response.status_code)) {
825 case ERROR_CLASS_INITIATED: 825 case ERROR_CLASS_INITIATED:
826 return Stop(ERR_INVALID_RESPONSE); 826 return Stop(ERR_INVALID_RESPONSE);
827 case ERROR_CLASS_OK: { 827 case ERROR_CLASS_OK: {
828 // All important info should be on the first line. 828 // All important info should be on the first line.
829 std::string line = response.lines[0]; 829 std::string line = response.lines[0];
830 // The response should be ASCII, which allows us to do case-insensitive 830 // The response should be ASCII, which allows us to do case-insensitive
831 // comparisons easily. If it is not ASCII, we leave the system type 831 // comparisons easily. If it is not ASCII, we leave the system type
832 // as unknown. 832 // as unknown.
833 if (base::IsStringASCII(line)) { 833 if (base::IsStringASCII(line)) {
834 line = StringToLowerASCII(line); 834 line = base::StringToLowerASCII(line);
835 835
836 // Remove all whitespace, to correctly handle cases like fancy "V M S" 836 // Remove all whitespace, to correctly handle cases like fancy "V M S"
837 // response instead of "VMS". 837 // response instead of "VMS".
838 base::RemoveChars(line, base::kWhitespaceASCII, &line); 838 base::RemoveChars(line, base::kWhitespaceASCII, &line);
839 839
840 // The "magic" strings we test for below have been gathered by an 840 // The "magic" strings we test for below have been gathered by an
841 // empirical study. VMS needs to come first because some VMS systems 841 // empirical study. VMS needs to come first because some VMS systems
842 // also respond with "UNIX emulation", which is not perfect. It is much 842 // also respond with "UNIX emulation", which is not perfect. It is much
843 // more reliable to talk to these servers in their native language. 843 // more reliable to talk to these servers in their native language.
844 if (line.find("vms") != std::string::npos) { 844 if (line.find("vms") != std::string::npos) {
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 if (!had_error_type[type]) { 1393 if (!had_error_type[type]) {
1394 had_error_type[type] = true; 1394 had_error_type[type] = true;
1395 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened", 1395 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened",
1396 type, NUM_OF_NET_ERROR_TYPES); 1396 type, NUM_OF_NET_ERROR_TYPES);
1397 } 1397 }
1398 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount", 1398 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount",
1399 type, NUM_OF_NET_ERROR_TYPES); 1399 type, NUM_OF_NET_ERROR_TYPES);
1400 } 1400 }
1401 1401
1402 } // namespace net 1402 } // namespace net
OLDNEW
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_vms.cc ('k') | net/http/http_auth_gssapi_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698