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

Unified Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.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
Index: chrome/browser/chromeos/chrome_browser_main_chromeos.cc
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
index cd13f690ef31858c58a20299d20584c6d30e90f9..1b571b8a48915641564d6e6e86d87584daad59a5 100644
--- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
+++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -613,11 +613,17 @@ void ChromeBrowserMainPartsChromeos::PostProfileInit() {
// -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun()
// -- just after CreateProfile().
- // Force loading of signin profile if it was not loaded before. It is possible
- // when we are restoring session or skipping login screen for some other
- // reason.
- if (!chromeos::ProfileHelper::IsSigninProfile(profile()))
+ if (chromeos::ProfileHelper::IsSigninProfile(profile())) {
+ // Flush signin profile if it is just created (new device or after recovery)
+ // to ensure it is correctly persisted.
+ if (profile()->IsNewProfile())
+ ProfileHelper::Get()->FlushProfile(profile());
+ } else {
+ // Force loading of signin profile if it was not loaded before. It is
+ // possible when we are restoring session or skipping login screen for some
+ // other reason.
chromeos::ProfileHelper::GetSigninProfile();
+ }
BootTimesRecorder::Get()->OnChromeProcessStart();
« no previous file with comments | « chrome/browser/chromeos/base/file_flusher_unittest.cc ('k') | chrome/browser/chromeos/login/session/user_session_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698