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

Unified Diff: ppapi/shared_impl/private/net_address_private_impl.h

Issue 2881673002: Avoid heap allocations in IPAddress (Closed)
Patch Set: Done 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: ppapi/shared_impl/private/net_address_private_impl.h
diff --git a/ppapi/shared_impl/private/net_address_private_impl.h b/ppapi/shared_impl/private/net_address_private_impl.h
index dd4b56a821a801dde83969d9b6c3f0c600b1c436..01aff38814ae609a842d4dd4a81e50b8fc43240f 100644
--- a/ppapi/shared_impl/private/net_address_private_impl.h
+++ b/ppapi/shared_impl/private/net_address_private_impl.h
@@ -7,9 +7,10 @@
#include <stdint.h>
#include <string>
-#include <vector>
+#include "base/containers/stack_container.h"
#include "base/macros.h"
+#include "net/base/ip_address.h"
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/ppb_net_address.h"
#include "ppapi/shared_impl/ppapi_shared_export.h"
@@ -27,12 +28,13 @@ class PPAPI_SHARED_EXPORT NetAddressPrivateImpl {
uint32_t sa_length,
PP_NetAddress_Private* net_addr);
- static bool IPEndPointToNetAddress(const std::vector<uint8_t>& address,
- uint16_t port,
- PP_NetAddress_Private* net_addr);
+ static bool IPEndPointToNetAddress(
+ const net::IPAddress::IPAddressBytes& address,
+ uint16_t port,
+ PP_NetAddress_Private* net_addr);
static bool NetAddressToIPEndPoint(const PP_NetAddress_Private& net_addr,
- std::vector<uint8_t>* address,
+ base::StackVector<uint8_t, 16>* address,
eroman 2017/05/19 22:00:07 Can this be changed to a IPAddressBytes? That woul
Ryan Hamilton 2017/05/20 03:21:44 Done.
uint16_t* port);
static std::string DescribeNetAddress(const PP_NetAddress_Private& addr,

Powered by Google App Engine
This is Rietveld 408576698