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

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

Issue 2752873002: Fix refresh token is not available after Chrome restart on crash. (Closed)
Patch Set: comment added Created 3 years, 9 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: components/signin/core/browser/signin_manager_base.cc
diff --git a/components/signin/core/browser/signin_manager_base.cc b/components/signin/core/browser/signin_manager_base.cc
index 68d68b477b4334edc4d004773f9daa798cc5621d..b36d21d0f56930938c7e34d92c8628b878b2e0bd 100644
--- a/components/signin/core/browser/signin_manager_base.cc
+++ b/components/signin/core/browser/signin_manager_base.cc
@@ -216,6 +216,10 @@ void SigninManagerBase::SetAuthenticatedAccountId(
account_id);
client_->GetPrefs()->SetString(prefs::kGoogleServicesLastUsername,
info.email);
+
+ // Commit authenticated account info immediately so that it does not get lost
+ // if Chrome crashes before the next commit interval.
+ client_->GetPrefs()->CommitPendingWrite();
}
bool SigninManagerBase::IsAuthenticated() const {

Powered by Google App Engine
This is Rietveld 408576698