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

Unified Diff: google_apis/gaia/oauth2_token_service.cc

Issue 57103002: Make OAuth2TokenService::Request class multi-login aware. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 1 month 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
Index: google_apis/gaia/oauth2_token_service.cc
diff --git a/google_apis/gaia/oauth2_token_service.cc b/google_apis/gaia/oauth2_token_service.cc
index fe5e0041d3a379df77f50c7e3ae3027c5797a74d..9684281097b839c75b47f636d755b70db36d0d79 100644
--- a/google_apis/gaia/oauth2_token_service.cc
+++ b/google_apis/gaia/oauth2_token_service.cc
@@ -47,14 +47,20 @@ bool OAuth2TokenService::RequestParameters::operator<(
}
OAuth2TokenService::RequestImpl::RequestImpl(
+ const std::string& account_id,
OAuth2TokenService::Consumer* consumer)
- : consumer_(consumer) {
+ : account_id_(account_id),
+ consumer_(consumer) {
}
OAuth2TokenService::RequestImpl::~RequestImpl() {
DCHECK(CalledOnValidThread());
}
+std::string OAuth2TokenService::RequestImpl::GetAccountId() const {
+ return account_id_;
+}
+
void OAuth2TokenService::RequestImpl::InformConsumer(
const GoogleServiceAuthError& error,
const std::string& access_token,
@@ -445,7 +451,7 @@ OAuth2TokenService::StartRequestForClientWithContext(
Consumer* consumer) {
DCHECK(CalledOnValidThread());
- scoped_ptr<RequestImpl> request = CreateRequest(consumer);
+ scoped_ptr<RequestImpl> request = CreateRequest(account_id, consumer);
if (!RefreshTokenIsAvailable(account_id)) {
base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
@@ -474,8 +480,9 @@ OAuth2TokenService::StartRequestForClientWithContext(
}
scoped_ptr<OAuth2TokenService::RequestImpl> OAuth2TokenService::CreateRequest(
+ const std::string& account_id,
Consumer* consumer) {
- return scoped_ptr<RequestImpl>(new RequestImpl(consumer));
+ return scoped_ptr<RequestImpl>(new RequestImpl(account_id, consumer));
}
void OAuth2TokenService::FetchOAuth2Token(RequestImpl* request,
« google_apis/gaia/oauth2_token_service.h ('K') | « google_apis/gaia/oauth2_token_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698