Commit 55b87b91 authored by David Benjamin's avatar David Benjamin Committed by Commit Bot

Remove dead code.

user_manager is never actually used, except to check if it's there.
UserManager::Get(), in turn, fails a CHECK if there is no UserManager.

Bug: none
Change-Id: I6e3adfc1b5143447f90e2f3cd04ff1e6af5d64b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1846078
Auto-Submit: David Benjamin <davidben@chromium.org>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703754}
parent 3e138a8e
...@@ -267,28 +267,24 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) { ...@@ -267,28 +267,24 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
params->system_key_slot_use_type = SystemKeySlotUseType::kUseForClientAuth; params->system_key_slot_use_type = SystemKeySlotUseType::kUseForClientAuth;
} }
user_manager::UserManager* user_manager = user_manager::UserManager::Get(); const user_manager::User* user =
if (user_manager) { chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
const user_manager::User* user = // No need to initialize NSS for users with empty username hash:
chromeos::ProfileHelper::Get()->GetUserByProfile(profile); // Getters for a user's NSS slots always return a null slot if the user's
// No need to initialize NSS for users with empty username hash: // username hash is empty, even when the NSS is not initialized for the
// Getters for a user's NSS slots always return NULL slot if the user's // user.
// username hash is empty, even when the NSS is not initialized for the if (user && !user->username_hash().empty()) {
// user. params->username_hash = user->username_hash();
if (user && !user->username_hash().empty()) { DCHECK(!params->username_hash.empty());
params->username_hash = user->username_hash(); base::PostTask(FROM_HERE, {BrowserThread::IO},
DCHECK(!params->username_hash.empty()); base::BindOnce(&StartNSSInitOnIOThread, user->GetAccountId(),
base::PostTask( user->username_hash(), profile->GetPath()));
FROM_HERE, {BrowserThread::IO},
base::BindOnce(&StartNSSInitOnIOThread, user->GetAccountId(), // Use the device-wide system key slot only if the user is affiliated on
user->username_hash(), profile->GetPath())); // the device.
if (user->IsAffiliated()) {
// Use the device-wide system key slot only if the user is affiliated on params->system_key_slot_use_type =
// the device. SystemKeySlotUseType::kUseForClientAuthAndCertManagement;
if (user->IsAffiliated()) {
params->system_key_slot_use_type =
SystemKeySlotUseType::kUseForClientAuthAndCertManagement;
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment