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

Unified Diff: net/interfaces/ip_address_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/interfaces/ip_address_struct_traits.h ('k') | net/quic/platform/impl/quic_ip_address_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/interfaces/ip_address_struct_traits.cc
diff --git a/net/interfaces/ip_address_struct_traits.cc b/net/interfaces/ip_address_struct_traits.cc
index b23ac880cb0043e05569ce9b5b826ecd77953607..e93b13e5400d7f812a30f266eb7328ef8c35e365 100644
--- a/net/interfaces/ip_address_struct_traits.cc
+++ b/net/interfaces/ip_address_struct_traits.cc
@@ -13,7 +13,7 @@ bool StructTraits<net::interfaces::IPAddressDataView, net::IPAddress>::Read(
if (!data.ReadAddress(&bytes))
return false;
- *out = net::IPAddress(bytes);
+ *out = net::IPAddress(bytes.data(), bytes.size());
return out->IsValid();
}
« no previous file with comments | « net/interfaces/ip_address_struct_traits.h ('k') | net/quic/platform/impl/quic_ip_address_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698