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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 use_service_account_, host_owner_, local_certificate, key_pair_, | 799 use_service_account_, host_owner_, local_certificate, key_pair_, |
800 client_domain_, pin_hash_, pairing_registry); | 800 client_domain_, pin_hash_, pairing_registry); |
801 | 801 |
802 host_->set_pairing_registry(pairing_registry); | 802 host_->set_pairing_registry(pairing_registry); |
803 } else { | 803 } else { |
804 // ThirdPartyAuthConfig::Parse() leaves the config in a valid state, so | 804 // ThirdPartyAuthConfig::Parse() leaves the config in a valid state, so |
805 // these URLs are both valid. | 805 // these URLs are both valid. |
806 DCHECK(third_party_auth_config_.token_url.is_valid()); | 806 DCHECK(third_party_auth_config_.token_url.is_valid()); |
807 DCHECK(third_party_auth_config_.token_validation_url.is_valid()); | 807 DCHECK(third_party_auth_config_.token_validation_url.is_valid()); |
808 | 808 |
809 scoped_ptr<protocol::TokenValidatorFactory> token_validator_factory( | 809 scoped_refptr<protocol::TokenValidatorFactory> token_validator_factory = |
810 new TokenValidatorFactoryImpl( | 810 new TokenValidatorFactoryImpl(third_party_auth_config_, key_pair_, |
811 third_party_auth_config_, | 811 context_->url_request_context_getter()); |
812 key_pair_, context_->url_request_context_getter())); | |
813 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithThirdPartyAuth( | 812 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithThirdPartyAuth( |
814 use_service_account_, host_owner_, local_certificate, key_pair_, | 813 use_service_account_, host_owner_, local_certificate, key_pair_, |
815 client_domain_, std::move(token_validator_factory)); | 814 client_domain_, token_validator_factory); |
816 } | 815 } |
817 | 816 |
818 #if defined(OS_POSIX) | 817 #if defined(OS_POSIX) |
819 // On Linux and Mac, perform a PAM authorization step after authentication. | 818 // On Linux and Mac, perform a PAM authorization step after authentication. |
820 factory.reset(new PamAuthorizationFactory(std::move(factory))); | 819 factory.reset(new PamAuthorizationFactory(std::move(factory))); |
821 #endif | 820 #endif |
822 host_->SetAuthenticatorFactory(std::move(factory)); | 821 host_->SetAuthenticatorFactory(std::move(factory)); |
823 } | 822 } |
824 | 823 |
825 // IPC::Listener implementation. | 824 // IPC::Listener implementation. |
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1744 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); | 1743 base::TimeDelta::FromSeconds(kShutdownTimeoutSeconds)); |
1745 new HostProcess(std::move(context), &exit_code, &shutdown_watchdog); | 1744 new HostProcess(std::move(context), &exit_code, &shutdown_watchdog); |
1746 | 1745 |
1747 // Run the main (also UI) message loop until the host no longer needs it. | 1746 // Run the main (also UI) message loop until the host no longer needs it. |
1748 message_loop.Run(); | 1747 message_loop.Run(); |
1749 | 1748 |
1750 return exit_code; | 1749 return exit_code; |
1751 } | 1750 } |
1752 | 1751 |
1753 } // namespace remoting | 1752 } // namespace remoting |
OLD | NEW |