OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 is an application of a minimal host process in a Chromoting | 5 // This is an application of a minimal host process in a Chromoting |
6 // system. It serves the purpose of gluing different pieces together | 6 // system. It serves the purpose of gluing different pieces together |
7 // to make a functional host process for testing. | 7 // to make a functional host process for testing. |
8 // | 8 // |
9 // It peforms the following functionality: | 9 // It peforms the following functionality: |
10 // 1. Connect to the GTalk network and register the machine as a host. | 10 // 1. Connect to the GTalk network and register the machine as a host. |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 new remoting::HeartbeatSender(context.network_message_loop(), | 185 new remoting::HeartbeatSender(context.network_message_loop(), |
186 config)); | 186 config)); |
187 if (!heartbeat_sender->Init()) | 187 if (!heartbeat_sender->Init()) |
188 return 1; | 188 return 1; |
189 host_->AddStatusObserver(heartbeat_sender.get()); | 189 host_->AddStatusObserver(heartbeat_sender.get()); |
190 } | 190 } |
191 host_->AddStatusObserver(log_to_server.get()); | 191 host_->AddStatusObserver(log_to_server.get()); |
192 | 192 |
193 // Let the chromoting host run until the shutdown task is executed. | 193 // Let the chromoting host run until the shutdown task is executed. |
194 host_->Start(); | 194 host_->Start(); |
| 195 |
| 196 // Set an empty shared-secret for Me2Me. |
| 197 // TODO(lambroslambrou): This is a temporary fix, pending a Me2Me-specific |
| 198 // AuthenticatorFactory. |
| 199 if (!is_it2me_) { |
| 200 context.network_message_loop()->PostTask( |
| 201 FROM_HERE, base::Bind(&ChromotingHost::SetSharedSecret, host_.get(), |
| 202 std::string())); |
| 203 } |
| 204 |
195 message_loop.MessageLoop::Run(); | 205 message_loop.MessageLoop::Run(); |
196 | 206 |
197 // And then stop the chromoting context. | 207 // And then stop the chromoting context. |
198 context.Stop(); | 208 context.Stop(); |
199 file_io_thread.Stop(); | 209 file_io_thread.Stop(); |
200 | 210 |
201 host_ = NULL; | 211 host_ = NULL; |
202 | 212 |
203 return 0; | 213 return 0; |
204 } | 214 } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 LOG(ERROR) << "Unknown video codec: " << video_codec; | 308 LOG(ERROR) << "Unknown video codec: " << video_codec; |
299 return 1; | 309 return 1; |
300 } | 310 } |
301 config->mutable_video_configs()->push_back(ChannelConfig( | 311 config->mutable_video_configs()->push_back(ChannelConfig( |
302 transport, remoting::protocol::kDefaultStreamVersion, codec)); | 312 transport, remoting::protocol::kDefaultStreamVersion, codec)); |
303 simple_host.set_protocol_config(config.release()); | 313 simple_host.set_protocol_config(config.release()); |
304 } | 314 } |
305 | 315 |
306 return simple_host.Run(); | 316 return simple_host.Run(); |
307 } | 317 } |
OLD | NEW |