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

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

Issue 2710733002: Fix PreferenceConnectionManagerTeardown (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/prefs/preferences_connection_manager.h ('k') | no next file » | 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 f87f1e8657628d4983e1db2beef36050e110fa95..c2ca921465903a24a17f5e3ed7acca671b255943 100644
--- a/chrome/browser/prefs/preferences_connection_manager.cc
+++ b/chrome/browser/prefs/preferences_connection_manager.cc
@@ -43,26 +43,9 @@ PreferencesConnectionManager::PreferencesConnectionManager() {}
PreferencesConnectionManager::~PreferencesConnectionManager() {}
-void PreferencesConnectionManager::OnConnectionError(
- mojo::StrongBindingPtr<prefs::mojom::PreferencesService> binding) {
- if (!binding)
- return;
- for (auto it = manager_bindings_.begin(); it != manager_bindings_.end();
- ++it) {
- if (it->get() == binding.get()) {
- manager_bindings_.erase(it);
- return;
- }
- }
-}
-
void PreferencesConnectionManager::OnProfileDestroyed() {
- for (auto& it : manager_bindings_) {
- // Shutdown any PreferenceManager that is still alive.
- if (it)
- it->Close();
- }
-
+ // Shutdown any PreferenceService that is still alive.
+ manager_bindings_.CloseAllBindings();
profile_shutdown_notification_.reset();
}
@@ -74,16 +57,10 @@ void PreferencesConnectionManager::Create(
if (!g_browser_process->profile_manager()->GetNumberOfProfiles())
return;
- Profile* profile = ProfileManager::GetActiveUserProfile();
- mojo::StrongBindingPtr<prefs::mojom::PreferencesService> binding =
- mojo::MakeStrongBinding(
- base::MakeUnique<PreferencesService>(std::move(client), profile),
- std::move(service));
- // Copying the base::WeakPtr for future deletion.
- binding->set_connection_error_handler(
- base::Bind(&PreferencesConnectionManager::OnConnectionError,
- base::Unretained(this), binding));
- manager_bindings_.push_back(std::move(binding));
+ manager_bindings_.AddBinding(
+ base::MakeUnique<PreferencesService>(
+ std::move(client), ProfileManager::GetActiveUserProfile()),
+ std::move(service));
}
void PreferencesConnectionManager::Create(
@@ -101,13 +78,6 @@ void PreferencesConnectionManager::Create(
}
}
-void PreferencesConnectionManager::OnStart() {
- // Certain tests have no profiles to connect to, and static initializers
- // which block the creation of test profiles.
- if (!g_browser_process->profile_manager()->GetNumberOfProfiles())
- return;
-}
jonross 2017/02/21 15:55:54 The functionality that was here was moved to Creat
-
bool PreferencesConnectionManager::OnConnect(
const service_manager::ServiceInfo& remote_info,
service_manager::InterfaceRegistry* registry) {
« no previous file with comments | « chrome/browser/prefs/preferences_connection_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698