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

Unified Diff: chrome/browser/signin/google_auto_login_helper.cc

Issue 63253003: Fix issues with token refresh in AccountReconcilor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove the event 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: chrome/browser/signin/google_auto_login_helper.cc
diff --git a/chrome/browser/signin/google_auto_login_helper.cc b/chrome/browser/signin/google_auto_login_helper.cc
index 09cb58a6827945e21241be7770792d1d6e1c5ed4..4a53ef54332b6fb0d067609b945110503dd370c0 100644
--- a/chrome/browser/signin/google_auto_login_helper.cc
+++ b/chrome/browser/signin/google_auto_login_helper.cc
@@ -20,8 +20,12 @@ void GoogleAutoLoginHelper::LogIn() {
}
void GoogleAutoLoginHelper::LogIn(const std::string& account_id) {
- uber_token_fetcher_.reset(new UbertokenFetcher(profile_, this));
- uber_token_fetcher_->StartFetchingToken(account_id);
+ if (uber_token_fetcher_.get()) {
+ accounts_.push_back(account_id);
+ } else {
+ uber_token_fetcher_.reset(new UbertokenFetcher(profile_, this));
+ uber_token_fetcher_->StartFetchingToken(account_id);
+ }
}
void GoogleAutoLoginHelper::OnUbertokenSuccess(const std::string& uber_token) {
@@ -38,7 +42,13 @@ void GoogleAutoLoginHelper::OnUbertokenFailure(
void GoogleAutoLoginHelper::OnMergeSessionSuccess(const std::string& data) {
DVLOG(1) << "MergeSession successful." << data;
- base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
+ if (accounts_.empty()) {
+ base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
+ } else {
+ uber_token_fetcher_.reset(new UbertokenFetcher(profile_, this));
+ uber_token_fetcher_->StartFetchingToken(accounts_.front());
+ accounts_.pop_front();
+ }
}
void GoogleAutoLoginHelper::OnMergeSessionFailure(

Powered by Google App Engine
This is Rietveld 408576698