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

Unified Diff: services/preferences/pref_store_manager_impl.h

Issue 2791903003: Pref service: have Mash and Chrome connect to the right pref stores (Closed)
Patch Set: Don't require clients to specify the default store, but allow it 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
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 2a7822023e137ab06790d10394012658ba06e38e..936e86207ec0bee94fe2ba8fde38ebbcea287cef 100644
--- a/services/preferences/pref_store_manager_impl.h
+++ b/services/preferences/pref_store_manager_impl.h
@@ -50,16 +50,17 @@ class PrefStoreManagerImpl
~PrefStoreManagerImpl() override;
private:
- using PrefStorePtrs =
- std::unordered_map<PrefValueStore::PrefStoreType, mojom::PrefStorePtr>;
+ struct PendingConnect;
// mojom::PrefStoreRegistry:
void Register(PrefValueStore::PrefStoreType type,
mojom::PrefStorePtr pref_store_ptr) override;
// mojom::PrefStoreConnector:
- void Connect(mojom::PrefRegistryPtr pref_registry,
- const ConnectCallback& callback) override;
+ void Connect(
+ mojom::PrefRegistryPtr pref_registry,
+ const std::vector<PrefValueStore::PrefStoreType>& already_connected_types,
+ const ConnectCallback& callback) override;
// service_manager::InterfaceFactory<PrefStoreConnector>:
void Create(const service_manager::Identity& remote_identity,
@@ -89,21 +90,24 @@ class PrefStoreManagerImpl
void ProcessPendingConnects();
- void ConnectImpl(mojom::PrefRegistryPtr pref_registry,
- const ConnectCallback& callback);
+ void ConnectImpl(
+ mojom::PrefRegistryPtr pref_registry,
+ const std::vector<PrefValueStore::PrefStoreType>& already_connected_types,
+ const ConnectCallback& callback);
void OnPersistentPrefStoreReady();
- // PrefStores that need to register before replying to any Connect calls.
+ // PrefStores that need to register before replying to any Connect calls. This
+ // does not include the PersistentPrefStore, which is handled separately.
std::set<PrefValueStore::PrefStoreType> expected_pref_stores_;
// Registered pref stores.
- PrefStorePtrs pref_store_ptrs_;
+ std::unordered_map<PrefValueStore::PrefStoreType, mojom::PrefStorePtr>
+ pref_store_ptrs_;
// We hold on to the connection request callbacks until all expected
// PrefStores have registered.
- std::vector<std::pair<ConnectCallback, mojom::PrefRegistryPtr>>
- pending_connects_;
+ std::vector<PendingConnect> pending_connects_;
mojo::BindingSet<mojom::PrefStoreConnector> connector_bindings_;
mojo::BindingSet<mojom::PrefStoreRegistry> registry_bindings_;

Powered by Google App Engine
This is Rietveld 408576698