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

Unified Diff: net/interfaces/ip_address_struct_traits.h

Issue 2881673002: Avoid heap allocations in IPAddress (Closed)
Patch Set: DCHECK 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
Index: net/interfaces/ip_address_struct_traits.h
diff --git a/net/interfaces/ip_address_struct_traits.h b/net/interfaces/ip_address_struct_traits.h
index 9c97baf8f6f11a02510769c9a406bb364d51f48a..03ae2e8f15b170aae6eb3cf8d33ad6992cb20993 100644
--- a/net/interfaces/ip_address_struct_traits.h
+++ b/net/interfaces/ip_address_struct_traits.h
@@ -12,8 +12,8 @@
namespace mojo {
template <>
struct StructTraits<net::interfaces::IPAddressDataView, net::IPAddress> {
- static const std::vector<uint8_t>& address(const net::IPAddress& ip_address) {
- return ip_address.bytes();
+ static const std::vector<uint8_t> address(const net::IPAddress& ip_address) {
+ return ip_address.BytesAsVector();
}
static bool Read(net::interfaces::IPAddressDataView obj, net::IPAddress* out);

Powered by Google App Engine
This is Rietveld 408576698