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

Unified Diff: chromeos/network/cert_loader.h

Issue 15649018: Call crypto::InitializeTPMToken on the IO thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, move declaration Created 7 years, 6 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 | « chrome/browser/ui/webui/options/certificate_manager_browsertest.cc ('k') | chromeos/network/cert_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/cert_loader.h
diff --git a/chromeos/network/cert_loader.h b/chromeos/network/cert_loader.h
index a57d29a362069c05badc8527e98e6cd0816b5e9c..5996076f27a59ab8f31f58b1d7ec9ad4faba015b 100644
--- a/chromeos/network/cert_loader.h
+++ b/chromeos/network/cert_loader.h
@@ -19,6 +19,10 @@
#include "net/cert/cert_database.h"
#include "net/cert/x509_certificate.h"
+namespace base {
+class SequencedTaskRunner;
+}
+
namespace crypto {
class SymmetricKey;
}
@@ -52,6 +56,13 @@ class CHROMEOS_EXPORT CertLoader : public net::CertDatabase::Observer,
virtual ~CertLoader();
+ // |crypto_task_runner| is the task runner that any synchronous crypto calls
+ // should be made from. e.g. in Chrome this is the IO thread. Must be called
+ // after the thread is started. Certificate loading will not happen unless
+ // this is set.
+ void SetCryptoTaskRunner(
+ const scoped_refptr<base::SequencedTaskRunner>& crypto_task_runner);
+
void AddObserver(CertLoader::Observer* observer);
void RemoveObserver(CertLoader::Observer* observer);
@@ -78,12 +89,14 @@ class CHROMEOS_EXPORT CertLoader : public net::CertDatabase::Observer,
friend class NetworkHandler;
CertLoader();
- void RequestCertificates();
+ void Init();
+ void MaybeRequestCertificates();
// This is the cyclic chain of callbacks to initialize the TPM token and to
// kick off the update of the certificate list.
void InitializeTokenAndLoadCertificates();
void RetryTokenInitializationLater();
+ void OnPersistentNSSDBOpened();
void OnTpmIsEnabled(DBusMethodCallStatus call_status,
bool tpm_is_enabled);
void OnPkcs11IsTpmTokenReady(DBusMethodCallStatus call_status,
@@ -91,7 +104,7 @@ class CHROMEOS_EXPORT CertLoader : public net::CertDatabase::Observer,
void OnPkcs11GetTpmTokenInfo(DBusMethodCallStatus call_status,
const std::string& token_name,
const std::string& user_pin);
- void InitializeNSSForTPMToken();
+ void OnTPMTokenInitialized(bool success);
// These calls handle the updating of the certificate list after the TPM token
// was initialized.
@@ -119,11 +132,12 @@ class CHROMEOS_EXPORT CertLoader : public net::CertDatabase::Observer,
// be left.
enum TPMTokenState {
TPM_STATE_UNKNOWN,
+ TPM_DB_OPENED,
TPM_DISABLED,
TPM_ENABLED,
TPM_TOKEN_READY,
TPM_TOKEN_INFO_RECEIVED,
- TPM_TOKEN_NSS_INITIALIZED,
+ TPM_TOKEN_INITIALIZED,
};
TPMTokenState tpm_token_state_;
@@ -141,6 +155,9 @@ class CHROMEOS_EXPORT CertLoader : public net::CertDatabase::Observer,
base::ThreadChecker thread_checker_;
+ // TaskRunner for crypto calls.
+ scoped_refptr<base::SequencedTaskRunner> crypto_task_runner_;
+
// This factory should be used only for callbacks during TPMToken
// initialization.
base::WeakPtrFactory<CertLoader> initialize_token_factory_;
« no previous file with comments | « chrome/browser/ui/webui/options/certificate_manager_browsertest.cc ('k') | chromeos/network/cert_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698