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