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

Unified Diff: ppapi/shared_impl/private/net_address_private_impl.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 | « ppapi/shared_impl/private/net_address_private_impl.h ('k') | remoting/host/daemon_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/private/net_address_private_impl.cc
diff --git a/ppapi/shared_impl/private/net_address_private_impl.cc b/ppapi/shared_impl/private/net_address_private_impl.cc
index d410d8f28dbe7286b1e5b78391c2a2db00623dd5..750a5f90262b54c81e0437639cd1be238ca52d25 100644
--- a/ppapi/shared_impl/private/net_address_private_impl.cc
+++ b/ppapi/shared_impl/private/net_address_private_impl.cc
@@ -451,7 +451,7 @@ bool NetAddressPrivateImpl::SockaddrToNetAddress(
// static
bool NetAddressPrivateImpl::IPEndPointToNetAddress(
- const std::vector<uint8_t>& address,
+ const net::IPAddressBytes& address,
uint16_t port,
PP_NetAddress_Private* addr) {
if (!addr)
@@ -484,7 +484,7 @@ bool NetAddressPrivateImpl::IPEndPointToNetAddress(
// static
bool NetAddressPrivateImpl::NetAddressToIPEndPoint(
const PP_NetAddress_Private& addr,
- std::vector<uint8_t>* address,
+ net::IPAddressBytes* address,
uint16_t* port) {
if (!address || !port)
return false;
@@ -495,8 +495,7 @@ bool NetAddressPrivateImpl::NetAddressToIPEndPoint(
*port = net_addr->port;
size_t address_size = GetAddressSize(net_addr);
- address->assign(&net_addr->address[0], &net_addr->address[address_size]);
-
+ address->Assign(net_addr->address, address_size);
return true;
}
#endif // !defined(OS_NACL)
« no previous file with comments | « ppapi/shared_impl/private/net_address_private_impl.h ('k') | remoting/host/daemon_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698