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) {
params->system_key_slot_use_type = SystemKeySlotUseType::kUseForClientAuth;
}
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
if (user_manager) {
const user_manager::User* user =
chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
// No need to initialize NSS for users with empty username hash:
// Getters for a user's NSS slots always return NULL slot if the user's
// username hash is empty, even when the NSS is not initialized for the
// user.
if (user && !user->username_hash().empty()) {
params->username_hash = user->username_hash();
DCHECK(!params->username_hash.empty());
base::PostTask(
FROM_HERE, {BrowserThread::IO},
base::BindOnce(&StartNSSInitOnIOThread, user->GetAccountId(),
user->username_hash(), profile->GetPath()));
// Use the device-wide system key slot only if the user is affiliated on
// the device.
if (user->IsAffiliated()) {
params->system_key_slot_use_type =
SystemKeySlotUseType::kUseForClientAuthAndCertManagement;
}
const user_manager::User* user =
chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
// No need to initialize NSS for users with empty username hash:
// Getters for a user's NSS slots always return a null slot if the user's
// username hash is empty, even when the NSS is not initialized for the
// user.
if (user && !user->username_hash().empty()) {
params->username_hash = user->username_hash();
DCHECK(!params->username_hash.empty());
base::PostTask(FROM_HERE, {BrowserThread::IO},
base::BindOnce(&StartNSSInitOnIOThread, user->GetAccountId(),
user->username_hash(), profile->GetPath()));
// Use the device-wide system key slot only if the user is affiliated on
// the device.
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