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

Unified Diff: services/preferences/pref_store_manager_impl.h

Issue 2767743003: Pref service: Merge connectors and send a PrefRegistry in Connect(). (Closed)
Patch Set: Created 3 years, 9 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: services/preferences/pref_store_manager_impl.h
diff --git a/services/preferences/pref_store_manager_impl.h b/services/preferences/pref_store_manager_impl.h
index 049beb692c076f46db481ea3b0d1c6d30593f6af..1518ff9f469da49bc8dd5aa45f0832737fccb566 100644
--- a/services/preferences/pref_store_manager_impl.h
+++ b/services/preferences/pref_store_manager_impl.h
@@ -35,8 +35,6 @@ class PrefStoreManagerImpl
public mojom::PrefStoreConnector,
public service_manager::InterfaceFactory<mojom::PrefStoreConnector>,
public service_manager::InterfaceFactory<mojom::PrefStoreRegistry>,
- public service_manager::InterfaceFactory<
- mojom::PersistentPrefStoreConnector>,
public mojom::PrefServiceControl,
public service_manager::InterfaceFactory<mojom::PrefServiceControl>,
public service_manager::Service {
@@ -57,7 +55,8 @@ class PrefStoreManagerImpl
mojom::PrefStorePtr pref_store_ptr) override;
// mojom::PrefStoreConnector:
- void Connect(const ConnectCallback& callback) override;
+ void Connect(mojom::PrefRegistryPtr pref_registry,
+ const ConnectCallback& callback) override;
// service_manager::InterfaceFactory<PrefStoreConnector>:
void Create(const service_manager::Identity& remote_identity,
@@ -67,11 +66,6 @@ class PrefStoreManagerImpl
void Create(const service_manager::Identity& remote_identity,
prefs::mojom::PrefStoreRegistryRequest request) override;
- // service_manager::InterfaceFactory<PersistentPrefStoreConnector>:
- void Create(
- const service_manager::Identity& remote_identity,
- prefs::mojom::PersistentPrefStoreConnectorRequest request) override;
-
// service_manager::InterfaceFactory<PrefServiceControl>:
void Create(const service_manager::Identity& remote_identity,
prefs::mojom::PrefServiceControlRequest request) override;
@@ -90,6 +84,13 @@ class PrefStoreManagerImpl
// Have all the expected PrefStores connected?
bool AllConnected() const;
+ void ProcessQueuedConnects();
+
+ void ConnectImpl(mojom::PrefRegistryPtr pref_registry,
+ const ConnectCallback& callback);
+
+ void OnPersistentPrefStoreReady();
+
// PrefStores that need to register before replying to any Connect calls.
std::set<PrefValueStore::PrefStoreType> expected_pref_stores_;
@@ -99,20 +100,14 @@ class PrefStoreManagerImpl
mojo::BindingSet<mojom::PrefStoreConnector> connector_bindings_;
mojo::BindingSet<mojom::PrefStoreRegistry> registry_bindings_;
std::unique_ptr<PersistentPrefStoreImpl> persistent_pref_store_;
- mojo::BindingSet<mojom::PersistentPrefStoreConnector>
- persistent_pref_store_bindings_;
mojo::Binding<mojom::PrefServiceControl> init_binding_;
- // Requests made to connect to the service before it has been initialized.
- // These will be handled when initialization completes.
- std::vector<mojom::PersistentPrefStoreConnectorRequest>
- pending_persistent_pref_store_requests_;
-
scoped_refptr<base::SequencedWorkerPool> worker_pool_;
// We hold on to the connection request callbacks until all expected
// PrefStores have registered.
- std::vector<ConnectCallback> pending_callbacks_;
+ std::vector<std::pair<ConnectCallback, mojom::PrefRegistryPtr>>
+ pending_connects_;
DISALLOW_COPY_AND_ASSIGN(PrefStoreManagerImpl);
};
« no previous file with comments | « services/preferences/persistent_pref_store_impl_unittest.cc ('k') | services/preferences/pref_store_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698