Chromium Code Reviews| 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(); |