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

Unified Diff: chromeos/tpm/tpm_token_info_getter.cc

Issue 1693383003: ChromeOS cryptohome should be able to use gaia id as user identifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit tests. Created 4 years, 10 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/tpm/tpm_token_info_getter.h ('k') | chromeos/tpm/tpm_token_info_getter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « chromeos/tpm/tpm_token_info_getter.h ('k') | chromeos/tpm/tpm_token_info_getter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698