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

Unified Diff: chrome/browser/prefs/preferences_connection_manager.cc

Issue 2695803004: Make browser process a singleton service (Closed)
Patch Set: . Created 3 years, 10 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/prefs/preferences_connection_manager.cc
diff --git a/chrome/browser/prefs/preferences_connection_manager.cc b/chrome/browser/prefs/preferences_connection_manager.cc
index 32d1e9cb4b51fa37882a1055d6a3c562b2d5f9ec..53d78c00150985230333500d38ca9937daf7fc9e 100644
--- a/chrome/browser/prefs/preferences_connection_manager.cc
+++ b/chrome/browser/prefs/preferences_connection_manager.cc
@@ -97,18 +97,19 @@ void PreferencesConnectionManager::OnStart() {
// which block the creation of test profiles.
if (!g_browser_process->profile_manager()->GetNumberOfProfiles())
return;
-
- profile_shutdown_notification_ =
- ShutdownNotifierFactory::GetInstance()
- ->Get(ProfileManager::GetActiveUserProfile())
- ->Subscribe(
- base::Bind(&PreferencesConnectionManager::OnProfileDestroyed,
- base::Unretained(this)));
}
bool PreferencesConnectionManager::OnConnect(
const service_manager::ServiceInfo& remote_info,
service_manager::InterfaceRegistry* registry) {
+ if (!profile_shutdown_notification_) {
+ profile_shutdown_notification_ =
+ ShutdownNotifierFactory::GetInstance()
+ ->Get(ProfileManager::GetActiveUserProfile())
+ ->Subscribe(
+ base::Bind(&PreferencesConnectionManager::OnProfileDestroyed,
+ base::Unretained(this)));
+ }
registry->AddInterface<prefs::mojom::PreferencesServiceFactory>(this);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698