summaryrefslogtreecommitdiffstats
path: root/chromeos/tpm_token_loader.cc
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-27 22:27:21 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-27 22:27:21 +0000
commite2ea5ca6a89c308af53c5ee6d5d1f61ccb11faf8 (patch)
tree84d778268dd77316c7db3bc451ae0726053d768f /chromeos/tpm_token_loader.cc
parent33c2fdaffa5d8a026eff689790bf33e2dacb5025 (diff)
downloadchromium_src-e2ea5ca6a89c308af53c5ee6d5d1f61ccb11faf8.zip
chromium_src-e2ea5ca6a89c308af53c5ee6d5d1f61ccb11faf8.tar.gz
chromium_src-e2ea5ca6a89c308af53c5ee6d5d1f61ccb11faf8.tar.bz2
chromeos: Load chaps module and lookup TPM slots on the worker pool.
BUG=345713 Review URL: https://codereview.chromium.org/181053002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253942 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/tpm_token_loader.cc')
-rw-r--r--chromeos/tpm_token_loader.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/chromeos/tpm_token_loader.cc b/chromeos/tpm_token_loader.cc
index f48fb16..7f88581 100644
--- a/chromeos/tpm_token_loader.cc
+++ b/chromeos/tpm_token_loader.cc
@@ -48,6 +48,12 @@ void CallOpenPersistentNSSDB() {
crypto::EnableTPMTokenForNSS();
}
+void PostResultToTaskRunner(scoped_refptr<base::SequencedTaskRunner> runner,
+ const base::Callback<void(bool)>& callback,
+ bool success) {
+ runner->PostTask(FROM_HERE, base::Bind(callback, success));
+}
+
} // namespace
static TPMTokenLoader* g_tpm_token_loader = NULL;
@@ -197,12 +203,15 @@ void TPMTokenLoader::ContinueTokenInitialization() {
return;
}
case TPM_TOKEN_INFO_RECEIVED: {
- base::PostTaskAndReplyWithResult(
- crypto_task_runner_.get(),
+ crypto_task_runner_->PostTask(
FROM_HERE,
- base::Bind(&crypto::InitializeTPMToken, tpm_token_slot_id_),
- base::Bind(&TPMTokenLoader::OnTPMTokenInitialized,
- weak_factory_.GetWeakPtr()));
+ base::Bind(
+ &crypto::InitializeTPMToken,
+ tpm_token_slot_id_,
+ base::Bind(&PostResultToTaskRunner,
+ base::MessageLoopProxy::current(),
+ base::Bind(&TPMTokenLoader::OnTPMTokenInitialized,
+ weak_factory_.GetWeakPtr()))));
return;
}
case TPM_TOKEN_INITIALIZED: {