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 // This file implements the Windows service controlling Me2Me host processes | 5 // This file implements the Windows service controlling Me2Me host processes |
6 // running within user sessions. | 6 // running within user sessions. |
7 | 7 |
8 #include "remoting/host/desktop_process.h" | 8 #include "remoting/host/desktop_process.h" |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 namespace remoting { | 24 namespace remoting { |
25 | 25 |
26 DesktopProcess::DesktopProcess( | 26 DesktopProcess::DesktopProcess( |
27 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 27 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
28 scoped_refptr<AutoThreadTaskRunner> input_task_runner, | 28 scoped_refptr<AutoThreadTaskRunner> input_task_runner, |
29 const std::string& daemon_channel_name) | 29 const std::string& daemon_channel_name) |
30 : caller_task_runner_(caller_task_runner), | 30 : caller_task_runner_(caller_task_runner), |
31 input_task_runner_(input_task_runner), | 31 input_task_runner_(input_task_runner), |
32 daemon_channel_name_(daemon_channel_name) { | 32 daemon_channel_name_(daemon_channel_name) { |
33 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 33 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
34 DCHECK_EQ(MessageLoop::current()->type(), MessageLoop::TYPE_UI); | 34 DCHECK_EQ(base::MessageLoop::current()->type(), base::MessageLoop::TYPE_UI); |
35 } | 35 } |
36 | 36 |
37 DesktopProcess::~DesktopProcess() { | 37 DesktopProcess::~DesktopProcess() { |
38 DCHECK(!daemon_channel_); | 38 DCHECK(!daemon_channel_); |
39 DCHECK(!desktop_agent_); | 39 DCHECK(!desktop_agent_); |
40 } | 40 } |
41 | 41 |
42 DesktopEnvironmentFactory& DesktopProcess::desktop_environment_factory() { | 42 DesktopEnvironmentFactory& DesktopProcess::desktop_environment_factory() { |
43 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 43 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
44 | 44 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 DCHECK(!desktop_environment_factory_); | 95 DCHECK(!desktop_environment_factory_); |
96 DCHECK(desktop_environment_factory); | 96 DCHECK(desktop_environment_factory); |
97 | 97 |
98 desktop_environment_factory_ = desktop_environment_factory.Pass(); | 98 desktop_environment_factory_ = desktop_environment_factory.Pass(); |
99 | 99 |
100 // Launch the audio capturing thread. | 100 // Launch the audio capturing thread. |
101 scoped_refptr<AutoThreadTaskRunner> audio_task_runner; | 101 scoped_refptr<AutoThreadTaskRunner> audio_task_runner; |
102 #if defined(OS_WIN) | 102 #if defined(OS_WIN) |
103 // On Windows the AudioCapturer requires COM, so we run a single-threaded | 103 // On Windows the AudioCapturer requires COM, so we run a single-threaded |
104 // apartment, which requires a UI thread. | 104 // apartment, which requires a UI thread. |
105 audio_task_runner = AutoThread::CreateWithLoopAndComInitTypes( | 105 audio_task_runner = |
106 "ChromotingAudioThread", caller_task_runner_, MessageLoop::TYPE_UI, | 106 AutoThread::CreateWithLoopAndComInitTypes("ChromotingAudioThread", |
107 AutoThread::COM_INIT_STA); | 107 caller_task_runner_, |
| 108 base::MessageLoop::TYPE_UI, |
| 109 AutoThread::COM_INIT_STA); |
108 #else // !defined(OS_WIN) | 110 #else // !defined(OS_WIN) |
109 audio_task_runner = AutoThread::CreateWithType( | 111 audio_task_runner = AutoThread::CreateWithType( |
110 "ChromotingAudioThread", caller_task_runner_, MessageLoop::TYPE_IO); | 112 "ChromotingAudioThread", caller_task_runner_, base::MessageLoop::TYPE_IO); |
111 #endif // !defined(OS_WIN) | 113 #endif // !defined(OS_WIN) |
112 | 114 |
113 // Launch the I/O thread. | 115 // Launch the I/O thread. |
114 scoped_refptr<AutoThreadTaskRunner> io_task_runner = | 116 scoped_refptr<AutoThreadTaskRunner> io_task_runner = |
115 AutoThread::CreateWithType("I/O thread", caller_task_runner_, | 117 AutoThread::CreateWithType( |
116 MessageLoop::TYPE_IO); | 118 "I/O thread", caller_task_runner_, base::MessageLoop::TYPE_IO); |
117 | 119 |
118 // Launch the video capture thread. | 120 // Launch the video capture thread. |
119 scoped_refptr<AutoThreadTaskRunner> video_capture_task_runner = | 121 scoped_refptr<AutoThreadTaskRunner> video_capture_task_runner = |
120 AutoThread::Create("Video capture thread", caller_task_runner_); | 122 AutoThread::Create("Video capture thread", caller_task_runner_); |
121 | 123 |
122 // Create a desktop agent. | 124 // Create a desktop agent. |
123 desktop_agent_ = DesktopSessionAgent::Create(audio_task_runner, | 125 desktop_agent_ = DesktopSessionAgent::Create(audio_task_runner, |
124 caller_task_runner_, | 126 caller_task_runner_, |
125 input_task_runner_, | 127 input_task_runner_, |
126 io_task_runner, | 128 io_task_runner, |
(...skipping 29 matching lines...) Expand all Loading... |
156 base::snprintf(message, sizeof(message), | 158 base::snprintf(message, sizeof(message), |
157 "Requested by %s at %s, line %d.", | 159 "Requested by %s at %s, line %d.", |
158 function_name.c_str(), file_name.c_str(), line_number); | 160 function_name.c_str(), file_name.c_str(), line_number); |
159 base::debug::Alias(message); | 161 base::debug::Alias(message); |
160 | 162 |
161 // The daemon requested us to crash the process. | 163 // The daemon requested us to crash the process. |
162 CHECK(false) << message; | 164 CHECK(false) << message; |
163 } | 165 } |
164 | 166 |
165 } // namespace remoting | 167 } // namespace remoting |
OLD | NEW |