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

Side by Side Diff: net/dns/dns_hosts.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_config_service_win.cc ('k') | net/dns/host_resolver_impl.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/dns_hosts.h" 5 #include "net/dns/dns_hosts.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 if (ParseIPLiteralToNumber(parser.token().as_string(), &new_ip)) { 148 if (ParseIPLiteralToNumber(parser.token().as_string(), &new_ip)) {
149 ip_text = new_ip_text; 149 ip_text = new_ip_text;
150 ip.swap(new_ip); 150 ip.swap(new_ip);
151 family = (ip.size() == 4) ? ADDRESS_FAMILY_IPV4 : ADDRESS_FAMILY_IPV6; 151 family = (ip.size() == 4) ? ADDRESS_FAMILY_IPV4 : ADDRESS_FAMILY_IPV6;
152 } else { 152 } else {
153 parser.SkipRestOfLine(); 153 parser.SkipRestOfLine();
154 } 154 }
155 } 155 }
156 } else { 156 } else {
157 DnsHostsKey key(parser.token().as_string(), family); 157 DnsHostsKey key(parser.token().as_string(), family);
158 StringToLowerASCII(&key.first); 158 base::StringToLowerASCII(&key.first);
159 IPAddressNumber& mapped_ip = hosts[key]; 159 IPAddressNumber& mapped_ip = hosts[key];
160 if (mapped_ip.empty()) 160 if (mapped_ip.empty())
161 mapped_ip = ip; 161 mapped_ip = ip;
162 // else ignore this entry (first hit counts) 162 // else ignore this entry (first hit counts)
163 } 163 }
164 } 164 }
165 } 165 }
166 166
167 } // namespace 167 } // namespace
168 168
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 std::string contents; 205 std::string contents;
206 if (!base::ReadFileToString(path, &contents)) 206 if (!base::ReadFileToString(path, &contents))
207 return false; 207 return false;
208 208
209 ParseHosts(contents, dns_hosts); 209 ParseHosts(contents, dns_hosts);
210 return true; 210 return true;
211 } 211 }
212 212
213 } // namespace net 213 } // namespace net
214 214
OLDNEW
« no previous file with comments | « net/dns/dns_config_service_win.cc ('k') | net/dns/host_resolver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698