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

Unified Diff: net/dns/dns_hosts.cc

Issue 9721002: [net/dns] Removes locking from DnsConfigServiceWin and adds local computer name. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Extract local IP from GetAdapterAddresses. Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: net/dns/dns_hosts.cc
diff --git a/net/dns/dns_hosts.cc b/net/dns/dns_hosts.cc
index bd469121762c9e4bbab76f4b1cc014e71ddf6c6c..28449c3d8e51e5cdc98e472c23b2514b33ec556b 100644
--- a/net/dns/dns_hosts.cc
+++ b/net/dns/dns_hosts.cc
@@ -34,6 +34,7 @@ void ParseHosts(const std::string& contents, DnsHosts* dns_hosts) {
AddressFamily fam = (ip.size() == 4) ? ADDRESS_FAMILY_IPV4 :
ADDRESS_FAMILY_IPV6;
while (tokens.GetNext()) {
+ // TODO(szym): Normalize name to lowercase. http://crbug.com/118995
IPAddressNumber& mapped_ip = hosts[DnsHostsKey(tokens.token(), fam)];
if (mapped_ip.empty())
mapped_ip = ip;
@@ -52,6 +53,11 @@ DnsHostsReader::DnsHostsReader(const FilePath& path,
DCHECK(!callback.is_null());
}
+DnsHostsReader::DnsHostsReader(const FilePath& path)
+ : path_(path),
+ success_(false) {
+}
+
// Reads the contents of the file at |path| into |str| if the total length is
// less than |max_size|.
static bool ReadFile(const FilePath& path, int64 max_size, std::string* str) {

Powered by Google App Engine
This is Rietveld 408576698