Chromium Code Reviews| 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" | |
| 19 #include "remoting/base/auto_thread_task_runner.h" | 18 #include "remoting/base/auto_thread_task_runner.h" |
| 20 #include "remoting/host/branding.h" | 19 #include "remoting/host/branding.h" |
| 21 #include "remoting/host/chromoting_messages.h" | 20 #include "remoting/host/chromoting_messages.h" |
| 22 #include "remoting/host/config_file_watcher.h" | 21 #include "remoting/host/config_file_watcher.h" |
| 23 #include "remoting/host/desktop_session.h" | 22 #include "remoting/host/desktop_session.h" |
| 24 #include "remoting/host/host_event_logger.h" | 23 #include "remoting/host/host_event_logger.h" |
| 25 #include "remoting/host/host_exit_codes.h" | 24 #include "remoting/host/host_exit_codes.h" |
| 26 #include "remoting/host/host_status_observer.h" | 25 #include "remoting/host/host_status_observer.h" |
| 27 #include "remoting/host/screen_resolution.h" | 26 #include "remoting/host/screen_resolution.h" |
| 28 #include "remoting/protocol/transport.h" | 27 #include "remoting/protocol/transport.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 176 DaemonProcess::DaemonProcess( | 175 DaemonProcess::DaemonProcess( |
| 177 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 176 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
| 178 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 177 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
| 179 const base::Closure& stopped_callback) | 178 const base::Closure& stopped_callback) |
| 180 : caller_task_runner_(caller_task_runner), | 179 : caller_task_runner_(caller_task_runner), |
| 181 io_task_runner_(io_task_runner), | 180 io_task_runner_(io_task_runner), |
| 182 next_terminal_id_(0), | 181 next_terminal_id_(0), |
| 183 stopped_callback_(stopped_callback), | 182 stopped_callback_(stopped_callback), |
| 184 weak_factory_(this) { | 183 weak_factory_(this) { |
| 185 DCHECK(caller_task_runner->BelongsToCurrentThread()); | 184 DCHECK(caller_task_runner->BelongsToCurrentThread()); |
| 186 | 185 // TODO(sergeyu): On OSX, mojo::edk::SetMachPortProvider() should be called |
|
joedow
2016/10/31 16:41:03
Since you are updating the contents of the TODO, i
Sam McNally
2016/10/31 22:34:27
Done.
| |
| 187 // TODO(sergeyu): On OSX AttachmentBroker depends on base::PortProvider | 186 // with a base::PortProvider implementation. Add it here when this code is |
| 188 // implementation. Add it here when this code is used on OSX. | 187 // used on OSX. |
| 189 #if !defined(OS_MACOSX) | |
| 190 IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded(); | |
| 191 #endif // !defined(OS_MACOSX) | |
| 192 } | 188 } |
| 193 | 189 |
| 194 void DaemonProcess::CreateDesktopSession(int terminal_id, | 190 void DaemonProcess::CreateDesktopSession(int terminal_id, |
| 195 const ScreenResolution& resolution, | 191 const ScreenResolution& resolution, |
| 196 bool virtual_terminal) { | 192 bool virtual_terminal) { |
| 197 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 193 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 198 | 194 |
| 199 // Validate the supplied terminal ID. An attempt to create a desktop session | 195 // Validate the supplied terminal ID. An attempt to create a desktop session |
| 200 // with an ID that could possibly have been allocated already is considered | 196 // with an ID that could possibly have been allocated already is considered |
| 201 // a protocol error and the network process will be restarted. | 197 // a protocol error and the network process will be restarted. |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 363 } | 359 } |
| 364 | 360 |
| 365 void DaemonProcess::DeleteAllDesktopSessions() { | 361 void DaemonProcess::DeleteAllDesktopSessions() { |
| 366 while (!desktop_sessions_.empty()) { | 362 while (!desktop_sessions_.empty()) { |
| 367 delete desktop_sessions_.front(); | 363 delete desktop_sessions_.front(); |
| 368 desktop_sessions_.pop_front(); | 364 desktop_sessions_.pop_front(); |
| 369 } | 365 } |
| 370 } | 366 } |
| 371 | 367 |
| 372 } // namespace remoting | 368 } // namespace remoting |
| OLD | NEW |