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 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 heartbeat_sender_.reset(new HeartbeatSender( | 259 heartbeat_sender_.reset(new HeartbeatSender( |
260 this, host_id_, signal_strategy_.get(), &key_pair_)); | 260 this, host_id_, signal_strategy_.get(), &key_pair_)); |
261 } | 261 } |
262 | 262 |
263 host_->Start(); | 263 host_->Start(); |
264 | 264 |
265 // Create a Me2Me authenticator factory. | 265 // Create a Me2Me authenticator factory. |
266 if (!is_it2me_) { | 266 if (!is_it2me_) { |
267 scoped_ptr<protocol::AuthenticatorFactory> factory( | 267 scoped_ptr<protocol::AuthenticatorFactory> factory( |
268 new protocol::Me2MeHostAuthenticatorFactory( | 268 new protocol::Me2MeHostAuthenticatorFactory( |
269 xmpp_login_, key_pair_.GenerateCertificate(), | 269 key_pair_.GenerateCertificate(), *key_pair_.private_key(), |
270 *key_pair_.private_key(), host_secret_hash_)); | 270 host_secret_hash_)); |
271 host_->SetAuthenticatorFactory(factory.Pass()); | 271 host_->SetAuthenticatorFactory(factory.Pass()); |
272 } | 272 } |
273 } | 273 } |
274 | 274 |
275 void OnAuthFailed() { | 275 void OnAuthFailed() { |
276 Shutdown(kInvalidOauthCredentialsExitCode); | 276 Shutdown(kInvalidOauthCredentialsExitCode); |
277 } | 277 } |
278 | 278 |
279 void Shutdown(int exit_code) { | 279 void Shutdown(int exit_code) { |
280 DCHECK(context_.network_message_loop()->BelongsToCurrentThread()); | 280 DCHECK(context_.network_message_loop()->BelongsToCurrentThread()); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 max_port < 0 || max_port > 65535) { | 411 max_port < 0 || max_port > 65535) { |
412 LOG(ERROR) << "Invalid max-port value: " << max_port | 412 LOG(ERROR) << "Invalid max-port value: " << max_port |
413 << ". Expected integer in range [0, 65535]."; | 413 << ". Expected integer in range [0, 65535]."; |
414 return 1; | 414 return 1; |
415 } | 415 } |
416 simple_host.network_settings()->max_port = max_port; | 416 simple_host.network_settings()->max_port = max_port; |
417 } | 417 } |
418 | 418 |
419 return simple_host.Run(); | 419 return simple_host.Run(); |
420 } | 420 } |
OLD | NEW |