Chromium Code Reviews| Index: chrome/browser/chromeos/login/existing_user_controller.cc |
| diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc |
| index 4847d9a76509e89444c00580d41bceafd12776c0..4e832151dfe5b6f8499419f1ed08c389cf0891c9 100644 |
| --- a/chrome/browser/chromeos/login/existing_user_controller.cc |
| +++ b/chrome/browser/chromeos/login/existing_user_controller.cc |
| @@ -1238,6 +1238,17 @@ void ExistingUserController::PerformLoginFinishedActions( |
| StartAutoLoginTimer(); |
| } |
| +void ExistingUserController::ContinueLoginWhenCryptohomeAvailable( |
| + base::OnceClosure continuation, |
| + bool service_is_available) { |
| + if (!service_is_available) { |
| + LOG(ERROR) << "Cryptohome service is not available"; |
| + OnAuthFailure(AuthFailure(AuthFailure::COULD_NOT_MOUNT_CRYPTOHOME)); |
| + return; |
| + } |
| + std::move(continuation).Run(); |
| +} |
| + |
| void ExistingUserController::ContinueLoginIfDeviceNotDisabled( |
| const base::Closure& continuation) { |
| // Disable clicking on other windows and status tray. |
| @@ -1283,7 +1294,11 @@ void ExistingUserController::ContinueLoginIfDeviceNotDisabled( |
| return; |
| } |
| - continuation.Run(); |
| + chromeos::DBusThreadManager::Get() |
| + ->GetCryptohomeClient() |
| + ->WaitForServiceToBeAvailable(base::Bind( |
| + &ExistingUserController::ContinueLoginWhenCryptohomeAvailable, |
| + weak_factory_.GetWeakPtr(), std::move(continuation))); |
|
Roman Sorokin (ftl)
2017/04/19 09:00:09
std::move on const & does nothing AFAIK. For this
Sergey Poromov
2017/04/19 11:08:25
Yep, std::move is useless here. About OnceCallback
|
| } |
| void ExistingUserController::DoCompleteLogin( |