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

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

Issue 1412813003: This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Rebased. Created 5 years, 2 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: chromeos/login/auth/cryptohome_authenticator.cc
diff --git a/chromeos/login/auth/cryptohome_authenticator.cc b/chromeos/login/auth/cryptohome_authenticator.cc
index 4321adfc241e0f0c7eca20a76c00d7dfdbae47cc..d8fef6974f77fbc0be8ca271b88919214d63ba2e 100644
--- a/chromeos/login/auth/cryptohome_authenticator.cc
+++ b/chromeos/login/auth/cryptohome_authenticator.cc
@@ -25,6 +25,7 @@
#include "chromeos/login/user_names.h"
#include "chromeos/login_event_recorder.h"
#include "components/device_event_log/device_event_log.h"
+#include "components/signin/core/account_id/account_id.h"
#include "components/user_manager/user_type.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
@@ -147,9 +148,9 @@ void DoMount(const base::WeakPtr<AuthAttemptState>& attempt,
}
cryptohome::HomedirMethods::GetInstance()->MountEx(
- cryptohome::Identification(attempt->user_context.GetUserID()),
- cryptohome::Authorization(auth_key),
- mount,
+ cryptohome::Identification(
+ attempt->user_context.GetUserID().GetUserEmail()),
+ cryptohome::Authorization(auth_key), mount,
base::Bind(&OnMount, attempt, resolver));
}
@@ -265,13 +266,10 @@ void StartMount(const base::WeakPtr<AuthAttemptState>& attempt,
}
cryptohome::HomedirMethods::GetInstance()->GetKeyDataEx(
- cryptohome::Identification(attempt->user_context.GetUserID()),
- kCryptohomeGAIAKeyLabel,
- base::Bind(&OnGetKeyDataEx,
- attempt,
- resolver,
- ephemeral,
- create_if_nonexistent));
+ cryptohome::Identification(
+ attempt->user_context.GetUserID().GetUserEmail()),
+ kCryptohomeGAIAKeyLabel, base::Bind(&OnGetKeyDataEx, attempt, resolver,
+ ephemeral, create_if_nonexistent));
}
// Calls cryptohome's mount method for guest and also get the user hash from
@@ -285,7 +283,7 @@ void MountGuestAndGetHash(const base::WeakPtr<AuthAttemptState>& attempt,
attempt,
resolver));
cryptohome::AsyncMethodCaller::GetInstance()->AsyncGetSanitizedUsername(
- attempt->user_context.GetUserID(),
+ attempt->user_context.GetUserID().GetUserEmail(),
base::Bind(&TriggerResolveHash, attempt, resolver));
}
@@ -294,14 +292,11 @@ void MountPublic(const base::WeakPtr<AuthAttemptState>& attempt,
scoped_refptr<CryptohomeAuthenticator> resolver,
int flags) {
cryptohome::AsyncMethodCaller::GetInstance()->AsyncMountPublic(
- attempt->user_context.GetUserID(),
- flags,
+ attempt->user_context.GetUserID().GetUserEmail(), flags,
base::Bind(&TriggerResolveWithLoginTimeMarker,
- "CryptohomeMountPublic-End",
- attempt,
- resolver));
+ "CryptohomeMountPublic-End", attempt, resolver));
cryptohome::AsyncMethodCaller::GetInstance()->AsyncGetSanitizedUsername(
- attempt->user_context.GetUserID(),
+ attempt->user_context.GetUserID().GetUserEmail(),
base::Bind(&TriggerResolveHash, attempt, resolver));
}
@@ -323,21 +318,17 @@ void Migrate(const base::WeakPtr<AuthAttemptState>& attempt,
scoped_ptr<Key> new_key =
TransformKeyIfNeeded(*attempt->user_context.GetKey(), system_salt);
if (passing_old_hash) {
- caller->AsyncMigrateKey(attempt->user_context.GetUserID(),
- old_key->GetSecret(),
- new_key->GetSecret(),
- base::Bind(&TriggerResolveWithLoginTimeMarker,
- "CryptohomeMount-End",
- attempt,
- resolver));
+ caller->AsyncMigrateKey(
+ attempt->user_context.GetUserID().GetUserEmail(), old_key->GetSecret(),
+ new_key->GetSecret(),
+ base::Bind(&TriggerResolveWithLoginTimeMarker, "CryptohomeMount-End",
+ attempt, resolver));
} else {
- caller->AsyncMigrateKey(attempt->user_context.GetUserID(),
- new_key->GetSecret(),
- old_key->GetSecret(),
- base::Bind(&TriggerResolveWithLoginTimeMarker,
- "CryptohomeMount-End",
- attempt,
- resolver));
+ caller->AsyncMigrateKey(
+ attempt->user_context.GetUserID().GetUserEmail(), new_key->GetSecret(),
+ old_key->GetSecret(),
+ base::Bind(&TriggerResolveWithLoginTimeMarker, "CryptohomeMount-End",
+ attempt, resolver));
}
}
@@ -347,11 +338,9 @@ void Remove(const base::WeakPtr<AuthAttemptState>& attempt,
chromeos::LoginEventRecorder::Get()->AddLoginTimeMarker(
"CryptohomeRemove-Start", false);
cryptohome::AsyncMethodCaller::GetInstance()->AsyncRemove(
- attempt->user_context.GetUserID(),
- base::Bind(&TriggerResolveWithLoginTimeMarker,
- "CryptohomeRemove-End",
- attempt,
- resolver));
+ attempt->user_context.GetUserID().GetUserEmail(),
+ base::Bind(&TriggerResolveWithLoginTimeMarker, "CryptohomeRemove-End",
+ attempt, resolver));
}
// Calls cryptohome's key check method.
@@ -361,8 +350,7 @@ void CheckKey(const base::WeakPtr<AuthAttemptState>& attempt,
scoped_ptr<Key> key =
TransformKeyIfNeeded(*attempt->user_context.GetKey(), system_salt);
cryptohome::AsyncMethodCaller::GetInstance()->AsyncCheckKey(
- attempt->user_context.GetUserID(),
- key->GetSecret(),
+ attempt->user_context.GetUserID().GetUserEmail(), key->GetSecret(),
base::Bind(&TriggerResolve, attempt, resolver));
}

Powered by Google App Engine
This is Rietveld 408576698