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

Unified Diff: services/preferences/pref_store_manager_impl.h

Issue 2777483002: Pref service: Add initial support for pref registration. (Closed)
Patch Set: rebase 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 9a6bf2dae3fe5b039cf12b1588fa8f309021a24b..2a7822023e137ab06790d10394012658ba06e38e 100644
--- a/services/preferences/pref_store_manager_impl.h
+++ b/services/preferences/pref_store_manager_impl.h
@@ -19,12 +19,15 @@
#include "services/service_manager/public/cpp/interface_factory.h"
#include "services/service_manager/public/cpp/service.h"
+class DefaultPrefStore;
+
namespace base {
class SequencedWorkerPool;
}
namespace prefs {
class PersistentPrefStoreImpl;
+class PrefStoreImpl;
// This class mediates the connection of clients who wants to read preferences
// and the pref stores that store those preferences. Pref stores use the
@@ -55,7 +58,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,
@@ -85,7 +89,8 @@ class PrefStoreManagerImpl
void ProcessPendingConnects();
- void ConnectImpl(const ConnectCallback& callback);
+ void ConnectImpl(mojom::PrefRegistryPtr pref_registry,
+ const ConnectCallback& callback);
void OnPersistentPrefStoreReady();
@@ -97,14 +102,18 @@ class PrefStoreManagerImpl
// 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_;
mojo::BindingSet<mojom::PrefStoreConnector> connector_bindings_;
mojo::BindingSet<mojom::PrefStoreRegistry> registry_bindings_;
std::unique_ptr<PersistentPrefStoreImpl> persistent_pref_store_;
mojo::Binding<mojom::PrefServiceControl> init_binding_;
- scoped_refptr<base::SequencedWorkerPool> worker_pool_;
+ const scoped_refptr<DefaultPrefStore> defaults_;
+ const std::unique_ptr<PrefStoreImpl> defaults_wrapper_;
+
+ const scoped_refptr<base::SequencedWorkerPool> worker_pool_;
DISALLOW_COPY_AND_ASSIGN(PrefStoreManagerImpl);
};
« no previous file with comments | « services/preferences/pref_service_factory_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