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

Unified Diff: net/dns/mojo_host_struct_traits.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/dns/mojo_host_struct_traits.h ('k') | net/interfaces/ip_address_struct_traits.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/mojo_host_struct_traits.cc
diff --git a/net/dns/mojo_host_struct_traits.cc b/net/dns/mojo_host_struct_traits.cc
index 09f167323a1761fd92b6977256f3ab867f8d10f9..93f3baf3f655eacc8a0e9a791c45a035b369b4ce 100644
--- a/net/dns/mojo_host_struct_traits.cc
+++ b/net/dns/mojo_host_struct_traits.cc
@@ -76,7 +76,8 @@ bool StructTraits<net::interfaces::IPEndPointDataView, net::IPEndPoint>::Read(
if (!data.ReadAddress(&bytes))
return false;
- *out = net::IPEndPoint(net::IPAddress(bytes), data.port());
+ *out =
+ net::IPEndPoint(net::IPAddress(bytes.data(), bytes.size()), data.port());
return true;
}
« no previous file with comments | « net/dns/mojo_host_struct_traits.h ('k') | net/interfaces/ip_address_struct_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698