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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 const user_manager::User* const user = 606 const user_manager::User* const user =
607 ProfileHelper::Get()->GetUserByProfile(profile); 607 ProfileHelper::Get()->GetUserByProfile(profile);
608 UserSessionManager::GetInstance()->RespectLocalePreference( 608 UserSessionManager::GetInstance()->RespectLocalePreference(
609 profile, user, callback); 609 profile, user, callback);
610 } 610 }
611 611
612 void ChromeBrowserMainPartsChromeos::PostProfileInit() { 612 void ChromeBrowserMainPartsChromeos::PostProfileInit() {
613 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() 613 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun()
614 // -- just after CreateProfile(). 614 // -- just after CreateProfile().
615 615
616 // Force loading of signin profile if it was not loaded before. It is possible 616 if (chromeos::ProfileHelper::IsSigninProfile(profile())) {
617 // when we are restoring session or skipping login screen for some other 617 // Flush signin profile if it is just created (new device or after recovery)
618 // reason. 618 // to ensure it is correctly persisted.
619 if (!chromeos::ProfileHelper::IsSigninProfile(profile())) 619 if (profile()->IsNewProfile())
620 ProfileHelper::Get()->FlushProfile(profile());
621 } else {
622 // Force loading of signin profile if it was not loaded before. It is
623 // possible when we are restoring session or skipping login screen for some
624 // other reason.
620 chromeos::ProfileHelper::GetSigninProfile(); 625 chromeos::ProfileHelper::GetSigninProfile();
626 }
621 627
622 BootTimesRecorder::Get()->OnChromeProcessStart(); 628 BootTimesRecorder::Get()->OnChromeProcessStart();
623 629
624 // Initialize the network portal detector for Chrome OS. The network 630 // Initialize the network portal detector for Chrome OS. The network
625 // portal detector starts to listen for notifications from 631 // portal detector starts to listen for notifications from
626 // NetworkStateHandler and initiates captive portal detection for 632 // NetworkStateHandler and initiates captive portal detection for
627 // active networks. Should be called before call to CreateSessionManager, 633 // active networks. Should be called before call to CreateSessionManager,
628 // because it depends on NetworkPortalDetector. 634 // because it depends on NetworkPortalDetector.
629 InitializeNetworkPortalDetector(); 635 InitializeNetworkPortalDetector();
630 { 636 {
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 // Destroy DBus services immediately after threads are stopped. 863 // Destroy DBus services immediately after threads are stopped.
858 dbus_services_.reset(); 864 dbus_services_.reset();
859 865
860 ChromeBrowserMainPartsLinux::PostDestroyThreads(); 866 ChromeBrowserMainPartsLinux::PostDestroyThreads();
861 867
862 // Destroy DeviceSettingsService after g_browser_process. 868 // Destroy DeviceSettingsService after g_browser_process.
863 DeviceSettingsService::Shutdown(); 869 DeviceSettingsService::Shutdown();
864 } 870 }
865 871
866 } // namespace chromeos 872 } // namespace chromeos
OLDNEW
« 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