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

Unified Diff: chrome/browser/profiles/profile_io_data.cc

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/profiles/profile_io_data.cc
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index 6c5b7085f55d0bb846a886f65090203328c5b30b..5be036485b81127644cb3cf4c2fd1f8513f2b71a 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -276,14 +276,14 @@ void DidGetTPMInfoForUserOnUIThread(
}
}
-void GetTPMInfoForUserOnUIThread(const std::string& username,
+void GetTPMInfoForUserOnUIThread(const user_manager::UserID& user_id,
const std::string& username_hash) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(1) << "Getting TPM info from cryptohome for "
- << " " << username << " " << username_hash;
+ << " " << user_id.GetUserEmail() << " " << username_hash;
scoped_ptr<chromeos::TPMTokenInfoGetter> scoped_token_info_getter =
chromeos::TPMTokenInfoGetter::CreateForUserToken(
- username,
+ user_id,
chromeos::DBusThreadManager::Get()->GetCryptohomeClient(),
base::ThreadTaskRunnerHandle::Get());
chromeos::TPMTokenInfoGetter* token_info_getter =
@@ -299,21 +299,21 @@ void GetTPMInfoForUserOnUIThread(const std::string& username,
username_hash));
}
-void StartTPMSlotInitializationOnIOThread(const std::string& username,
+void StartTPMSlotInitializationOnIOThread(const user_manager::UserID& user_id,
const std::string& username_hash) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
BrowserThread::PostTask(
BrowserThread::UI,
FROM_HERE,
- base::Bind(&GetTPMInfoForUserOnUIThread, username, username_hash));
+ base::Bind(&GetTPMInfoForUserOnUIThread, user_id, username_hash));
}
-void StartNSSInitOnIOThread(const std::string& username,
+void StartNSSInitOnIOThread(const user_manager::UserID& user_id,
const std::string& username_hash,
const base::FilePath& path) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- DVLOG(1) << "Starting NSS init for " << username
+ DVLOG(1) << "Starting NSS init for " << user_id.GetUserEmail()
<< " hash:" << username_hash;
// Make sure NSS is initialized for the user.
@@ -329,8 +329,8 @@ void StartNSSInitOnIOThread(const std::string& username,
if (crypto::IsTPMTokenEnabledForNSS()) {
if (crypto::IsTPMTokenReady(base::Bind(
- &StartTPMSlotInitializationOnIOThread, username, username_hash))) {
- StartTPMSlotInitializationOnIOThread(username, username_hash);
+ &StartTPMSlotInitializationOnIOThread, user_id, username_hash))) {
+ StartTPMSlotInitializationOnIOThread(user_id, username_hash);
} else {
DVLOG(1) << "Waiting for tpm ready ...";
}
@@ -430,7 +430,7 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
BrowserThread::PostTask(BrowserThread::IO,
FROM_HERE,
base::Bind(&StartNSSInitOnIOThread,
- user->email(),
+ user->GetUserID(),
user->username_hash(),
profile->GetPath()));
@@ -440,7 +440,7 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
g_browser_process->platform_part()
->browser_policy_connector_chromeos();
params->use_system_key_slot =
- connector->GetUserAffiliation(user->email()) ==
+ connector->GetUserAffiliation(user->GetUserID()) ==
policy::USER_AFFILIATION_MANAGED;
}
}

Powered by Google App Engine
This is Rietveld 408576698