Commit d290d1cb authored by Reilly Grant's avatar Reilly Grant Committed by Commit Bot

Convert chromeos/tpm to base::Bind and base::Callback to Once/Repeating

Bug: 1007665
Change-Id: I0c22e26a575e4cb346944c6419d26ea4bc165eef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918648
Auto-Submit: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Achuith Bhandarkar <achuith@chromium.org>
Reviewed-by: default avatarAchuith Bhandarkar <achuith@chromium.org>
Cr-Commit-Position: refs/heads/master@{#716427}
parent 5a685fac
...@@ -133,8 +133,8 @@ void InstallAttributes::Init(const base::FilePath& cache_file) { ...@@ -133,8 +133,8 @@ void InstallAttributes::Init(const base::FilePath& cache_file) {
// actually calling TriggerConsistencyCheck(). // actually calling TriggerConsistencyCheck().
consistency_check_running_ = true; consistency_check_running_ = true;
cryptohome_client_->WaitForServiceToBeAvailable( cryptohome_client_->WaitForServiceToBeAvailable(
base::Bind(&InstallAttributes::OnCryptohomeServiceInitiallyAvailable, base::BindOnce(&InstallAttributes::OnCryptohomeServiceInitiallyAvailable,
weak_ptr_factory_.GetWeakPtr())); weak_ptr_factory_.GetWeakPtr()));
if (!base::PathExists(cache_file)) { if (!base::PathExists(cache_file)) {
LOG_IF(WARNING, base::SysInfo::IsRunningOnChromeOS()) LOG_IF(WARNING, base::SysInfo::IsRunningOnChromeOS())
...@@ -171,18 +171,18 @@ void InstallAttributes::Init(const base::FilePath& cache_file) { ...@@ -171,18 +171,18 @@ void InstallAttributes::Init(const base::FilePath& cache_file) {
DecodeInstallAttributes(attr_map); DecodeInstallAttributes(attr_map);
} }
void InstallAttributes::ReadImmutableAttributes(const base::Closure& callback) { void InstallAttributes::ReadImmutableAttributes(base::OnceClosure callback) {
if (device_locked_) { if (device_locked_) {
callback.Run(); std::move(callback).Run();
return; return;
} }
cryptohome_client_->InstallAttributesIsReady( cryptohome_client_->InstallAttributesIsReady(
base::Bind(&InstallAttributes::ReadAttributesIfReady, base::BindOnce(&InstallAttributes::ReadAttributesIfReady,
weak_ptr_factory_.GetWeakPtr(), callback)); weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
} }
void InstallAttributes::ReadAttributesIfReady(const base::Closure& callback, void InstallAttributes::ReadAttributesIfReady(base::OnceClosure callback,
base::Optional<bool> is_ready) { base::Optional<bool> is_ready) {
if (is_ready.value_or(false)) { if (is_ready.value_or(false)) {
registration_mode_ = policy::DEVICE_MODE_NOT_SET; registration_mode_ = policy::DEVICE_MODE_NOT_SET;
...@@ -206,7 +206,7 @@ void InstallAttributes::ReadAttributesIfReady(const base::Closure& callback, ...@@ -206,7 +206,7 @@ void InstallAttributes::ReadAttributesIfReady(const base::Closure& callback,
DecodeInstallAttributes(attr_map); DecodeInstallAttributes(attr_map);
} }
} }
callback.Run(); std::move(callback).Run();
} }
void InstallAttributes::SetBlockDevmodeInTpm( void InstallAttributes::SetBlockDevmodeInTpm(
...@@ -232,7 +232,7 @@ void InstallAttributes::LockDevice(policy::DeviceMode device_mode, ...@@ -232,7 +232,7 @@ void InstallAttributes::LockDevice(policy::DeviceMode device_mode,
const std::string& domain, const std::string& domain,
const std::string& realm, const std::string& realm,
const std::string& device_id, const std::string& device_id,
const LockResultCallback& callback) { LockResultCallback callback) {
CHECK((device_mode == policy::DEVICE_MODE_ENTERPRISE && !domain.empty() && CHECK((device_mode == policy::DEVICE_MODE_ENTERPRISE && !domain.empty() &&
realm.empty() && !device_id.empty()) || realm.empty() && !device_id.empty()) ||
(device_mode == policy::DEVICE_MODE_ENTERPRISE_AD && domain.empty() && (device_mode == policy::DEVICE_MODE_ENTERPRISE_AD && domain.empty() &&
...@@ -241,7 +241,7 @@ void InstallAttributes::LockDevice(policy::DeviceMode device_mode, ...@@ -241,7 +241,7 @@ void InstallAttributes::LockDevice(policy::DeviceMode device_mode,
realm.empty() && !device_id.empty()) || realm.empty() && !device_id.empty()) ||
(device_mode == policy::DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH && (device_mode == policy::DEVICE_MODE_CONSUMER_KIOSK_AUTOLAUNCH &&
domain.empty() && realm.empty() && device_id.empty())); domain.empty() && realm.empty() && device_id.empty()));
DCHECK(!callback.is_null()); DCHECK(callback);
CHECK_EQ(device_lock_running_, false); CHECK_EQ(device_lock_running_, false);
// Check for existing lock first. // Check for existing lock first.
...@@ -250,20 +250,20 @@ void InstallAttributes::LockDevice(policy::DeviceMode device_mode, ...@@ -250,20 +250,20 @@ void InstallAttributes::LockDevice(policy::DeviceMode device_mode,
LOG(ERROR) << "Trying to re-lock with wrong mode: device_mode: " LOG(ERROR) << "Trying to re-lock with wrong mode: device_mode: "
<< device_mode << device_mode
<< ", registration_mode: " << registration_mode_; << ", registration_mode: " << registration_mode_;
callback.Run(LOCK_WRONG_MODE); std::move(callback).Run(LOCK_WRONG_MODE);
return; return;
} }
if (domain != registration_domain_ || realm != registration_realm_ || if (domain != registration_domain_ || realm != registration_realm_ ||
device_id != registration_device_id_) { device_id != registration_device_id_) {
LOG(ERROR) << "Trying to re-lock with non-matching parameters."; LOG(ERROR) << "Trying to re-lock with non-matching parameters.";
callback.Run(LOCK_WRONG_DOMAIN); std::move(callback).Run(LOCK_WRONG_DOMAIN);
return; return;
} }
// Already locked in the right mode, signal success. // Already locked in the right mode, signal success.
ReportExistingLockUma(true /* is_existing_lock */); ReportExistingLockUma(true /* is_existing_lock */);
callback.Run(LOCK_SUCCESS); std::move(callback).Run(LOCK_SUCCESS);
return; return;
} }
...@@ -272,9 +272,9 @@ void InstallAttributes::LockDevice(policy::DeviceMode device_mode, ...@@ -272,9 +272,9 @@ void InstallAttributes::LockDevice(policy::DeviceMode device_mode,
// device locking must wait for TPM initialization anyways. // device locking must wait for TPM initialization anyways.
if (consistency_check_running_) { if (consistency_check_running_) {
CHECK(post_check_action_.is_null()); CHECK(post_check_action_.is_null());
post_check_action_ = base::Bind(&InstallAttributes::LockDevice, post_check_action_ = base::BindOnce(
weak_ptr_factory_.GetWeakPtr(), device_mode, &InstallAttributes::LockDevice, weak_ptr_factory_.GetWeakPtr(),
domain, realm, device_id, callback); device_mode, domain, realm, device_id, std::move(callback));
return; return;
} }
...@@ -282,7 +282,7 @@ void InstallAttributes::LockDevice(policy::DeviceMode device_mode, ...@@ -282,7 +282,7 @@ void InstallAttributes::LockDevice(policy::DeviceMode device_mode,
cryptohome_client_->InstallAttributesIsReady( cryptohome_client_->InstallAttributesIsReady(
base::BindOnce(&InstallAttributes::LockDeviceIfAttributesIsReady, base::BindOnce(&InstallAttributes::LockDeviceIfAttributesIsReady,
weak_ptr_factory_.GetWeakPtr(), device_mode, domain, realm, weak_ptr_factory_.GetWeakPtr(), device_mode, domain, realm,
device_id, callback)); device_id, std::move(callback)));
} }
void InstallAttributes::LockDeviceIfAttributesIsReady( void InstallAttributes::LockDeviceIfAttributesIsReady(
...@@ -290,11 +290,11 @@ void InstallAttributes::LockDeviceIfAttributesIsReady( ...@@ -290,11 +290,11 @@ void InstallAttributes::LockDeviceIfAttributesIsReady(
const std::string& domain, const std::string& domain,
const std::string& realm, const std::string& realm,
const std::string& device_id, const std::string& device_id,
const LockResultCallback& callback, LockResultCallback callback,
base::Optional<bool> is_ready) { base::Optional<bool> is_ready) {
if (!is_ready.has_value() || !is_ready.value()) { if (!is_ready.has_value() || !is_ready.value()) {
device_lock_running_ = false; device_lock_running_ = false;
callback.Run(LOCK_NOT_READY); std::move(callback).Run(LOCK_NOT_READY);
return; return;
} }
...@@ -308,14 +308,14 @@ void InstallAttributes::LockDeviceIfAttributesIsReady( ...@@ -308,14 +308,14 @@ void InstallAttributes::LockDeviceIfAttributesIsReady(
if (tpm_util::InstallAttributesIsInvalid()) { if (tpm_util::InstallAttributesIsInvalid()) {
LOG(ERROR) << "Install attributes invalid."; LOG(ERROR) << "Install attributes invalid.";
device_lock_running_ = false; device_lock_running_ = false;
callback.Run(LOCK_BACKEND_INVALID); std::move(callback).Run(LOCK_BACKEND_INVALID);
return; return;
} }
if (!tpm_util::InstallAttributesIsFirstInstall()) { if (!tpm_util::InstallAttributesIsFirstInstall()) {
LOG(ERROR) << "Install attributes already installed."; LOG(ERROR) << "Install attributes already installed.";
device_lock_running_ = false; device_lock_running_ = false;
callback.Run(LOCK_ALREADY_LOCKED); std::move(callback).Run(LOCK_ALREADY_LOCKED);
return; return;
} }
...@@ -336,7 +336,7 @@ void InstallAttributes::LockDeviceIfAttributesIsReady( ...@@ -336,7 +336,7 @@ void InstallAttributes::LockDeviceIfAttributesIsReady(
!tpm_util::InstallAttributesSet(kAttrEnterpriseDeviceId, device_id)) { !tpm_util::InstallAttributesSet(kAttrEnterpriseDeviceId, device_id)) {
LOG(ERROR) << "Failed writing attributes."; LOG(ERROR) << "Failed writing attributes.";
device_lock_running_ = false; device_lock_running_ = false;
callback.Run(LOCK_SET_ERROR); std::move(callback).Run(LOCK_SET_ERROR);
return; return;
} }
...@@ -344,33 +344,32 @@ void InstallAttributes::LockDeviceIfAttributesIsReady( ...@@ -344,33 +344,32 @@ void InstallAttributes::LockDeviceIfAttributesIsReady(
tpm_util::InstallAttributesIsFirstInstall()) { tpm_util::InstallAttributesIsFirstInstall()) {
LOG(ERROR) << "Failed locking."; LOG(ERROR) << "Failed locking.";
device_lock_running_ = false; device_lock_running_ = false;
callback.Run(LOCK_FINALIZE_ERROR); std::move(callback).Run(LOCK_FINALIZE_ERROR);
return; return;
} }
ReadImmutableAttributes( ReadImmutableAttributes(
base::Bind(&InstallAttributes::OnReadImmutableAttributes, base::BindOnce(&InstallAttributes::OnReadImmutableAttributes,
weak_ptr_factory_.GetWeakPtr(), device_mode, domain, realm, weak_ptr_factory_.GetWeakPtr(), device_mode, domain, realm,
device_id, callback)); device_id, std::move(callback)));
} }
void InstallAttributes::OnReadImmutableAttributes( void InstallAttributes::OnReadImmutableAttributes(policy::DeviceMode mode,
policy::DeviceMode mode, const std::string& domain,
const std::string& domain, const std::string& realm,
const std::string& realm, const std::string& device_id,
const std::string& device_id, LockResultCallback callback) {
const LockResultCallback& callback) {
device_lock_running_ = false; device_lock_running_ = false;
if (registration_mode_ != mode || registration_domain_ != domain || if (registration_mode_ != mode || registration_domain_ != domain ||
registration_realm_ != realm || registration_device_id_ != device_id) { registration_realm_ != realm || registration_device_id_ != device_id) {
LOG(ERROR) << "Locked data doesn't match."; LOG(ERROR) << "Locked data doesn't match.";
callback.Run(LOCK_READBACK_ERROR); std::move(callback).Run(LOCK_READBACK_ERROR);
return; return;
} }
ReportExistingLockUma(false /* is_existing_lock */); ReportExistingLockUma(false /* is_existing_lock */);
callback.Run(LOCK_SUCCESS); std::move(callback).Run(LOCK_SUCCESS);
} }
bool InstallAttributes::IsEnterpriseManaged() const { bool InstallAttributes::IsEnterpriseManaged() const {
...@@ -404,8 +403,8 @@ bool InstallAttributes::IsConsumerKioskDeviceWithAutoLaunch() { ...@@ -404,8 +403,8 @@ bool InstallAttributes::IsConsumerKioskDeviceWithAutoLaunch() {
void InstallAttributes::TriggerConsistencyCheck(int dbus_retries) { void InstallAttributes::TriggerConsistencyCheck(int dbus_retries) {
cryptohome_client_->TpmGetPassword( cryptohome_client_->TpmGetPassword(
base::Bind(&InstallAttributes::OnTpmGetPasswordCompleted, base::BindOnce(&InstallAttributes::OnTpmGetPasswordCompleted,
weak_ptr_factory_.GetWeakPtr(), dbus_retries)); weak_ptr_factory_.GetWeakPtr(), dbus_retries));
} }
void InstallAttributes::OnTpmGetPasswordCompleted( void InstallAttributes::OnTpmGetPasswordCompleted(
...@@ -440,8 +439,8 @@ void InstallAttributes::OnTpmGetPasswordCompleted( ...@@ -440,8 +439,8 @@ void InstallAttributes::OnTpmGetPasswordCompleted(
// Run any action (LockDevice call) that might have queued behind the // Run any action (LockDevice call) that might have queued behind the
// consistency check. // consistency check.
consistency_check_running_ = false; consistency_check_running_ = false;
if (!post_check_action_.is_null()) { if (post_check_action_) {
post_check_action_.Run(); std::move(post_check_action_).Run();
post_check_action_.Reset(); post_check_action_.Reset();
} }
} }
......
...@@ -44,7 +44,7 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) InstallAttributes { ...@@ -44,7 +44,7 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) InstallAttributes {
}; };
// A callback to handle responses of methods returning a LockResult value. // A callback to handle responses of methods returning a LockResult value.
typedef base::Callback<void(LockResult lock_result)> LockResultCallback; using LockResultCallback = base::OnceCallback<void(LockResult lock_result)>;
// Manage singleton instance. // Manage singleton instance.
static void Initialize(); static void Initialize();
...@@ -72,7 +72,7 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) InstallAttributes { ...@@ -72,7 +72,7 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) InstallAttributes {
// up to date with what cryptohome has. This method checks the readiness of // up to date with what cryptohome has. This method checks the readiness of
// attributes and read them if ready. Actual read will be performed in // attributes and read them if ready. Actual read will be performed in
// ReadAttributesIfReady(). // ReadAttributesIfReady().
void ReadImmutableAttributes(const base::Closure& callback); void ReadImmutableAttributes(base::OnceClosure callback);
// Updates the firmware management parameters from TPM, storing the devmode // Updates the firmware management parameters from TPM, storing the devmode
// flag according to |block_devmode|. Invokes |callback| when done. Must be // flag according to |block_devmode|. Invokes |callback| when done. Must be
...@@ -90,7 +90,7 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) InstallAttributes { ...@@ -90,7 +90,7 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) InstallAttributes {
const std::string& domain, const std::string& domain,
const std::string& realm, const std::string& realm,
const std::string& device_id, const std::string& device_id,
const LockResultCallback& callback); LockResultCallback callback);
// Checks whether this devices is under any kind of enterprise management. // Checks whether this devices is under any kind of enterprise management.
bool IsEnterpriseManaged() const; bool IsEnterpriseManaged() const;
...@@ -133,7 +133,7 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) InstallAttributes { ...@@ -133,7 +133,7 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) InstallAttributes {
bool consistency_check_running_ = false; bool consistency_check_running_ = false;
// To be run after the consistency check has finished. // To be run after the consistency check has finished.
base::Closure post_check_action_; base::OnceClosure post_check_action_;
// Wether the LockDevice() initiated TPM calls are running. // Wether the LockDevice() initiated TPM calls are running.
bool device_lock_running_ = false; bool device_lock_running_ = false;
...@@ -187,7 +187,7 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) InstallAttributes { ...@@ -187,7 +187,7 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) InstallAttributes {
const std::map<std::string, std::string>& attr_map); const std::map<std::string, std::string>& attr_map);
// Helper for ReadImmutableAttributes. // Helper for ReadImmutableAttributes.
void ReadAttributesIfReady(const base::Closure& callback, void ReadAttributesIfReady(base::OnceClosure callback,
base::Optional<bool> response); base::Optional<bool> response);
// Helper for LockDevice(). Handles the result of InstallAttributesIsReady() // Helper for LockDevice(). Handles the result of InstallAttributesIsReady()
...@@ -196,7 +196,7 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) InstallAttributes { ...@@ -196,7 +196,7 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) InstallAttributes {
const std::string& domain, const std::string& domain,
const std::string& realm, const std::string& realm,
const std::string& device_id, const std::string& device_id,
const LockResultCallback& callback, LockResultCallback callback,
base::Optional<bool> response); base::Optional<bool> response);
// Confirms the registered user and invoke the callback. // Confirms the registered user and invoke the callback.
...@@ -204,7 +204,7 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) InstallAttributes { ...@@ -204,7 +204,7 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) InstallAttributes {
const std::string& domain, const std::string& domain,
const std::string& realm, const std::string& realm,
const std::string& device_id, const std::string& device_id,
const LockResultCallback& callback); LockResultCallback callback);
// Check state of install attributes against TPM lock state and generate UMA // Check state of install attributes against TPM lock state and generate UMA
// for the result. Asynchronously retry |dbus_retries| times in case of DBUS // for the result. Asynchronously retry |dbus_retries| times in case of DBUS
......
...@@ -84,7 +84,7 @@ class InstallAttributesTest : public testing::Test { ...@@ -84,7 +84,7 @@ class InstallAttributesTest : public testing::Test {
InstallAttributes::LockResult result; InstallAttributes::LockResult result;
install_attributes_->LockDevice( install_attributes_->LockDevice(
device_mode, domain, realm, device_id, device_mode, domain, realm, device_id,
base::Bind(&CopyLockResult, &loop, &result)); base::BindOnce(&CopyLockResult, &loop, &result));
loop.Run(); loop.Run();
return result; return result;
} }
......
...@@ -21,9 +21,9 @@ namespace chromeos { ...@@ -21,9 +21,9 @@ namespace chromeos {
namespace { namespace {
void PostResultToTaskRunner(scoped_refptr<base::SequencedTaskRunner> runner, void PostResultToTaskRunner(scoped_refptr<base::SequencedTaskRunner> runner,
const base::Callback<void(bool)>& callback, base::OnceCallback<void(bool)> callback,
bool success) { bool success) {
runner->PostTask(FROM_HERE, base::BindOnce(callback, success)); runner->PostTask(FROM_HERE, base::BindOnce(std::move(callback), success));
} }
} // namespace } // namespace
...@@ -97,14 +97,14 @@ TPMTokenLoader::~TPMTokenLoader() { ...@@ -97,14 +97,14 @@ TPMTokenLoader::~TPMTokenLoader() {
} }
TPMTokenLoader::TPMTokenStatus TPMTokenLoader::IsTPMTokenEnabled( TPMTokenLoader::TPMTokenStatus TPMTokenLoader::IsTPMTokenEnabled(
const TPMReadyCallback& callback) { TPMReadyCallback callback) {
if (tpm_token_state_ == TPM_TOKEN_INITIALIZED) if (tpm_token_state_ == TPM_TOKEN_INITIALIZED)
return TPM_TOKEN_STATUS_ENABLED; return TPM_TOKEN_STATUS_ENABLED;
if (!IsTPMLoadingEnabled() || tpm_token_state_ == TPM_DISABLED) if (!IsTPMLoadingEnabled() || tpm_token_state_ == TPM_DISABLED)
return TPM_TOKEN_STATUS_DISABLED; return TPM_TOKEN_STATUS_DISABLED;
// Status is not known yet. // Status is not known yet.
if (!callback.is_null()) if (callback)
tpm_ready_callback_list_.push_back(callback); tpm_ready_callback_list_.push_back(std::move(callback));
return TPM_TOKEN_STATUS_UNDETERMINED; return TPM_TOKEN_STATUS_UNDETERMINED;
} }
...@@ -173,10 +173,10 @@ void TPMTokenLoader::ContinueTokenInitialization() { ...@@ -173,10 +173,10 @@ void TPMTokenLoader::ContinueTokenInitialization() {
FROM_HERE, FROM_HERE,
base::BindOnce( base::BindOnce(
&crypto::InitializeTPMTokenAndSystemSlot, tpm_token_slot_id_, &crypto::InitializeTPMTokenAndSystemSlot, tpm_token_slot_id_,
base::Bind(&PostResultToTaskRunner, base::BindOnce(
base::ThreadTaskRunnerHandle::Get(), &PostResultToTaskRunner, base::ThreadTaskRunnerHandle::Get(),
base::Bind(&TPMTokenLoader::OnTPMTokenInitialized, base::BindOnce(&TPMTokenLoader::OnTPMTokenInitialized,
weak_factory_.GetWeakPtr())))); weak_factory_.GetWeakPtr()))));
return; return;
} }
case TPM_TOKEN_INITIALIZED: { case TPM_TOKEN_INITIALIZED: {
...@@ -218,11 +218,8 @@ void TPMTokenLoader::NotifyTPMTokenReady() { ...@@ -218,11 +218,8 @@ void TPMTokenLoader::NotifyTPMTokenReady() {
DCHECK(tpm_token_state_ == TPM_DISABLED || DCHECK(tpm_token_state_ == TPM_DISABLED ||
tpm_token_state_ == TPM_TOKEN_INITIALIZED); tpm_token_state_ == TPM_TOKEN_INITIALIZED);
bool tpm_status = tpm_token_state_ == TPM_TOKEN_INITIALIZED; bool tpm_status = tpm_token_state_ == TPM_TOKEN_INITIALIZED;
for (TPMReadyCallbackList::iterator i = tpm_ready_callback_list_.begin(); for (TPMReadyCallback& callback : tpm_ready_callback_list_)
i != tpm_ready_callback_list_.end(); std::move(callback).Run(tpm_status);
++i) {
i->Run(tpm_status);
}
tpm_ready_callback_list_.clear(); tpm_ready_callback_list_.clear();
} }
......
...@@ -43,8 +43,8 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) TPMTokenLoader ...@@ -43,8 +43,8 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) TPMTokenLoader
TPM_TOKEN_STATUS_DISABLED TPM_TOKEN_STATUS_DISABLED
}; };
typedef base::Callback<void(bool)> TPMReadyCallback; using TPMReadyCallback = base::OnceCallback<void(bool)>;
typedef std::vector<TPMReadyCallback> TPMReadyCallbackList; using TPMReadyCallbackList = std::vector<TPMReadyCallback>;
// Sets the global instance. Must be called before any calls to Get(). // Sets the global instance. Must be called before any calls to Get().
// The global instance will immediately start observing |LoginState|. // The global instance will immediately start observing |LoginState|.
...@@ -78,7 +78,7 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) TPMTokenLoader ...@@ -78,7 +78,7 @@ class COMPONENT_EXPORT(CHROMEOS_TPM) TPMTokenLoader
// Checks if the TPM token is enabled. If the state is unknown, |callback| // Checks if the TPM token is enabled. If the state is unknown, |callback|
// will be called back once the TPM state is known. // will be called back once the TPM state is known.
TPMTokenStatus IsTPMTokenEnabled(const TPMReadyCallback& callback); TPMTokenStatus IsTPMTokenEnabled(TPMReadyCallback callback);
std::string tpm_user_pin() const { return tpm_user_pin_; } std::string tpm_user_pin() const { return tpm_user_pin_; }
......
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