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

Unified Diff: net/dns/dns_hosts.cc

Issue 903273002: Update from https://crrev.com/315085 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « net/dns/dns_config_service_win.cc ('k') | net/ftp/ftp_network_transaction.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_hosts.cc
diff --git a/net/dns/dns_hosts.cc b/net/dns/dns_hosts.cc
index b4d213b80c451fa24935473b53a720732f8ede7e..697ea148e007f111c368b4b53d12d09daab1d780 100644
--- a/net/dns/dns_hosts.cc
+++ b/net/dns/dns_hosts.cc
@@ -131,7 +131,6 @@ void ParseHostsWithCommaMode(const std::string& contents,
DnsHosts* dns_hosts,
ParseHostsCommaMode comma_mode) {
CHECK(dns_hosts);
- DnsHosts& hosts = *dns_hosts;
StringPiece ip_text;
IPAddressNumber ip;
@@ -156,9 +155,9 @@ void ParseHostsWithCommaMode(const std::string& contents,
} else {
DnsHostsKey key(parser.token().as_string(), family);
base::StringToLowerASCII(&key.first);
- IPAddressNumber& mapped_ip = hosts[key];
- if (mapped_ip.empty())
- mapped_ip = ip;
+ IPAddressNumber* mapped_ip = &(*dns_hosts)[key];
+ if (mapped_ip->empty())
+ *mapped_ip = ip;
// else ignore this entry (first hit counts)
}
}
« no previous file with comments | « net/dns/dns_config_service_win.cc ('k') | net/ftp/ftp_network_transaction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698