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 a standalone host process for Me2Me. | 5 // This file implements a standalone host process for Me2Me. |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 std::string local_certificate = key_pair_->GenerateCertificate(); | 472 std::string local_certificate = key_pair_->GenerateCertificate(); |
473 if (local_certificate.empty()) { | 473 if (local_certificate.empty()) { |
474 LOG(ERROR) << "Failed to generate host certificate."; | 474 LOG(ERROR) << "Failed to generate host certificate."; |
475 ShutdownHost(kInitializationFailed); | 475 ShutdownHost(kInitializationFailed); |
476 return; | 476 return; |
477 } | 477 } |
478 | 478 |
479 // TODO(jamiewalch): Add a pairing registry here once all the code | 479 // TODO(jamiewalch): Add a pairing registry here once all the code |
480 // is committed. | 480 // is committed. |
481 scoped_refptr<remoting::protocol::PairingRegistry> pairing_registry; | 481 scoped_refptr<remoting::protocol::PairingRegistry> pairing_registry; |
482 //scoped_refptr<protocol::PairingRegistry> pairing_registry( | |
483 // new protocol::PairingRegistry( | |
484 // scoped_ptr<protocol::PairingRegistry::Delegate>( | |
485 // new protocol::NotImplementedPairingRegistryDelegate), | |
486 // protocol::PairingRegistry::PairedClients())); | |
487 | 482 |
488 scoped_ptr<protocol::AuthenticatorFactory> factory; | 483 scoped_ptr<protocol::AuthenticatorFactory> factory; |
489 | 484 |
490 if (token_url_.is_empty() && token_validation_url_.is_empty()) { | 485 if (token_url_.is_empty() && token_validation_url_.is_empty()) { |
491 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithSharedSecret( | 486 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithSharedSecret( |
492 local_certificate, key_pair_, host_secret_hash_, pairing_registry); | 487 local_certificate, key_pair_, host_secret_hash_, pairing_registry); |
493 | 488 |
494 } else if (token_url_.is_valid() && token_validation_url_.is_valid()) { | 489 } else if (token_url_.is_valid() && token_validation_url_.is_valid()) { |
495 scoped_ptr<protocol::ThirdPartyHostAuthenticator::TokenValidatorFactory> | 490 scoped_ptr<protocol::ThirdPartyHostAuthenticator::TokenValidatorFactory> |
496 token_validator_factory(new TokenValidatorFactoryImpl( | 491 token_validator_factory(new TokenValidatorFactoryImpl( |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 return exit_code; | 1096 return exit_code; |
1102 } | 1097 } |
1103 | 1098 |
1104 } // namespace remoting | 1099 } // namespace remoting |
1105 | 1100 |
1106 #if !defined(OS_WIN) | 1101 #if !defined(OS_WIN) |
1107 int main(int argc, char** argv) { | 1102 int main(int argc, char** argv) { |
1108 return remoting::HostMain(argc, argv); | 1103 return remoting::HostMain(argc, argv); |
1109 } | 1104 } |
1110 #endif // !defined(OS_WIN) | 1105 #endif // !defined(OS_WIN) |
OLD | NEW |