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

Unified Diff: remoting/host/daemon_process.cc

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: remoting/host/daemon_process.cc
diff --git a/remoting/host/daemon_process.cc b/remoting/host/daemon_process.cc
index 0cf6a8143391d362a1ab402dd1acd25861e5f3d2..7e3142da453b9851d676f8eea3f9f72b192f4b40 100644
--- a/remoting/host/daemon_process.cc
+++ b/remoting/host/daemon_process.cc
@@ -332,11 +332,11 @@ void DaemonProcess::OnClientRouteChange(const std::string& jid,
protocol::TransportRoute parsed_route;
parsed_route.type = route.type;
- net::IPAddress remote_ip(route.remote_ip);
+ net::IPAddress remote_ip(route.remote_ip.data(), route.remote_ip.size());
CHECK(remote_ip.empty() || remote_ip.IsValid());
parsed_route.remote_address = net::IPEndPoint(remote_ip, route.remote_port);
- net::IPAddress local_ip(route.local_ip);
+ net::IPAddress local_ip(route.local_ip.data(), route.local_ip.size());
CHECK(local_ip.empty() || local_ip.IsValid());
parsed_route.local_address = net::IPEndPoint(local_ip, route.local_port);

Powered by Google App Engine
This is Rietveld 408576698