Index: chromeos/tpm/tpm_token_info_getter.cc |
diff --git a/chromeos/tpm/tpm_token_info_getter.cc b/chromeos/tpm/tpm_token_info_getter.cc |
index e51392f8fb703937bf890d89d47ffca4584f126a..31a308978226d6c7a68986227e75896bc8a0ca08 100644 |
--- a/chromeos/tpm/tpm_token_info_getter.cc |
+++ b/chromeos/tpm/tpm_token_info_getter.cc |
@@ -8,6 +8,7 @@ |
#include "base/bind.h" |
#include "base/location.h" |
+#include "chromeos/cryptohome/cryptohome_parameters.h" |
#include "chromeos/dbus/cryptohome_client.h" |
namespace { |
@@ -43,22 +44,20 @@ TPMTokenInfo::~TPMTokenInfo() {} |
// static |
scoped_ptr<TPMTokenInfoGetter> TPMTokenInfoGetter::CreateForUserToken( |
- const std::string& user_id, |
+ const AccountId& account_id, |
CryptohomeClient* cryptohome_client, |
const scoped_refptr<base::TaskRunner>& delayed_task_runner) { |
- CHECK(!user_id.empty()); |
- return scoped_ptr<TPMTokenInfoGetter>( |
- new TPMTokenInfoGetter( |
- TYPE_USER, user_id, cryptohome_client, delayed_task_runner)); |
+ CHECK(account_id.is_valid()); |
+ return scoped_ptr<TPMTokenInfoGetter>(new TPMTokenInfoGetter( |
+ TYPE_USER, account_id, cryptohome_client, delayed_task_runner)); |
} |
// static |
scoped_ptr<TPMTokenInfoGetter> TPMTokenInfoGetter::CreateForSystemToken( |
CryptohomeClient* cryptohome_client, |
const scoped_refptr<base::TaskRunner>& delayed_task_runner) { |
- return scoped_ptr<TPMTokenInfoGetter>( |
- new TPMTokenInfoGetter( |
- TYPE_SYSTEM, std::string(), cryptohome_client, delayed_task_runner)); |
+ return scoped_ptr<TPMTokenInfoGetter>(new TPMTokenInfoGetter( |
+ TYPE_SYSTEM, EmptyAccountId(), cryptohome_client, delayed_task_runner)); |
} |
TPMTokenInfoGetter::~TPMTokenInfoGetter() {} |
@@ -75,18 +74,17 @@ void TPMTokenInfoGetter::Start(const TPMTokenInfoCallback& callback) { |
TPMTokenInfoGetter::TPMTokenInfoGetter( |
TPMTokenInfoGetter::Type type, |
- const std::string& user_id, |
+ const AccountId& account_id, |
CryptohomeClient* cryptohome_client, |
const scoped_refptr<base::TaskRunner>& delayed_task_runner) |
: delayed_task_runner_(delayed_task_runner), |
type_(type), |
state_(TPMTokenInfoGetter::STATE_INITIAL), |
- user_id_(user_id), |
+ account_id_(account_id), |
tpm_request_delay_( |
base::TimeDelta::FromMilliseconds(kInitialRequestDelayMs)), |
cryptohome_client_(cryptohome_client), |
- weak_factory_(this) { |
-} |
+ weak_factory_(this) {} |
void TPMTokenInfoGetter::Continue() { |
switch (state_) { |
@@ -105,9 +103,9 @@ void TPMTokenInfoGetter::Continue() { |
weak_factory_.GetWeakPtr())); |
} else { // if (type_ == TYPE_USER) |
cryptohome_client_->Pkcs11GetTpmTokenInfoForUser( |
- user_id_, |
- base::Bind(&TPMTokenInfoGetter::OnPkcs11GetTpmTokenInfo, |
- weak_factory_.GetWeakPtr())); |
+ cryptohome::Identification(account_id_), |
+ base::Bind(&TPMTokenInfoGetter::OnPkcs11GetTpmTokenInfo, |
+ weak_factory_.GetWeakPtr())); |
} |
break; |
case STATE_DONE: |