| 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" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/callback_helpers.h" |
| 12 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 13 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 14 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
| 15 #include "base/location.h" | 16 #include "base/location.h" |
| 16 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
| 17 #include "net/base/net_util.h" | 18 #include "net/base/net_util.h" |
| 18 #include "remoting/base/auto_thread_task_runner.h" | 19 #include "remoting/base/auto_thread_task_runner.h" |
| 19 #include "remoting/host/branding.h" | 20 #include "remoting/host/branding.h" |
| 20 #include "remoting/host/chromoting_messages.h" | 21 #include "remoting/host/chromoting_messages.h" |
| 21 #include "remoting/host/config_file_watcher.h" | 22 #include "remoting/host/config_file_watcher.h" |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 HostEventLogger::Create(weak_factory_.GetWeakPtr(), kApplicationName); | 279 HostEventLogger::Create(weak_factory_.GetWeakPtr(), kApplicationName); |
| 279 | 280 |
| 280 // Launch the process. | 281 // Launch the process. |
| 281 LaunchNetworkProcess(); | 282 LaunchNetworkProcess(); |
| 282 } | 283 } |
| 283 | 284 |
| 284 void DaemonProcess::Stop() { | 285 void DaemonProcess::Stop() { |
| 285 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 286 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 286 | 287 |
| 287 if (!stopped_callback_.is_null()) { | 288 if (!stopped_callback_.is_null()) { |
| 288 base::Closure stopped_callback = stopped_callback_; | 289 base::ResetAndReturn(&stopped_callback_).Run(); |
| 289 stopped_callback_.Reset(); | |
| 290 stopped_callback.Run(); | |
| 291 } | 290 } |
| 292 } | 291 } |
| 293 | 292 |
| 294 bool DaemonProcess::WasTerminalIdAllocated(int terminal_id) { | 293 bool DaemonProcess::WasTerminalIdAllocated(int terminal_id) { |
| 295 return terminal_id < next_terminal_id_; | 294 return terminal_id < next_terminal_id_; |
| 296 } | 295 } |
| 297 | 296 |
| 298 void DaemonProcess::OnAccessDenied(const std::string& jid) { | 297 void DaemonProcess::OnAccessDenied(const std::string& jid) { |
| 299 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 298 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 300 | 299 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 } | 373 } |
| 375 | 374 |
| 376 void DaemonProcess::DeleteAllDesktopSessions() { | 375 void DaemonProcess::DeleteAllDesktopSessions() { |
| 377 while (!desktop_sessions_.empty()) { | 376 while (!desktop_sessions_.empty()) { |
| 378 delete desktop_sessions_.front(); | 377 delete desktop_sessions_.front(); |
| 379 desktop_sessions_.pop_front(); | 378 desktop_sessions_.pop_front(); |
| 380 } | 379 } |
| 381 } | 380 } |
| 382 | 381 |
| 383 } // namespace remoting | 382 } // namespace remoting |
| OLD | NEW |