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

Unified Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 14200028: Make CrosSettings and DeviceSettingsService non Lazy instances (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix LoginUtilsTest Created 7 years, 8 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 06cf2830af74bf4d26f52d2f478335b84d0858a7..905360ba330ae8e97182aa5997ab3368a6faac89 100644
--- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
+++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -322,8 +322,10 @@ class DBusServices {
}
// Initialize the device settings service so that we'll take actions per
- // signals sent from the session manager.
- DeviceSettingsService::Get()->Initialize(
+ // signals sent from the session manager. This needs to happen before
+ // g_browser_process initializes local_state().
+ DeviceSettingsService::Initialize();
+ DeviceSettingsService::Get()->InitializeSessionManager(
DBusThreadManager::Get()->GetSessionManagerClient(),
OwnerKeyUtil::Create());
chromeos::ConnectivityStateHelper::Initialize();
@@ -729,8 +731,10 @@ void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() {
NetworkPortalDetector::GetInstance()->Shutdown();
}
- // Tell DeviceSettingsService to stop talking to session_manager.
- DeviceSettingsService::Get()->Shutdown();
+ // Tell DeviceSettingsService to stop talking to session_manager. Do not
+ // shutdown DeviceSettingsService yet, it is still accessed by
+ // g_browser_process.
Mattias Nissler (ping if slow) 2013/04/16 16:09:51 How would g_browser_process access DeviceSettingsS
stevenjb 2013/04/16 16:49:43 The relationship is through BrowserPolicyConnector
+ DeviceSettingsService::Get()->ShutdownSessionManager();
// We should remove observers attached to D-Bus clients before
// DBusThreadManager is shut down.
@@ -783,6 +787,12 @@ void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() {
ChromeBrowserMainPartsLinux::PostMainMessageLoopRun();
}
+void ChromeBrowserMainPartsChromeos::PostDestroyThreads() {
+ ChromeBrowserMainPartsLinux::PostDestroyThreads();
+ // Destroy DeviceSettingsService after g_browser_process.
Mattias Nissler (ping if slow) 2013/04/16 16:09:51 Isn't the actual dependency CrosSettings here?
stevenjb 2013/04/16 16:49:43 Same as above, also modified comment.
+ DeviceSettingsService::Shutdown();
+}
+
void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() {
SetupLowMemoryHeadroomFieldTrial();
SetupZramFieldTrial();

Powered by Google App Engine
This is Rietveld 408576698