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

Unified Diff: services/preferences/pref_store_manager_impl.cc

Issue 2795883002: Eliminate OnConnect usage (Closed)
Patch Set: . Created 3 years, 8 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 | « services/preferences/pref_store_manager_impl.h ('k') | services/service_manager/service_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/preferences/pref_store_manager_impl.cc
diff --git a/services/preferences/pref_store_manager_impl.cc b/services/preferences/pref_store_manager_impl.cc
index 027134cffba035f91a8f36659bc31ea887a40d0c..f418792f29eb5a62be557bc360c49c83b698eeb0 100644
--- a/services/preferences/pref_store_manager_impl.cc
+++ b/services/preferences/pref_store_manager_impl.cc
@@ -16,7 +16,7 @@
#include "services/preferences/persistent_pref_store_factory.h"
#include "services/preferences/persistent_pref_store_impl.h"
#include "services/preferences/public/cpp/pref_store_impl.h"
-#include "services/service_manager/public/cpp/interface_registry.h"
+#include "services/service_manager/public/cpp/service_info.h"
namespace prefs {
namespace {
@@ -124,6 +124,9 @@ PrefStoreManagerImpl::PrefStoreManagerImpl(
// The user store is not actually connected to in the implementation, but
// accessed directly.
expected_pref_stores_.erase(PrefValueStore::USER_STORE);
+ registry_.AddInterface<prefs::mojom::PrefStoreConnector>(this);
+ registry_.AddInterface<prefs::mojom::PrefStoreRegistry>(this);
+ registry_.AddInterface<prefs::mojom::PrefServiceControl>(this);
}
PrefStoreManagerImpl::~PrefStoreManagerImpl() = default;
@@ -208,13 +211,12 @@ void PrefStoreManagerImpl::Init(
void PrefStoreManagerImpl::OnStart() {}
-bool PrefStoreManagerImpl::OnConnect(
- const service_manager::ServiceInfo& remote_info,
- service_manager::InterfaceRegistry* registry) {
- registry->AddInterface<prefs::mojom::PrefStoreConnector>(this);
- registry->AddInterface<prefs::mojom::PrefStoreRegistry>(this);
- registry->AddInterface<prefs::mojom::PrefServiceControl>(this);
- return true;
+void PrefStoreManagerImpl::OnBindInterface(
+ const service_manager::ServiceInfo& source_info,
+ const std::string& interface_name,
+ mojo::ScopedMessagePipeHandle interface_pipe) {
+ registry_.BindInterface(source_info.identity, interface_name,
+ std::move(interface_pipe));
}
void PrefStoreManagerImpl::OnPrefStoreDisconnect(
« no previous file with comments | « services/preferences/pref_store_manager_impl.h ('k') | services/service_manager/service_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698