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/callback_helpers.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
16 #include "base/location.h" | 16 #include "base/location.h" |
17 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
| 18 #include "ipc/attachment_broker_privileged.h" |
18 #include "net/base/net_util.h" | 19 #include "net/base/net_util.h" |
19 #include "remoting/base/auto_thread_task_runner.h" | 20 #include "remoting/base/auto_thread_task_runner.h" |
20 #include "remoting/host/branding.h" | 21 #include "remoting/host/branding.h" |
21 #include "remoting/host/chromoting_messages.h" | 22 #include "remoting/host/chromoting_messages.h" |
22 #include "remoting/host/config_file_watcher.h" | 23 #include "remoting/host/config_file_watcher.h" |
23 #include "remoting/host/desktop_session.h" | 24 #include "remoting/host/desktop_session.h" |
24 #include "remoting/host/host_event_logger.h" | 25 #include "remoting/host/host_event_logger.h" |
25 #include "remoting/host/host_exit_codes.h" | 26 #include "remoting/host/host_exit_codes.h" |
26 #include "remoting/host/host_status_observer.h" | 27 #include "remoting/host/host_status_observer.h" |
27 #include "remoting/host/screen_resolution.h" | 28 #include "remoting/host/screen_resolution.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 DaemonProcess::DaemonProcess( | 177 DaemonProcess::DaemonProcess( |
177 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 178 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
178 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 179 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
179 const base::Closure& stopped_callback) | 180 const base::Closure& stopped_callback) |
180 : caller_task_runner_(caller_task_runner), | 181 : caller_task_runner_(caller_task_runner), |
181 io_task_runner_(io_task_runner), | 182 io_task_runner_(io_task_runner), |
182 next_terminal_id_(0), | 183 next_terminal_id_(0), |
183 stopped_callback_(stopped_callback), | 184 stopped_callback_(stopped_callback), |
184 weak_factory_(this) { | 185 weak_factory_(this) { |
185 DCHECK(caller_task_runner->BelongsToCurrentThread()); | 186 DCHECK(caller_task_runner->BelongsToCurrentThread()); |
| 187 |
| 188 // TODO(sergeyu): On OSX AttachmentBroker depends on base::PortProvider |
| 189 // implementation. Add it here when this code is used on OSX. |
| 190 #if !defined(OS_MACOSX) |
| 191 IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded(); |
| 192 #endif // !defined(OS_MACOSX) |
186 } | 193 } |
187 | 194 |
188 void DaemonProcess::CreateDesktopSession(int terminal_id, | 195 void DaemonProcess::CreateDesktopSession(int terminal_id, |
189 const ScreenResolution& resolution, | 196 const ScreenResolution& resolution, |
190 bool virtual_terminal) { | 197 bool virtual_terminal) { |
191 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 198 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
192 | 199 |
193 // Validate the supplied terminal ID. An attempt to create a desktop session | 200 // Validate the supplied terminal ID. An attempt to create a desktop session |
194 // with an ID that could possibly have been allocated already is considered | 201 // with an ID that could possibly have been allocated already is considered |
195 // a protocol error and the network process will be restarted. | 202 // a protocol error and the network process will be restarted. |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 } | 380 } |
374 | 381 |
375 void DaemonProcess::DeleteAllDesktopSessions() { | 382 void DaemonProcess::DeleteAllDesktopSessions() { |
376 while (!desktop_sessions_.empty()) { | 383 while (!desktop_sessions_.empty()) { |
377 delete desktop_sessions_.front(); | 384 delete desktop_sessions_.front(); |
378 desktop_sessions_.pop_front(); | 385 desktop_sessions_.pop_front(); |
379 } | 386 } |
380 } | 387 } |
381 | 388 |
382 } // namespace remoting | 389 } // namespace remoting |
OLD | NEW |