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

Unified Diff: net/dns/dns_response.cc

Issue 1769783002: Migrate net::IPAddressList to net::IPAddress. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments eroman Created 4 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
« content/renderer/p2p/socket_dispatcher.h ('K') | « net/base/ip_address_number.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_response.cc
diff --git a/net/dns/dns_response.cc b/net/dns/dns_response.cc
index c11b8a9c8afb98456978b52ce82b3e4a2a68184f..98967899156faad218b343c54b81f3cfb2eb3291 100644
--- a/net/dns/dns_response.cc
+++ b/net/dns/dns_response.cc
@@ -11,6 +11,7 @@
#include "base/sys_byteorder.h"
#include "net/base/address_list.h"
#include "net/base/io_buffer.h"
+#include "net/base/ip_address.h"
#include "net/base/net_errors.h"
#include "net/dns/dns_protocol.h"
#include "net/dns/dns_query.h"
@@ -290,7 +291,8 @@ DnsResponse::Result DnsResponse::ParseToAddressList(
expected_type == dns_protocol::kTypeAAAA);
size_t expected_size = (expected_type == dns_protocol::kTypeAAAA)
- ? kIPv6AddressSize : kIPv4AddressSize;
+ ? IPAddress::kIPv6AddressSize
+ : IPAddress::kIPv4AddressSize;
uint32_t ttl_sec = std::numeric_limits<uint32_t>::max();
IPAddressList ip_addresses;
@@ -322,8 +324,9 @@ DnsResponse::Result DnsResponse::ParseToAddressList(
return DNS_NAME_MISMATCH;
ttl_sec = std::min(ttl_sec, record.ttl);
- ip_addresses.push_back(IPAddressNumber(record.rdata.begin(),
- record.rdata.end()));
+ ip_addresses.push_back(
+ IPAddress(reinterpret_cast<const uint8_t*>(record.rdata.data()),
+ record.rdata.length()));
}
}
« content/renderer/p2p/socket_dispatcher.h ('K') | « net/base/ip_address_number.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698