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

Unified Diff: net/dns/mdns_client.cc

Issue 2881673002: Avoid heap allocations in IPAddress (Closed)
Patch Set: New constructor Created 3 years, 7 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/cert/internal/name_constraints.cc ('k') | net/dns/mojo_host_struct_traits.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/mdns_client.cc
diff --git a/net/dns/mdns_client.cc b/net/dns/mdns_client.cc
index 2e18945d3754fdd8d4ec40adf591d2777122f552..00d9655c1fc1d09633b332c20bf235b4ab5eeed9 100644
--- a/net/dns/mdns_client.cc
+++ b/net/dns/mdns_client.cc
@@ -29,7 +29,7 @@ IPEndPoint GetMDnsIPEndPoint(const char* address) {
int Bind(const IPEndPoint& multicast_addr,
uint32_t interface_index,
DatagramServerSocket* socket) {
- IPAddress address_any(std::vector<uint8_t>(multicast_addr.address().size()));
+ IPAddress address_any(IPAddress::AllZeros(multicast_addr.address().size()));
IPEndPoint bind_endpoint(address_any, multicast_addr.port());
socket->AllowAddressReuse();
« no previous file with comments | « net/cert/internal/name_constraints.cc ('k') | net/dns/mojo_host_struct_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698