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

Unified Diff: components/signin/core/browser/account_reconcilor.cc

Issue 344513005: Revert "Improve the no-op reconcilor so that it doesn't "hang" after the first execution, but inste… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | « components/signin/core/browser/account_reconcilor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/signin/core/browser/account_reconcilor.cc
diff --git a/components/signin/core/browser/account_reconcilor.cc b/components/signin/core/browser/account_reconcilor.cc
index 1fd4cff900313875753caa65836b50b26793f3f9..0778034ba501e0759fae94af9f5c21ae41401ebb 100644
--- a/components/signin/core/browser/account_reconcilor.cc
+++ b/components/signin/core/browser/account_reconcilor.cc
@@ -359,10 +359,8 @@ void AccountReconcilor::GoogleSignedOut(const std::string& username) {
}
void AccountReconcilor::PerformMergeAction(const std::string& account_id) {
- if (!switches::IsNewProfileManagement()) {
- MarkAccountAsAddedToCookie(account_id);
+ if (!switches::IsNewProfileManagement())
return;
- }
VLOG(1) << "AccountReconcilor::PerformMergeAction: " << account_id;
merge_session_helper_.LogIn(account_id);
}
@@ -400,10 +398,8 @@ void AccountReconcilor::PerformFinishRemoveAction(
void AccountReconcilor::PerformAddToChromeAction(const std::string& account_id,
int session_index) {
- if (!switches::IsNewProfileManagement()) {
- MarkAccountAsAddedToChrome(account_id);
+ if (!switches::IsNewProfileManagement())
return;
- }
VLOG(1) << "AccountReconcilor::PerformAddToChromeAction:"
<< " account=" << account_id << " session_index=" << session_index;
@@ -710,9 +706,13 @@ void AccountReconcilor::ScheduleStartReconcileIfChromeAccountsChanged() {
}
}
-// Remove the account from the list that is being merged.
-void AccountReconcilor::MarkAccountAsAddedToCookie(
- const std::string& account_id) {
+void AccountReconcilor::MergeSessionCompleted(
+ const std::string& account_id,
+ const GoogleServiceAuthError& error) {
+ VLOG(1) << "AccountReconcilor::MergeSessionCompleted: account_id="
+ << account_id;
+
+ // Remove the account from the list that is being merged.
for (std::vector<std::string>::iterator i = add_to_cookie_.begin();
i != add_to_cookie_.end();
++i) {
@@ -721,15 +721,7 @@ void AccountReconcilor::MarkAccountAsAddedToCookie(
break;
}
}
-}
-
-void AccountReconcilor::MergeSessionCompleted(
- const std::string& account_id,
- const GoogleServiceAuthError& error) {
- VLOG(1) << "AccountReconcilor::MergeSessionCompleted: account_id="
- << account_id;
- MarkAccountAsAddedToCookie(account_id);
CalculateIfReconcileIsDone();
ScheduleStartReconcileIfChromeAccountsChanged();
}
@@ -756,9 +748,13 @@ void AccountReconcilor::PerformAddAccountToTokenService(
token_service_->UpdateCredentials(account_id, refresh_token);
}
-// Remove the account from the list that is being updated.
-void AccountReconcilor::MarkAccountAsAddedToChrome(
- const std::string& account_id) {
+void AccountReconcilor::HandleRefreshTokenFetched(
+ const std::string& account_id,
+ const std::string& refresh_token) {
+ if (!refresh_token.empty()) {
+ PerformAddAccountToTokenService(account_id, refresh_token);
+ }
+ // Remove the account from the list that is being updated.
for (std::vector<std::pair<std::string, int> >::iterator i =
add_to_chrome_.begin();
i != add_to_chrome_.end();
@@ -768,14 +764,6 @@ void AccountReconcilor::MarkAccountAsAddedToChrome(
break;
}
}
-}
-
-void AccountReconcilor::HandleRefreshTokenFetched(
- const std::string& account_id,
- const std::string& refresh_token) {
- if (!refresh_token.empty())
- PerformAddAccountToTokenService(account_id, refresh_token);
- MarkAccountAsAddedToChrome(account_id);
CalculateIfReconcileIsDone();
}
« no previous file with comments | « components/signin/core/browser/account_reconcilor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698