Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: chrome/browser/chromeos/login/existing_user_controller.cc

Issue 2817933003: Wait for Cryptohome service to be available on login. (Closed)
Patch Set: better error handling + fix ExistingUserControllerActiveDirectoryTest Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..8152eb6abc77a96c22c0af84f7f5540376764145 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(
+ const base::Closure& continuation,
+ bool service_is_available) {
+ if (!service_is_available) {
+ LOG(ERROR) << "Cryptohome service is not available";
+ OnAuthFailure(AuthFailure(AuthFailure::COULD_NOT_MOUNT_CRYPTOHOME));
+ return;
+ }
+ 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(), continuation));
}
void ExistingUserController::DoCompleteLogin(

Powered by Google App Engine
This is Rietveld 408576698