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 | 8 |
9 #include <cstdint> | 9 #include <cstdint> |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <utility> | 12 #include <utility> |
| 13 #include <vector> |
13 | 14 |
14 #include "base/bind.h" | 15 #include "base/bind.h" |
15 #include "base/callback.h" | 16 #include "base/callback.h" |
16 #include "base/command_line.h" | 17 #include "base/command_line.h" |
17 #include "base/debug/alias.h" | 18 #include "base/debug/alias.h" |
18 #include "base/files/file_path.h" | 19 #include "base/files/file_path.h" |
19 #include "base/files/file_util.h" | 20 #include "base/files/file_util.h" |
20 #include "base/macros.h" | 21 #include "base/macros.h" |
21 #include "base/memory/ptr_util.h" | 22 #include "base/memory/ptr_util.h" |
22 #include "base/message_loop/message_loop.h" | 23 #include "base/message_loop/message_loop.h" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 // Tear down resources that run on the UI thread. | 288 // Tear down resources that run on the UI thread. |
288 void ShutdownOnUiThread(); | 289 void ShutdownOnUiThread(); |
289 | 290 |
290 // Applies the host config, returning true if successful. | 291 // Applies the host config, returning true if successful. |
291 bool ApplyConfig(const base::DictionaryValue& config); | 292 bool ApplyConfig(const base::DictionaryValue& config); |
292 | 293 |
293 // Handles policy updates, by calling On*PolicyUpdate methods. | 294 // Handles policy updates, by calling On*PolicyUpdate methods. |
294 void OnPolicyUpdate(std::unique_ptr<base::DictionaryValue> policies); | 295 void OnPolicyUpdate(std::unique_ptr<base::DictionaryValue> policies); |
295 void OnPolicyError(); | 296 void OnPolicyError(); |
296 void ReportPolicyErrorAndRestartHost(); | 297 void ReportPolicyErrorAndRestartHost(); |
297 void ApplyHostDomainPolicy(); | 298 void ApplyHostDomainListPolicy(); |
298 void ApplyUsernamePolicy(); | 299 void ApplyUsernamePolicy(); |
299 bool OnClientDomainPolicyUpdate(base::DictionaryValue* policies); | 300 bool OnClientDomainListPolicyUpdate(base::DictionaryValue* policies); |
300 bool OnHostDomainPolicyUpdate(base::DictionaryValue* policies); | 301 bool OnHostDomainListPolicyUpdate(base::DictionaryValue* policies); |
301 bool OnUsernamePolicyUpdate(base::DictionaryValue* policies); | 302 bool OnUsernamePolicyUpdate(base::DictionaryValue* policies); |
302 bool OnNatPolicyUpdate(base::DictionaryValue* policies); | 303 bool OnNatPolicyUpdate(base::DictionaryValue* policies); |
303 bool OnRelayPolicyUpdate(base::DictionaryValue* policies); | 304 bool OnRelayPolicyUpdate(base::DictionaryValue* policies); |
304 bool OnUdpPortPolicyUpdate(base::DictionaryValue* policies); | 305 bool OnUdpPortPolicyUpdate(base::DictionaryValue* policies); |
305 bool OnCurtainPolicyUpdate(base::DictionaryValue* policies); | 306 bool OnCurtainPolicyUpdate(base::DictionaryValue* policies); |
306 bool OnHostTalkGadgetPrefixPolicyUpdate(base::DictionaryValue* policies); | 307 bool OnHostTalkGadgetPrefixPolicyUpdate(base::DictionaryValue* policies); |
307 bool OnHostTokenUrlPolicyUpdate(base::DictionaryValue* policies); | 308 bool OnHostTokenUrlPolicyUpdate(base::DictionaryValue* policies); |
308 bool OnPairingPolicyUpdate(base::DictionaryValue* policies); | 309 bool OnPairingPolicyUpdate(base::DictionaryValue* policies); |
309 bool OnGnubbyAuthPolicyUpdate(base::DictionaryValue* policies); | 310 bool OnGnubbyAuthPolicyUpdate(base::DictionaryValue* policies); |
310 | 311 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 scoped_refptr<RsaKeyPair> key_pair_; | 369 scoped_refptr<RsaKeyPair> key_pair_; |
369 std::string oauth_refresh_token_; | 370 std::string oauth_refresh_token_; |
370 std::string serialized_config_; | 371 std::string serialized_config_; |
371 std::string host_owner_; | 372 std::string host_owner_; |
372 std::string host_owner_email_; | 373 std::string host_owner_email_; |
373 bool use_service_account_ = false; | 374 bool use_service_account_ = false; |
374 bool enable_vp9_ = false; | 375 bool enable_vp9_ = false; |
375 | 376 |
376 std::unique_ptr<PolicyWatcher> policy_watcher_; | 377 std::unique_ptr<PolicyWatcher> policy_watcher_; |
377 PolicyState policy_state_ = POLICY_INITIALIZING; | 378 PolicyState policy_state_ = POLICY_INITIALIZING; |
378 std::string client_domain_; | 379 std::vector<std::string> client_domain_list_; |
379 std::string host_domain_; | 380 std::vector<std::string> host_domain_list_; |
380 bool host_username_match_required_ = false; | 381 bool host_username_match_required_ = false; |
381 bool allow_nat_traversal_ = true; | 382 bool allow_nat_traversal_ = true; |
382 bool allow_relay_ = true; | 383 bool allow_relay_ = true; |
383 PortRange udp_port_range_; | 384 PortRange udp_port_range_; |
384 std::string talkgadget_prefix_; | 385 std::string talkgadget_prefix_; |
385 bool allow_pairing_ = true; | 386 bool allow_pairing_ = true; |
386 | 387 |
387 DesktopEnvironmentOptions desktop_environment_options_; | 388 DesktopEnvironmentOptions desktop_environment_options_; |
388 ThirdPartyAuthConfig third_party_auth_config_; | 389 ThirdPartyAuthConfig third_party_auth_config_; |
389 bool security_key_auth_policy_enabled_ = false; | 390 bool security_key_auth_policy_enabled_ = false; |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 LOG(ERROR) << "Failed to apply the configuration."; | 585 LOG(ERROR) << "Failed to apply the configuration."; |
585 ShutdownHost(kInvalidHostConfigurationExitCode); | 586 ShutdownHost(kInvalidHostConfigurationExitCode); |
586 return; | 587 return; |
587 } | 588 } |
588 | 589 |
589 if (state_ == HOST_STARTING) { | 590 if (state_ == HOST_STARTING) { |
590 StartHostIfReady(); | 591 StartHostIfReady(); |
591 } else if (state_ == HOST_STARTED) { | 592 } else if (state_ == HOST_STARTED) { |
592 // Reapply policies that could be affected by a new config. | 593 // Reapply policies that could be affected by a new config. |
593 DCHECK_EQ(policy_state_, POLICY_LOADED); | 594 DCHECK_EQ(policy_state_, POLICY_LOADED); |
594 ApplyHostDomainPolicy(); | 595 ApplyHostDomainListPolicy(); |
595 ApplyUsernamePolicy(); | 596 ApplyUsernamePolicy(); |
596 | 597 |
597 // TODO(sergeyu): Here we assume that PIN is the only part of the config | 598 // TODO(sergeyu): Here we assume that PIN is the only part of the config |
598 // that may change while the service is running. Change ApplyConfig() to | 599 // that may change while the service is running. Change ApplyConfig() to |
599 // detect other changes in the config and restart host if necessary here. | 600 // detect other changes in the config and restart host if necessary here. |
600 CreateAuthenticatorFactory(); | 601 CreateAuthenticatorFactory(); |
601 } | 602 } |
602 } | 603 } |
603 | 604 |
604 void HostProcess::OnConfigWatcherError() { | 605 void HostProcess::OnConfigWatcherError() { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 pairing_registry_ = new PairingRegistry(context_->file_task_runner(), | 718 pairing_registry_ = new PairingRegistry(context_->file_task_runner(), |
718 std::move(delegate)); | 719 std::move(delegate)); |
719 } | 720 } |
720 #endif // defined(OS_WIN) | 721 #endif // defined(OS_WIN) |
721 | 722 |
722 pairing_registry = pairing_registry_; | 723 pairing_registry = pairing_registry_; |
723 } | 724 } |
724 | 725 |
725 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithPin( | 726 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithPin( |
726 use_service_account_, host_owner_, local_certificate, key_pair_, | 727 use_service_account_, host_owner_, local_certificate, key_pair_, |
727 client_domain_, pin_hash_, pairing_registry); | 728 client_domain_list_, pin_hash_, pairing_registry); |
728 | 729 |
729 host_->set_pairing_registry(pairing_registry); | 730 host_->set_pairing_registry(pairing_registry); |
730 } else { | 731 } else { |
731 // ThirdPartyAuthConfig::Parse() leaves the config in a valid state, so | 732 // ThirdPartyAuthConfig::Parse() leaves the config in a valid state, so |
732 // these URLs are both valid. | 733 // these URLs are both valid. |
733 DCHECK(third_party_auth_config_.token_url.is_valid()); | 734 DCHECK(third_party_auth_config_.token_url.is_valid()); |
734 DCHECK(third_party_auth_config_.token_validation_url.is_valid()); | 735 DCHECK(third_party_auth_config_.token_validation_url.is_valid()); |
735 | 736 |
736 #if defined(OS_LINUX) | 737 #if defined(OS_LINUX) |
737 if (!cert_watcher_) { | 738 if (!cert_watcher_) { |
738 cert_watcher_.reset(new CertificateWatcher( | 739 cert_watcher_.reset(new CertificateWatcher( |
739 base::Bind(&HostProcess::ShutdownHost, this, kSuccessExitCode), | 740 base::Bind(&HostProcess::ShutdownHost, this, kSuccessExitCode), |
740 context_->file_task_runner())); | 741 context_->file_task_runner())); |
741 cert_watcher_->Start(); | 742 cert_watcher_->Start(); |
742 } | 743 } |
743 cert_watcher_->SetMonitor(host_->AsWeakPtr()); | 744 cert_watcher_->SetMonitor(host_->AsWeakPtr()); |
744 #endif | 745 #endif |
745 | 746 |
746 scoped_refptr<protocol::TokenValidatorFactory> token_validator_factory = | 747 scoped_refptr<protocol::TokenValidatorFactory> token_validator_factory = |
747 new TokenValidatorFactoryImpl(third_party_auth_config_, key_pair_, | 748 new TokenValidatorFactoryImpl(third_party_auth_config_, key_pair_, |
748 context_->url_request_context_getter()); | 749 context_->url_request_context_getter()); |
749 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithThirdPartyAuth( | 750 factory = protocol::Me2MeHostAuthenticatorFactory::CreateWithThirdPartyAuth( |
750 use_service_account_, host_owner_, local_certificate, key_pair_, | 751 use_service_account_, host_owner_, local_certificate, key_pair_, |
751 client_domain_, token_validator_factory); | 752 client_domain_list_, token_validator_factory); |
752 } | 753 } |
753 | 754 |
754 #if defined(OS_POSIX) | 755 #if defined(OS_POSIX) |
755 // On Linux and Mac, perform a PAM authorization step after authentication. | 756 // On Linux and Mac, perform a PAM authorization step after authentication. |
756 factory.reset(new PamAuthorizationFactory(std::move(factory))); | 757 factory.reset(new PamAuthorizationFactory(std::move(factory))); |
757 #endif | 758 #endif |
758 host_->SetAuthenticatorFactory(std::move(factory)); | 759 host_->SetAuthenticatorFactory(std::move(factory)); |
759 } | 760 } |
760 | 761 |
761 // IPC::Listener implementation. | 762 // IPC::Listener implementation. |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 void HostProcess::OnPolicyUpdate( | 1013 void HostProcess::OnPolicyUpdate( |
1013 std::unique_ptr<base::DictionaryValue> policies) { | 1014 std::unique_ptr<base::DictionaryValue> policies) { |
1014 if (!context_->network_task_runner()->BelongsToCurrentThread()) { | 1015 if (!context_->network_task_runner()->BelongsToCurrentThread()) { |
1015 context_->network_task_runner()->PostTask( | 1016 context_->network_task_runner()->PostTask( |
1016 FROM_HERE, base::Bind(&HostProcess::OnPolicyUpdate, this, | 1017 FROM_HERE, base::Bind(&HostProcess::OnPolicyUpdate, this, |
1017 base::Passed(&policies))); | 1018 base::Passed(&policies))); |
1018 return; | 1019 return; |
1019 } | 1020 } |
1020 | 1021 |
1021 bool restart_required = false; | 1022 bool restart_required = false; |
1022 restart_required |= OnClientDomainPolicyUpdate(policies.get()); | 1023 restart_required |= OnClientDomainListPolicyUpdate(policies.get()); |
1023 restart_required |= OnHostDomainPolicyUpdate(policies.get()); | 1024 restart_required |= OnHostDomainListPolicyUpdate(policies.get()); |
1024 restart_required |= OnCurtainPolicyUpdate(policies.get()); | 1025 restart_required |= OnCurtainPolicyUpdate(policies.get()); |
1025 // Note: UsernamePolicyUpdate must run after OnCurtainPolicyUpdate. | 1026 // Note: UsernamePolicyUpdate must run after OnCurtainPolicyUpdate. |
1026 restart_required |= OnUsernamePolicyUpdate(policies.get()); | 1027 restart_required |= OnUsernamePolicyUpdate(policies.get()); |
1027 restart_required |= OnNatPolicyUpdate(policies.get()); | 1028 restart_required |= OnNatPolicyUpdate(policies.get()); |
1028 restart_required |= OnRelayPolicyUpdate(policies.get()); | 1029 restart_required |= OnRelayPolicyUpdate(policies.get()); |
1029 restart_required |= OnUdpPortPolicyUpdate(policies.get()); | 1030 restart_required |= OnUdpPortPolicyUpdate(policies.get()); |
1030 restart_required |= OnHostTalkGadgetPrefixPolicyUpdate(policies.get()); | 1031 restart_required |= OnHostTalkGadgetPrefixPolicyUpdate(policies.get()); |
1031 restart_required |= OnHostTokenUrlPolicyUpdate(policies.get()); | 1032 restart_required |= OnHostTokenUrlPolicyUpdate(policies.get()); |
1032 restart_required |= OnPairingPolicyUpdate(policies.get()); | 1033 restart_required |= OnPairingPolicyUpdate(policies.get()); |
1033 restart_required |= OnGnubbyAuthPolicyUpdate(policies.get()); | 1034 restart_required |= OnGnubbyAuthPolicyUpdate(policies.get()); |
(...skipping 28 matching lines...) Expand all Loading... |
1062 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); | 1063 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); |
1063 DCHECK(!serialized_config_.empty()); | 1064 DCHECK(!serialized_config_.empty()); |
1064 | 1065 |
1065 DCHECK_EQ(policy_state_, POLICY_ERROR_REPORT_PENDING); | 1066 DCHECK_EQ(policy_state_, POLICY_ERROR_REPORT_PENDING); |
1066 policy_state_ = POLICY_ERROR_REPORTED; | 1067 policy_state_ = POLICY_ERROR_REPORTED; |
1067 | 1068 |
1068 HOST_LOG << "Restarting the host due to policy errors."; | 1069 HOST_LOG << "Restarting the host due to policy errors."; |
1069 RestartHost(kHostOfflineReasonPolicyReadError); | 1070 RestartHost(kHostOfflineReasonPolicyReadError); |
1070 } | 1071 } |
1071 | 1072 |
1072 void HostProcess::ApplyHostDomainPolicy() { | 1073 void HostProcess::ApplyHostDomainListPolicy() { |
1073 if (state_ != HOST_STARTED) | 1074 if (state_ != HOST_STARTED) |
1074 return; | 1075 return; |
1075 | 1076 |
1076 HOST_LOG << "Policy sets host domain: " << host_domain_; | 1077 HOST_LOG << "Policy sets host domains: " |
| 1078 << base::JoinString(host_domain_list_, ", "); |
1077 | 1079 |
1078 if (!host_domain_.empty()) { | 1080 if (!host_domain_list_.empty()) { |
1079 // If the user does not have a Google email, their client JID will not be | 1081 // If the user does not have a Google email, their client JID will not be |
1080 // based on their email. In that case, the username/host domain policies | 1082 // based on their email. In that case, the username/host domain policies |
1081 // would be meaningless, since there is no way to check that the JID | 1083 // would be meaningless, since there is no way to check that the JID |
1082 // trying to connect actually corresponds to the owner email in question. | 1084 // trying to connect actually corresponds to the owner email in question. |
1083 if (host_owner_ != host_owner_email_) { | 1085 if (host_owner_ != host_owner_email_) { |
1084 LOG(ERROR) << "The username and host domain policies cannot be enabled " | 1086 LOG(ERROR) << "The username and host domain policies cannot be enabled " |
1085 << "for accounts with a non-Google email."; | 1087 << "for accounts with a non-Google email."; |
1086 ShutdownHost(kInvalidHostDomainExitCode); | 1088 ShutdownHost(kInvalidHostDomainExitCode); |
1087 } | 1089 } |
1088 | 1090 |
1089 if (!base::EndsWith(host_owner_, std::string("@") + host_domain_, | 1091 bool matched = false; |
1090 base::CompareCase::INSENSITIVE_ASCII)) { | 1092 for (const std::string& domain : host_domain_list_) { |
| 1093 if (base::EndsWith(host_owner_, std::string("@") + domain, |
| 1094 base::CompareCase::INSENSITIVE_ASCII)) { |
| 1095 matched = true; |
| 1096 } |
| 1097 } |
| 1098 if (!matched) { |
1091 LOG(ERROR) << "The host domain does not match the policy."; | 1099 LOG(ERROR) << "The host domain does not match the policy."; |
1092 ShutdownHost(kInvalidHostDomainExitCode); | 1100 ShutdownHost(kInvalidHostDomainExitCode); |
1093 } | 1101 } |
1094 } | 1102 } |
1095 } | 1103 } |
1096 | 1104 |
1097 bool HostProcess::OnHostDomainPolicyUpdate(base::DictionaryValue* policies) { | 1105 bool HostProcess::OnHostDomainListPolicyUpdate( |
| 1106 base::DictionaryValue* policies) { |
1098 // Returns true if the host has to be restarted after this policy update. | 1107 // Returns true if the host has to be restarted after this policy update. |
1099 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); | 1108 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); |
1100 | 1109 |
1101 if (!policies->GetString(policy::key::kRemoteAccessHostDomain, | 1110 const base::ListValue* list; |
1102 &host_domain_)) { | 1111 if (!policies->GetList(policy::key::kRemoteAccessHostDomainList, &list)) { |
1103 return false; | 1112 return false; |
1104 } | 1113 } |
1105 | 1114 |
1106 ApplyHostDomainPolicy(); | 1115 host_domain_list_.clear(); |
| 1116 for (const auto& value : *list) { |
| 1117 host_domain_list_.push_back(value.GetString()); |
| 1118 } |
| 1119 |
| 1120 ApplyHostDomainListPolicy(); |
1107 return false; | 1121 return false; |
1108 } | 1122 } |
1109 | 1123 |
1110 bool HostProcess::OnClientDomainPolicyUpdate(base::DictionaryValue* policies) { | 1124 bool HostProcess::OnClientDomainListPolicyUpdate( |
| 1125 base::DictionaryValue* policies) { |
1111 // Returns true if the host has to be restarted after this policy update. | 1126 // Returns true if the host has to be restarted after this policy update. |
1112 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); | 1127 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); |
1113 return policies->GetString(policy::key::kRemoteAccessHostClientDomain, | 1128 const base::ListValue* list; |
1114 &client_domain_); | 1129 if (!policies->GetList(policy::key::kRemoteAccessHostClientDomainList, |
| 1130 &list)) { |
| 1131 return false; |
| 1132 } |
| 1133 |
| 1134 client_domain_list_.clear(); |
| 1135 for (const auto& value : *list) { |
| 1136 client_domain_list_.push_back(value.GetString()); |
| 1137 } |
| 1138 |
| 1139 return true; |
1115 } | 1140 } |
1116 | 1141 |
1117 void HostProcess::ApplyUsernamePolicy() { | 1142 void HostProcess::ApplyUsernamePolicy() { |
1118 if (state_ != HOST_STARTED) | 1143 if (state_ != HOST_STARTED) |
1119 return; | 1144 return; |
1120 | 1145 |
1121 if (host_username_match_required_) { | 1146 if (host_username_match_required_) { |
1122 HOST_LOG << "Policy requires host username match."; | 1147 HOST_LOG << "Policy requires host username match."; |
1123 | 1148 |
1124 // See comment in ApplyHostDomainPolicy. | 1149 // See comment in ApplyHostDomainListPolicy. |
1125 if (host_owner_ != host_owner_email_) { | 1150 if (host_owner_ != host_owner_email_) { |
1126 LOG(ERROR) << "The username and host domain policies cannot be enabled " | 1151 LOG(ERROR) << "The username and host domain policies cannot be enabled " |
1127 << "for accounts with a non-Google email."; | 1152 << "for accounts with a non-Google email."; |
1128 ShutdownHost(kUsernameMismatchExitCode); | 1153 ShutdownHost(kUsernameMismatchExitCode); |
1129 } | 1154 } |
1130 | 1155 |
1131 std::string username = GetUsername(); | 1156 std::string username = GetUsername(); |
1132 bool shutdown = | 1157 bool shutdown = |
1133 username.empty() || | 1158 username.empty() || |
1134 !base::StartsWith(host_owner_, username + std::string("@"), | 1159 !base::StartsWith(host_owner_, username + std::string("@"), |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1489 new IpcHostEventLogger(host_->AsWeakPtr(), daemon_channel_.get())); | 1514 new IpcHostEventLogger(host_->AsWeakPtr(), daemon_channel_.get())); |
1490 #else // !defined(REMOTING_MULTI_PROCESS) | 1515 #else // !defined(REMOTING_MULTI_PROCESS) |
1491 host_event_logger_ = | 1516 host_event_logger_ = |
1492 HostEventLogger::Create(host_->AsWeakPtr(), kApplicationName); | 1517 HostEventLogger::Create(host_->AsWeakPtr(), kApplicationName); |
1493 #endif // !defined(REMOTING_MULTI_PROCESS) | 1518 #endif // !defined(REMOTING_MULTI_PROCESS) |
1494 | 1519 |
1495 host_->Start(host_owner_email_); | 1520 host_->Start(host_owner_email_); |
1496 | 1521 |
1497 CreateAuthenticatorFactory(); | 1522 CreateAuthenticatorFactory(); |
1498 | 1523 |
1499 ApplyHostDomainPolicy(); | 1524 ApplyHostDomainListPolicy(); |
1500 ApplyUsernamePolicy(); | 1525 ApplyUsernamePolicy(); |
1501 } | 1526 } |
1502 | 1527 |
1503 void HostProcess::OnAuthFailed() { | 1528 void HostProcess::OnAuthFailed() { |
1504 ShutdownHost(kInvalidOauthCredentialsExitCode); | 1529 ShutdownHost(kInvalidOauthCredentialsExitCode); |
1505 } | 1530 } |
1506 | 1531 |
1507 void HostProcess::RestartHost(const std::string& host_offline_reason) { | 1532 void HostProcess::RestartHost(const std::string& host_offline_reason) { |
1508 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); | 1533 DCHECK(context_->network_task_runner()->BelongsToCurrentThread()); |
1509 DCHECK(!host_offline_reason.empty()); | 1534 DCHECK(!host_offline_reason.empty()); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1667 // Run the main (also UI) message loop until the host no longer needs it. | 1692 // Run the main (also UI) message loop until the host no longer needs it. |
1668 base::RunLoop().Run(); | 1693 base::RunLoop().Run(); |
1669 | 1694 |
1670 // Block until tasks blocking shutdown have completed their execution. | 1695 // Block until tasks blocking shutdown have completed their execution. |
1671 base::TaskScheduler::GetInstance()->Shutdown(); | 1696 base::TaskScheduler::GetInstance()->Shutdown(); |
1672 | 1697 |
1673 return exit_code; | 1698 return exit_code; |
1674 } | 1699 } |
1675 | 1700 |
1676 } // namespace remoting | 1701 } // namespace remoting |
OLD | NEW |