| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/daemon_process.h" | 5 #include "remoting/host/daemon_process.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 OnClientDisconnected(jid)); | 327 OnClientDisconnected(jid)); |
| 328 } | 328 } |
| 329 | 329 |
| 330 void DaemonProcess::OnClientRouteChange(const std::string& jid, | 330 void DaemonProcess::OnClientRouteChange(const std::string& jid, |
| 331 const std::string& channel_name, | 331 const std::string& channel_name, |
| 332 const SerializedTransportRoute& route) { | 332 const SerializedTransportRoute& route) { |
| 333 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 333 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 334 | 334 |
| 335 protocol::TransportRoute parsed_route; | 335 protocol::TransportRoute parsed_route; |
| 336 parsed_route.type = route.type; | 336 parsed_route.type = route.type; |
| 337 parsed_route.remote_address = route.remote_address; | 337 |
| 338 parsed_route.local_address = route.local_address; | 338 net::IPAddress remote_ip(route.remote_ip); |
| 339 CHECK(remote_ip.empty() || remote_ip.IsValid()); |
| 340 parsed_route.remote_address = net::IPEndPoint(remote_ip, route.remote_port); |
| 341 |
| 342 net::IPAddress local_ip(route.local_ip); |
| 343 CHECK(local_ip.empty() || local_ip.IsValid()); |
| 344 parsed_route.local_address = net::IPEndPoint(local_ip, route.local_port); |
| 345 |
| 339 FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, | 346 FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, |
| 340 OnClientRouteChange(jid, channel_name, parsed_route)); | 347 OnClientRouteChange(jid, channel_name, parsed_route)); |
| 341 } | 348 } |
| 342 | 349 |
| 343 void DaemonProcess::OnHostStarted(const std::string& xmpp_login) { | 350 void DaemonProcess::OnHostStarted(const std::string& xmpp_login) { |
| 344 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 351 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 345 | 352 |
| 346 FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, OnStart(xmpp_login)); | 353 FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, OnStart(xmpp_login)); |
| 347 } | 354 } |
| 348 | 355 |
| 349 void DaemonProcess::OnHostShutdown() { | 356 void DaemonProcess::OnHostShutdown() { |
| 350 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 357 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 351 | 358 |
| 352 FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, OnShutdown()); | 359 FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, OnShutdown()); |
| 353 } | 360 } |
| 354 | 361 |
| 355 void DaemonProcess::DeleteAllDesktopSessions() { | 362 void DaemonProcess::DeleteAllDesktopSessions() { |
| 356 while (!desktop_sessions_.empty()) { | 363 while (!desktop_sessions_.empty()) { |
| 357 delete desktop_sessions_.front(); | 364 delete desktop_sessions_.front(); |
| 358 desktop_sessions_.pop_front(); | 365 desktop_sessions_.pop_front(); |
| 359 } | 366 } |
| 360 } | 367 } |
| 361 | 368 |
| 362 } // namespace remoting | 369 } // namespace remoting |
| OLD | NEW |