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

Unified Diff: tpm_init.h

Issue 3475009: Adds the necessary changes to tpm_init to allow triggered initialization. (Closed) Base URL: http://git.chromium.org/git/tpm_init.git
Patch Set: Address feedback. Created 10 years, 2 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 | « tpm.cc ('k') | tpm_init.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tpm_init.h
diff --git a/tpm_init.h b/tpm_init.h
index 8a0024f853fe6fd6e6a249dfb8c8ea9a69df4349..5cb00c7ea9ecbfaa391696ba4bbef677b138aa51 100644
--- a/tpm_init.h
+++ b/tpm_init.h
@@ -4,8 +4,8 @@
// TpmInit - public interface class for initializing the TPM
+#include <base/basictypes.h>
#include <base/scoped_ptr.h>
-#include <base/platform_thread.h>
#include <chromeos/utility.h>
#ifndef TPM_INIT_TPM_INIT_H_
@@ -16,6 +16,10 @@ namespace tpm_init {
class TpmInitTask;
class TpmInit {
+ // Friend class TpmInitTask as it is a glue class to allow ThreadMain to be
+ // called on a separate thread without inheriting from
+ // PlatformThread::Delegate
+ friend class TpmInitTask;
public:
class TpmInitCallback {
@@ -52,22 +56,35 @@ class TpmInit {
// Returns true if the TPM is being owned
virtual bool IsTpmBeingOwned();
+ // Returns true if initialization has been called
+ virtual bool HasInitializeBeenCalled();
+
// Gets the TPM password if the TPM initialization took ownership
//
// Parameters
// password (OUT) - The owner password used for the TPM
virtual bool GetTpmPassword(chromeos::Blob* password);
+ // Clears the TPM password from memory and disk
+ virtual void ClearStoredTpmPassword();
+
// Returns the number of milliseconds it took to initialize the TPM
virtual long GetInitializationMillis();
private:
+ virtual void ThreadMain();
+
// The background task for initializing the TPM, implemented as a
// PlatformThread::Delegate
scoped_ptr<TpmInitTask> tpm_init_task_;
TpmInitCallback* notify_callback_;
+ bool initialize_called_;
+ bool task_done_;
+ bool initialize_took_ownership_;
+ long initialization_time_;
+
DISALLOW_COPY_AND_ASSIGN(TpmInit);
};
« no previous file with comments | « tpm.cc ('k') | tpm_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698