OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMEOS_TPM_TOKEN_LOADER_H_ | 5 #ifndef CHROMEOS_TPM_TOKEN_LOADER_H_ |
6 #define CHROMEOS_TPM_TOKEN_LOADER_H_ | 6 #define CHROMEOS_TPM_TOKEN_LOADER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "chromeos/chromeos_export.h" | 16 #include "chromeos/chromeos_export.h" |
17 #include "chromeos/dbus/dbus_method_call_status.h" | 17 #include "chromeos/dbus/dbus_method_call_status.h" |
18 #include "chromeos/login/login_state.h" | 18 #include "chromeos/login/login_state.h" |
19 | 19 |
20 namespace base { | 20 namespace base { |
21 class SequencedTaskRunner; | 21 class SequencedTaskRunner; |
22 } | 22 } |
23 | 23 |
24 namespace chromeos { | 24 namespace chromeos { |
25 | 25 |
26 // This class is responsible for loading the TPM token when the user logs | 26 // This class is responsible for loading the TPM backed system token when the |
mattm
2014/07/10 22:06:25
nit: "TPM backed token and system slot"
| |
27 // in. It is expected to be constructed on the UI thread and public methods | 27 // user logs in. It is expected to be constructed on the UI thread and public |
28 // should all be called from the UI thread. When the TPM token is loaded, | 28 // methods should all be called from the UI thread. When the TPM token is |
29 // or if the TPM should stay disabled for the session, the observers are | 29 // loaded, or if the TPM should stay disabled for the session, the observers are |
30 // notified using |OnTPMTokenReady|. | 30 // notified using |OnTPMTokenReady|. |
31 // Note: This currently loads the hard coded default slot with id 0. See | |
32 // CryptohomeClient. | |
mattm
2014/07/10 22:06:25
nit: Maybe be more precise like "See CryptohomeCli
| |
31 class CHROMEOS_EXPORT TPMTokenLoader : public LoginState::Observer { | 33 class CHROMEOS_EXPORT TPMTokenLoader : public LoginState::Observer { |
32 public: | 34 public: |
33 class Observer { | 35 class Observer { |
34 public: | 36 public: |
35 // Called when the TPM token initialization is done or the case where TPM | 37 // Called when the TPM token initialization is done or the case where TPM |
36 // should stay disabled is detected (e.g. on guest login). | 38 // should stay disabled is detected (e.g. on guest login). |
37 virtual void OnTPMTokenReady() = 0; | 39 virtual void OnTPMTokenReady() = 0; |
38 | 40 |
39 protected: | 41 protected: |
40 virtual ~Observer() {} | 42 virtual ~Observer() {} |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 scoped_refptr<base::SequencedTaskRunner> crypto_task_runner_; | 137 scoped_refptr<base::SequencedTaskRunner> crypto_task_runner_; |
136 | 138 |
137 base::WeakPtrFactory<TPMTokenLoader> weak_factory_; | 139 base::WeakPtrFactory<TPMTokenLoader> weak_factory_; |
138 | 140 |
139 DISALLOW_COPY_AND_ASSIGN(TPMTokenLoader); | 141 DISALLOW_COPY_AND_ASSIGN(TPMTokenLoader); |
140 }; | 142 }; |
141 | 143 |
142 } // namespace chromeos | 144 } // namespace chromeos |
143 | 145 |
144 #endif // CHROMEOS_TPM_TOKEN_LOADER_H_ | 146 #endif // CHROMEOS_TPM_TOKEN_LOADER_H_ |
OLD | NEW |