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

Unified Diff: chromeos/tpm_token_loader.cc

Issue 181053002: chromeos: Load chaps module and lookup TPM slots on the worker pool. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 10 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
« no previous file with comments | « no previous file | crypto/nss_util.h » ('j') | crypto/nss_util.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/tpm_token_loader.cc
diff --git a/chromeos/tpm_token_loader.cc b/chromeos/tpm_token_loader.cc
index f48fb16e99e915defa002b34b9d44a38e5a7a074..7f88581c4bddc96926ed8d5ad995e98c86716677 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: {
« no previous file with comments | « no previous file | crypto/nss_util.h » ('j') | crypto/nss_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698