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

Unified Diff: chrome/browser/chromeos/login/auth/extended_authenticator.cc

Issue 290483003: Tame the proliferation of UserContext constructors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 7 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/auth/extended_authenticator.cc
diff --git a/chrome/browser/chromeos/login/auth/extended_authenticator.cc b/chrome/browser/chromeos/login/auth/extended_authenticator.cc
index bb97cffc48c7e508cad05cdf5b1b0292598e9ad7..157c2dfd1ecc8291a9fc53e388e4f535c834fb42 100644
--- a/chrome/browser/chromeos/login/auth/extended_authenticator.cc
+++ b/chrome/browser/chromeos/login/auth/extended_authenticator.cc
@@ -108,7 +108,8 @@ void ExtendedAuthenticator::CreateMount(
for (size_t i = 0; i < keys.size(); i++) {
mount.create_keys.push_back(keys[i]);
}
- UserContext context(user_id, keys.front().key, std::string());
+ UserContext context(user_id);
+ context.SetPassword(keys.front().key);
context.SetKeyLabel(keys.front().label);
cryptohome::HomedirMethods::GetInstance()->MountEx(
@@ -289,8 +290,7 @@ void ExtendedAuthenticator::OnMountComplete(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
RecordEndMarker(time_marker);
- UserContext copy;
- copy.CopyFrom(user_context);
+ UserContext copy = user_context;
copy.SetUserIDHash(mount_hash);
if (return_code == cryptohome::MOUNT_ERROR_NONE) {
if (!success_callback.is_null())
@@ -381,8 +381,7 @@ void ExtendedAuthenticator::DidTransformContext(
const ContextCallback& callback,
const std::string& hashed_password) {
DCHECK(user_context.DoesNeedPasswordHashing());
- UserContext context;
- context.CopyFrom(user_context);
+ UserContext context = user_context;
context.SetPassword(hashed_password);
context.SetDoesNeedPasswordHashing(false);
callback.Run(context);
« no previous file with comments | « chrome/browser/chromeos/login/auth/auth_attempt_state.cc ('k') | chrome/browser/chromeos/login/auth/login_performer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698