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

Side by Side Diff: net/dns/host_resolver_impl.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/dns/dns_hosts.cc ('k') | net/ftp/ftp_directory_listing_parser_vms.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/dns/host_resolver_impl.h" 5 #include "net/dns/host_resolver_impl.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <Winsock2.h> 8 #include <Winsock2.h>
9 #elif defined(OS_POSIX) 9 #elif defined(OS_POSIX)
10 #include <netdb.h> 10 #include <netdb.h>
(...skipping 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after
2070 2070
2071 bool HostResolverImpl::ServeFromHosts(const Key& key, 2071 bool HostResolverImpl::ServeFromHosts(const Key& key,
2072 const RequestInfo& info, 2072 const RequestInfo& info,
2073 AddressList* addresses) { 2073 AddressList* addresses) {
2074 DCHECK(addresses); 2074 DCHECK(addresses);
2075 if (!HaveDnsConfig()) 2075 if (!HaveDnsConfig())
2076 return false; 2076 return false;
2077 addresses->clear(); 2077 addresses->clear();
2078 2078
2079 // HOSTS lookups are case-insensitive. 2079 // HOSTS lookups are case-insensitive.
2080 std::string hostname = StringToLowerASCII(key.hostname); 2080 std::string hostname = base::StringToLowerASCII(key.hostname);
2081 2081
2082 const DnsHosts& hosts = dns_client_->GetConfig()->hosts; 2082 const DnsHosts& hosts = dns_client_->GetConfig()->hosts;
2083 2083
2084 // If |address_family| is ADDRESS_FAMILY_UNSPECIFIED other implementations 2084 // If |address_family| is ADDRESS_FAMILY_UNSPECIFIED other implementations
2085 // (glibc and c-ares) return the first matching line. We have more 2085 // (glibc and c-ares) return the first matching line. We have more
2086 // flexibility, but lose implicit ordering. 2086 // flexibility, but lose implicit ordering.
2087 // We prefer IPv6 because "happy eyeballs" will fall back to IPv4 if 2087 // We prefer IPv6 because "happy eyeballs" will fall back to IPv4 if
2088 // necessary. 2088 // necessary.
2089 if (key.address_family == ADDRESS_FAMILY_IPV6 || 2089 if (key.address_family == ADDRESS_FAMILY_IPV6 ||
2090 key.address_family == ADDRESS_FAMILY_UNSPECIFIED) { 2090 key.address_family == ADDRESS_FAMILY_UNSPECIFIED) {
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
2350 dns_client_->SetConfig(dns_config); 2350 dns_client_->SetConfig(dns_config);
2351 num_dns_failures_ = 0; 2351 num_dns_failures_ = 0;
2352 if (dns_client_->GetConfig()) 2352 if (dns_client_->GetConfig())
2353 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true); 2353 UMA_HISTOGRAM_BOOLEAN("AsyncDNS.DnsClientEnabled", true);
2354 } 2354 }
2355 2355
2356 AbortDnsTasks(); 2356 AbortDnsTasks();
2357 } 2357 }
2358 2358
2359 } // namespace net 2359 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/dns_hosts.cc ('k') | net/ftp/ftp_directory_listing_parser_vms.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698