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

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
« no previous file with comments | « chrome/browser/chromeos/chrome_interface_factory.cc ('k') | chrome/browser/ui/ash/ash_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f87f1e8657628d4983e1db2beef36050e110fa95 100644
--- a/chrome/browser/prefs/preferences_connection_manager.cc
+++ b/chrome/browser/prefs/preferences_connection_manager.cc
@@ -90,6 +90,15 @@ void PreferencesConnectionManager::Create(
const service_manager::Identity& remote_identity,
prefs::mojom::PreferencesServiceFactoryRequest request) {
factory_bindings_.AddBinding(this, std::move(request));
+
+ if (!profile_shutdown_notification_) {
+ profile_shutdown_notification_ =
+ ShutdownNotifierFactory::GetInstance()
+ ->Get(ProfileManager::GetActiveUserProfile())
+ ->Subscribe(
+ base::Bind(&PreferencesConnectionManager::OnProfileDestroyed,
+ base::Unretained(this)));
+ }
}
void PreferencesConnectionManager::OnStart() {
@@ -97,13 +106,6 @@ 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(
« no previous file with comments | « chrome/browser/chromeos/chrome_interface_factory.cc ('k') | chrome/browser/ui/ash/ash_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698