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

Unified Diff: chromeos/login/auth/cryptohome_authenticator.cc

Issue 2797163002: cryptohome: Make CryptohomeClient::Unmount non-blocking (Closed)
Patch Set: 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
« no previous file with comments | « chromeos/login/auth/cryptohome_authenticator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/login/auth/cryptohome_authenticator.cc
diff --git a/chromeos/login/auth/cryptohome_authenticator.cc b/chromeos/login/auth/cryptohome_authenticator.cc
index 2795b308543933b04e66c6624e493cc2b1cb13b0..8debe09c1cd7b4435e19de1886c2caa694a5f79c 100644
--- a/chromeos/login/auth/cryptohome_authenticator.cc
+++ b/chromeos/login/auth/cryptohome_authenticator.cc
@@ -729,6 +729,15 @@ void CryptohomeAuthenticator::OnOwnershipChecked(bool is_owner) {
Resolve();
}
+void CryptohomeAuthenticator::OnUnmount(DBusMethodCallStatus call_status,
+ bool success) {
+ if (call_status != DBUS_METHOD_CALL_SUCCESS || !success) {
+ // Maybe we should reboot immediately here?
+ LOGIN_LOG(ERROR) << "Couldn't unmount users home!";
+ }
+ OnAuthFailure(AuthFailure(AuthFailure::OWNER_REQUIRED));
+}
+
void CryptohomeAuthenticator::Resolve() {
DCHECK(task_runner_->RunsTasksOnCurrentThread());
bool create_if_nonexistent = false;
@@ -849,17 +858,8 @@ void CryptohomeAuthenticator::Resolve() {
break;
case OWNER_REQUIRED: {
current_state_->ResetCryptohomeStatus();
- bool success = false;
- DBusThreadManager::Get()->GetCryptohomeClient()->Unmount(&success);
- if (!success) {
- // Maybe we should reboot immediately here?
- LOGIN_LOG(ERROR) << "Couldn't unmount users home!";
- }
- task_runner_->PostTask(
- FROM_HERE,
- base::Bind(&CryptohomeAuthenticator::OnAuthFailure,
- this,
- AuthFailure(AuthFailure::OWNER_REQUIRED)));
+ DBusThreadManager::Get()->GetCryptohomeClient()->Unmount(
+ base::Bind(&CryptohomeAuthenticator::OnUnmount, this));
break;
}
case FAILED_OLD_ENCRYPTION:
« no previous file with comments | « chromeos/login/auth/cryptohome_authenticator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698