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; |
} |