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

Unified Diff: components/user_manager/user_manager_base.cc

Issue 1815853002: cros: Flush profile files at critical moments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nits and create test files to fix trybots Created 4 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
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/user_manager/user_manager_base.cc
diff --git a/components/user_manager/user_manager_base.cc b/components/user_manager/user_manager_base.cc
index c45efefd6ec6081ed70b76ba8cd58a8fa60cc1f5..f6f5cf8009c6bfcb3465416ef7355cb8ec77f16f 100644
--- a/components/user_manager/user_manager_base.cc
+++ b/components/user_manager/user_manager_base.cc
@@ -256,10 +256,7 @@ void UserManagerBase::SessionStarted() {
session_manager::SessionManager::Get()->SetSessionState(
session_manager::SESSION_STATE_ACTIVE);
- if (IsCurrentUserNew()) {
- // Make sure that the new user's data is persisted to Local State.
- GetLocalState()->CommitPendingWrite();
- }
+ GetLocalState()->CommitPendingWrite();
}
void UserManagerBase::RemoveUser(const AccountId& account_id,
@@ -368,11 +365,14 @@ void UserManagerBase::SaveUserOAuthStatus(
if (IsUserNonCryptohomeDataEphemeral(account_id))
return;
- DictionaryPrefUpdate oauth_status_update(GetLocalState(),
- kUserOAuthTokenStatus);
- oauth_status_update->SetWithoutPathExpansion(
- account_id.GetUserEmail(),
- new base::FundamentalValue(static_cast<int>(oauth_token_status)));
+ {
+ DictionaryPrefUpdate oauth_status_update(GetLocalState(),
+ kUserOAuthTokenStatus);
+ oauth_status_update->SetWithoutPathExpansion(
+ account_id.GetUserEmail(),
+ new base::FundamentalValue(static_cast<int>(oauth_token_status)));
+ }
+ GetLocalState()->CommitPendingWrite();
}
void UserManagerBase::SaveForceOnlineSignin(const AccountId& account_id,
@@ -384,10 +384,13 @@ void UserManagerBase::SaveForceOnlineSignin(const AccountId& account_id,
if (IsUserNonCryptohomeDataEphemeral(account_id))
return;
- DictionaryPrefUpdate force_online_update(GetLocalState(),
- kUserForceOnlineSignin);
- force_online_update->SetBooleanWithoutPathExpansion(account_id.GetUserEmail(),
- force_online_signin);
+ {
+ DictionaryPrefUpdate force_online_update(GetLocalState(),
+ kUserForceOnlineSignin);
+ force_online_update->SetBooleanWithoutPathExpansion(
+ account_id.GetUserEmail(), force_online_signin);
+ }
+ GetLocalState()->CommitPendingWrite();
}
void UserManagerBase::SaveUserDisplayName(const AccountId& account_id,
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698