| 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 #include "chromeos/tpm_token_loader.h" | 5 #include "chromeos/tpm_token_loader.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 // and CryptohomeClient calls are not thread safe. | 188 // and CryptohomeClient calls are not thread safe. |
| 189 DBusThreadManager::Get()->GetCryptohomeClient()->Pkcs11GetTpmTokenInfo( | 189 DBusThreadManager::Get()->GetCryptohomeClient()->Pkcs11GetTpmTokenInfo( |
| 190 base::Bind(&TPMTokenLoader::OnPkcs11GetTpmTokenInfo, | 190 base::Bind(&TPMTokenLoader::OnPkcs11GetTpmTokenInfo, |
| 191 weak_factory_.GetWeakPtr())); | 191 weak_factory_.GetWeakPtr())); |
| 192 return; | 192 return; |
| 193 } | 193 } |
| 194 case TPM_TOKEN_INFO_RECEIVED: { | 194 case TPM_TOKEN_INFO_RECEIVED: { |
| 195 crypto_task_runner_->PostTask( | 195 crypto_task_runner_->PostTask( |
| 196 FROM_HERE, | 196 FROM_HERE, |
| 197 base::Bind( | 197 base::Bind( |
| 198 &crypto::InitializeTPMToken, | 198 &crypto::InitializeTPMTokenAndSystemSlot, |
| 199 tpm_token_slot_id_, | 199 tpm_token_slot_id_, |
| 200 base::Bind(&PostResultToTaskRunner, | 200 base::Bind(&PostResultToTaskRunner, |
| 201 base::MessageLoopProxy::current(), | 201 base::MessageLoopProxy::current(), |
| 202 base::Bind(&TPMTokenLoader::OnTPMTokenInitialized, | 202 base::Bind(&TPMTokenLoader::OnTPMTokenInitialized, |
| 203 weak_factory_.GetWeakPtr())))); | 203 weak_factory_.GetWeakPtr())))); |
| 204 return; | 204 return; |
| 205 } | 205 } |
| 206 case TPM_TOKEN_INITIALIZED: { | 206 case TPM_TOKEN_INITIALIZED: { |
| 207 NotifyTPMTokenReady(); | 207 NotifyTPMTokenReady(); |
| 208 return; | 208 return; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 void TPMTokenLoader::NotifyTPMTokenReady() { | 284 void TPMTokenLoader::NotifyTPMTokenReady() { |
| 285 FOR_EACH_OBSERVER(Observer, observers_, OnTPMTokenReady()); | 285 FOR_EACH_OBSERVER(Observer, observers_, OnTPMTokenReady()); |
| 286 } | 286 } |
| 287 | 287 |
| 288 void TPMTokenLoader::LoggedInStateChanged() { | 288 void TPMTokenLoader::LoggedInStateChanged() { |
| 289 VLOG(1) << "LoggedInStateChanged"; | 289 VLOG(1) << "LoggedInStateChanged"; |
| 290 MaybeStartTokenInitialization(); | 290 MaybeStartTokenInitialization(); |
| 291 } | 291 } |
| 292 | 292 |
| 293 } // namespace chromeos | 293 } // namespace chromeos |
| OLD | NEW |