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

Unified Diff: services/preferences/public/cpp/pref_store_client.h

Issue 2743563003: Pref service: add persistent pref store frontend and backend. (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/public/cpp/pref_store_client.h
diff --git a/services/preferences/public/cpp/pref_store_client.h b/services/preferences/public/cpp/pref_store_client.h
index adad0c2b189f58a7b27e025589ba93ebface6ca7..b4d8245110074c60ea26ad7a0fc26fe3a77758c4 100644
--- a/services/preferences/public/cpp/pref_store_client.h
+++ b/services/preferences/public/cpp/pref_store_client.h
@@ -5,15 +5,9 @@
#ifndef SERVICES_PREFERENCES_PUBLIC_CPP_PREF_STORE_CLIENT_H_
#define SERVICES_PREFERENCES_PUBLIC_CPP_PREF_STORE_CLIENT_H_
-#include <string>
-
#include "base/macros.h"
-#include "base/observer_list.h"
-#include "base/values.h"
#include "components/prefs/pref_store.h"
-#include "components/prefs/pref_value_map.h"
-#include "mojo/public/cpp/bindings/binding.h"
-#include "services/preferences/public/cpp/pref_store_manager_impl.h"
+#include "services/preferences/public/cpp/pref_store_client_mixin.h"
#include "services/preferences/public/interfaces/preferences.mojom.h"
namespace prefs {
@@ -25,39 +19,13 @@ namespace prefs {
//
// PrefStoreClient provides synchronous access to the preferences stored by the
// backing store by caching them locally.
-class PrefStoreClient : public ::PrefStore, public mojom::PrefStoreObserver {
+class PrefStoreClient : public PrefStoreClientMixin<::PrefStore> {
public:
explicit PrefStoreClient(mojom::PrefStoreConnectionPtr connection);
- // PrefStore:
- void AddObserver(PrefStore::Observer* observer) override;
- void RemoveObserver(PrefStore::Observer* observer) override;
- bool HasObservers() const override;
- bool IsInitializationComplete() const override;
- bool GetValue(const std::string& key,
- const base::Value** result) const override;
- std::unique_ptr<base::DictionaryValue> GetValues() const override;
-
private:
- friend class PrefStoreClientTest;
-
~PrefStoreClient() override;
- // prefs::mojom::PreferenceObserver:
- void OnPrefChanged(const std::string& key,
- std::unique_ptr<base::Value> value) override;
- void OnInitializationCompleted(bool succeeded) override;
-
- // Cached preferences.
- std::unique_ptr<base::DictionaryValue> cached_prefs_;
-
- base::ObserverList<PrefStore::Observer, true> observers_;
-
- // Has the PrefStore we're observing been initialized?
- bool initialized_;
-
- mojo::Binding<mojom::PrefStoreObserver> observer_binding_;
-
DISALLOW_COPY_AND_ASSIGN(PrefStoreClient);
};
« no previous file with comments | « services/preferences/public/cpp/persistent_pref_store_client.cc ('k') | services/preferences/public/cpp/pref_store_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698