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

Side by Side Diff: remoting/host/ipc_host_event_logger.cc

Issue 2881673002: Avoid heap allocations in IPAddress (Closed)
Patch Set: More fixes 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/ipc_host_event_logger.h" 5 #include "remoting/host/ipc_host_event_logger.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ipc/ipc_sender.h" 8 #include "ipc/ipc_sender.h"
9 #include "net/base/ip_endpoint.h" 9 #include "net/base/ip_endpoint.h"
10 #include "remoting/host/chromoting_messages.h" 10 #include "remoting/host/chromoting_messages.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 54
55 void IpcHostEventLogger::OnClientRouteChange( 55 void IpcHostEventLogger::OnClientRouteChange(
56 const std::string& jid, 56 const std::string& jid,
57 const std::string& channel_name, 57 const std::string& channel_name,
58 const protocol::TransportRoute& route) { 58 const protocol::TransportRoute& route) {
59 DCHECK(CalledOnValidThread()); 59 DCHECK(CalledOnValidThread());
60 60
61 SerializedTransportRoute serialized_route; 61 SerializedTransportRoute serialized_route;
62 serialized_route.type = route.type; 62 serialized_route.type = route.type;
63 serialized_route.remote_ip = route.remote_address.address().bytes(); 63 serialized_route.remote_ip = route.remote_address.address().BytesAsVector();
64 serialized_route.remote_port = route.remote_address.port(); 64 serialized_route.remote_port = route.remote_address.port();
65 serialized_route.local_ip = route.local_address.address().bytes(); 65 serialized_route.local_ip = route.local_address.address().BytesAsVector();
66 serialized_route.local_port = route.local_address.port(); 66 serialized_route.local_port = route.local_address.port();
67 daemon_channel_->Send(new ChromotingNetworkDaemonMsg_ClientRouteChange( 67 daemon_channel_->Send(new ChromotingNetworkDaemonMsg_ClientRouteChange(
68 jid, channel_name, serialized_route)); 68 jid, channel_name, serialized_route));
69 } 69 }
70 70
71 void IpcHostEventLogger::OnShutdown() { 71 void IpcHostEventLogger::OnShutdown() {
72 DCHECK(CalledOnValidThread()); 72 DCHECK(CalledOnValidThread());
73 73
74 daemon_channel_->Send(new ChromotingNetworkDaemonMsg_HostShutdown()); 74 daemon_channel_->Send(new ChromotingNetworkDaemonMsg_HostShutdown());
75 } 75 }
76 76
77 void IpcHostEventLogger::OnStart(const std::string& xmpp_login) { 77 void IpcHostEventLogger::OnStart(const std::string& xmpp_login) {
78 DCHECK(CalledOnValidThread()); 78 DCHECK(CalledOnValidThread());
79 79
80 daemon_channel_->Send(new ChromotingNetworkDaemonMsg_HostStarted(xmpp_login)); 80 daemon_channel_->Send(new ChromotingNetworkDaemonMsg_HostStarted(xmpp_login));
81 } 81 }
82 82
83 } // namespace remoting 83 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698