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

Unified Diff: chromeos/tpm_token_loader.h

Issue 135193007: Use user specific NSSDatabase in CertLoader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 11 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 | « chromeos/network/network_connection_handler_unittest.cc ('k') | chromeos/tpm_token_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/tpm_token_loader.h
diff --git a/chromeos/tpm_token_loader.h b/chromeos/tpm_token_loader.h
index 8500d4a2d0e4b8bb999c49dd780196e5db0985b7..9ac7a61e61df4adfc9b5636c31771a2c35fcd190 100644
--- a/chromeos/tpm_token_loader.h
+++ b/chromeos/tpm_token_loader.h
@@ -33,12 +33,8 @@ class CHROMEOS_EXPORT TPMTokenLoader : public LoginState::Observer {
class Observer {
public:
// Called when the TPM token initialization is done or the case where TPM
- // should stay disabled is detected (e.g. on guest login). If TPM is
- // disabled, |tpm_user_pin|, |tpm_token_name| and |tpm_token_slot_id| will
- // not be set.
- virtual void OnTPMTokenReady(const std::string& tpm_user_pin,
- const std::string& tpm_token_name,
- int tpm_token_slot_id) = 0;
+ // should stay disabled is detected (e.g. on guest login).
+ virtual void OnTPMTokenReady() = 0;
protected:
virtual ~Observer() {}
@@ -48,6 +44,9 @@ class CHROMEOS_EXPORT TPMTokenLoader : public LoginState::Observer {
// The global instance will immediately start observing |LoginState|.
static void Initialize();
+ // Sets the global. stubbed out, instance. To be used in tests.
+ static void InitializeForTest();
+
// Destroys the global instance.
static void Shutdown();
@@ -57,11 +56,6 @@ class CHROMEOS_EXPORT TPMTokenLoader : public LoginState::Observer {
// Returns true if the global instance has been initialized.
static bool IsInitialized();
- // By default, TPMTokenLoader tries to load the TPMToken only if running
- // in a ChromeOS environment. Tests can call this function after Initialize()
- // and before SetCryptoTaskRunner() to enable the TPM initialization.
- void InitializeTPMForTest();
-
// |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. When called, this will attempt to start TPM
@@ -75,8 +69,10 @@ class CHROMEOS_EXPORT TPMTokenLoader : public LoginState::Observer {
// Checks if the TPM token in ready to be used.
bool IsTPMTokenReady() const;
+ std::string tpm_user_pin() const { return tpm_user_pin_; }
+
private:
- TPMTokenLoader();
+ explicit TPMTokenLoader(bool for_test);
virtual ~TPMTokenLoader();
// Starts tpm token initialization if the user is logged in and the crypto
@@ -106,7 +102,7 @@ class CHROMEOS_EXPORT TPMTokenLoader : public LoginState::Observer {
// LoginState::Observer
virtual void LoggedInStateChanged() OVERRIDE;
- bool initialize_tpm_for_test_;
+ bool initialized_for_test_;
ObserverList<Observer> observers_;
« no previous file with comments | « chromeos/network/network_connection_handler_unittest.cc ('k') | chromeos/tpm_token_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698