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

Side by Side Diff: net/base/net_util.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/base/mime_util.cc ('k') | net/base/network_change_notifier.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/base/net_util.h" 5 #include "net/base/net_util.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 #endif 58 #endif
59 #if defined(OS_WIN) 59 #if defined(OS_WIN)
60 #include "net/base/winsock_init.h" 60 #include "net/base/winsock_init.h"
61 #endif 61 #endif
62 62
63 namespace net { 63 namespace net {
64 64
65 namespace { 65 namespace {
66 66
67 std::string NormalizeHostname(const std::string& host) { 67 std::string NormalizeHostname(const std::string& host) {
68 std::string result = base::StringToLowerASCII(host); 68 std::string result = base::ToLowerASCII(host);
69 if (!result.empty() && *result.rbegin() == '.') 69 if (!result.empty() && *result.rbegin() == '.')
70 result.resize(result.size() - 1); 70 result.resize(result.size() - 1);
71 return result; 71 return result;
72 } 72 }
73 73
74 bool IsNormalizedLocalhostTLD(const std::string& host) { 74 bool IsNormalizedLocalhostTLD(const std::string& host) {
75 return base::EndsWith(host, ".localhost", base::CompareCase::SENSITIVE); 75 return base::EndsWith(host, ".localhost", base::CompareCase::SENSITIVE);
76 } 76 }
77 77
78 // |host| should be normalized. 78 // |host| should be normalized.
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 }; 623 };
624 const std::string& host = url.host(); 624 const std::string& host = url.host();
625 for (const char* suffix : kGoogleHostSuffixes) { 625 for (const char* suffix : kGoogleHostSuffixes) {
626 if (base::EndsWith(host, suffix, base::CompareCase::INSENSITIVE_ASCII)) 626 if (base::EndsWith(host, suffix, base::CompareCase::INSENSITIVE_ASCII))
627 return true; 627 return true;
628 } 628 }
629 return false; 629 return false;
630 } 630 }
631 631
632 } // namespace net 632 } // namespace net
OLDNEW
« no previous file with comments | « net/base/mime_util.cc ('k') | net/base/network_change_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698