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

Unified Diff: chrome/browser/history/web_history_service.cc

Issue 23382008: Making OAuth2TokenService multi-login aware, updating callers, minor fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing to include the update to ProfileSyncService: r224220 Created 7 years, 3 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
Index: chrome/browser/history/web_history_service.cc
diff --git a/chrome/browser/history/web_history_service.cc b/chrome/browser/history/web_history_service.cc
index 3def0b69ca2f3684e98038072bb04467713e2659..38167137c0e5c2f6a989b7a0e444a8f92b960a03 100644
--- a/chrome/browser/history/web_history_service.cc
+++ b/chrome/browser/history/web_history_service.cc
@@ -81,7 +81,8 @@ class RequestImpl : public WebHistoryService::Request,
ProfileOAuth2TokenService* token_service =
ProfileOAuth2TokenServiceFactory::GetForProfile(profile_);
- token_request_ = token_service->StartRequest(oauth_scopes, this);
+ token_request_ = token_service->StartRequest(
+ token_service->GetPrimaryAccountId(), oauth_scopes, this);
is_pending_ = true;
}
@@ -99,10 +100,13 @@ class RequestImpl : public WebHistoryService::Request,
if (response_code_ == net::HTTP_UNAUTHORIZED && ++auth_retry_count_ <= 1) {
OAuth2TokenService::ScopeSet oauth_scopes;
oauth_scopes.insert(kHistoryOAuthScope);
- ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)
- ->InvalidateToken(oauth_scopes, access_token_);
+ ProfileOAuth2TokenService* token_service =
+ ProfileOAuth2TokenServiceFactory::GetForProfile(profile_);
+ token_service->InvalidateToken(token_service->GetPrimaryAccountId(),
+ oauth_scopes,
+ access_token_);
- access_token_ = std::string();
+ access_token_.clear();
Start();
return;
}
« no previous file with comments | « chrome/browser/google_apis/auth_service.cc ('k') | chrome/browser/invalidation/invalidation_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698