OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/service/remoting/chromoting_host_manager.h" | 5 #include "chrome/service/remoting/chromoting_host_manager.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "chrome/common/chrome_paths.h" | 8 #include "chrome/common/chrome_paths.h" |
9 #include "chrome/common/guid.h" | 9 #include "chrome/common/guid.h" |
10 #include "chrome/common/remoting/chromoting_host_info.h" | 10 #include "chrome/common/remoting/chromoting_host_info.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 enabled); | 158 enabled); |
159 chromoting_config_->Save(); | 159 chromoting_config_->Save(); |
160 } | 160 } |
161 | 161 |
162 void ChromotingHostManager::Start() { | 162 void ChromotingHostManager::Start() { |
163 // Don't do anything if we already started. | 163 // Don't do anything if we already started. |
164 if (chromoting_host_.get()) | 164 if (chromoting_host_.get()) |
165 return; | 165 return; |
166 | 166 |
167 // Start the chromoting context first. | 167 // Start the chromoting context first. |
168 chromoting_context_.reset(new remoting::ChromotingHostContext()); | 168 chromoting_context_.reset( |
| 169 new remoting::ChromotingHostContext(main_message_loop_)); |
169 chromoting_context_->Start(); | 170 chromoting_context_->Start(); |
170 | 171 |
171 // Create a chromoting host object. | 172 // Create a chromoting host object. |
172 chromoting_host_ = remoting::ChromotingHost::Create(chromoting_context_.get(), | 173 chromoting_host_ = remoting::ChromotingHost::Create(chromoting_context_.get(), |
173 chromoting_config_); | 174 chromoting_config_); |
174 | 175 |
175 // Then start the chromoting host. | 176 // Then start the chromoting host. |
176 // When ChromotingHost is shutdown because of failure or a request that | 177 // When ChromotingHost is shutdown because of failure or a request that |
177 // we made OnChromotingShutdown() is calls. | 178 // we made OnChromotingShutdown() is calls. |
178 chromoting_host_->Start( | 179 chromoting_host_->Start( |
(...skipping 10 matching lines...) Expand all Loading... |
189 chromoting_context_.reset(); | 190 chromoting_context_.reset(); |
190 chromoting_host_ = NULL; | 191 chromoting_host_ = NULL; |
191 | 192 |
192 if (shutdown_task_.get()) { | 193 if (shutdown_task_.get()) { |
193 shutdown_task_->Run(); | 194 shutdown_task_->Run(); |
194 shutdown_task_.reset(); | 195 shutdown_task_.reset(); |
195 } | 196 } |
196 } | 197 } |
197 | 198 |
198 } // namespace remoting | 199 } // namespace remoting |
OLD | NEW |