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

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

Issue 2644893003: Unify Preferences Mojom Naming to PreferencesService (Closed)
Patch Set: / Created 3 years, 11 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/public/cpp/BUILD.gn ('k') | services/preferences/public/cpp/pref_client_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/preferences/public/cpp/pref_client_store.h
diff --git a/services/preferences/public/cpp/pref_observer_store.h b/services/preferences/public/cpp/pref_client_store.h
similarity index 63%
rename from services/preferences/public/cpp/pref_observer_store.h
rename to services/preferences/public/cpp/pref_client_store.h
index 67e3f8368360fb5e9340f37107b03a752dd8fc79..c2ac032366c69bffd18cb461a06891f47e0bc272 100644
--- a/services/preferences/public/cpp/pref_observer_store.h
+++ b/services/preferences/public/cpp/pref_client_store.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef SERVICES_PREFERENCES_PUBLIC_CPP_PREFS_OBSERVER_STORE_H_
-#define SERVICES_PREFERENCES_PUBLIC_CPP_PREFS_OBSERVER_STORE_H_
+#ifndef SERVICES_PREFERENCES_PUBLIC_CPP_PREFS_CLIENT_STORE_H_
+#define SERVICES_PREFERENCES_PUBLIC_CPP_PREFS_CLIENT_STORE_H_
#include <set>
@@ -14,26 +14,26 @@
namespace preferences {
-class PrefObserverStoreTest;
+class PrefClientStoreTest;
// An implementation of PrefStore which uses prefs::mojom::PreferenceManager as
// the backing of the preferences.
//
-// PrefObserverStore caches the values locally to provide synchronous access.
+// PrefClientStore caches the values locally to provide synchronous access.
// The cache is empty until the first notification of OnPreferencesChanged is
// received from the prefs::mojom::PreferenceManager. Upon recieving an initial
// OnPreferencesChanged initialization will be considered as completed, and any
// PrefStore::Observer will be notified of OnInitializationCompleted.
//
// Currently this does not support RemoveValue.
-class PrefObserverStore : public ValueMapPrefStore,
- public prefs::mojom::PreferencesObserver {
+class PrefClientStore : public ValueMapPrefStore,
+ public prefs::mojom::PreferencesServiceClient {
public:
- explicit PrefObserverStore(
- prefs::mojom::PreferencesFactoryPtr pref_factory_ptr);
+ explicit PrefClientStore(
+ prefs::mojom::PreferencesServiceFactoryPtr pref_factory_ptr);
- // Adds a set of |keys| which PrefObserverStore will handle. Begins listening
- // for changes to these from |prefs_manager_|.
+ // Adds a set of |keys| which PrefClientStore will handle. Begins listening
+ // for changes to these from |prefs_service_|.
void Subscribe(const std::set<std::string>& keys);
// PrefStore:
@@ -53,30 +53,30 @@ class PrefObserverStore : public ValueMapPrefStore,
protected:
// base::RefCounted<PrefStore>:
- ~PrefObserverStore() override;
+ ~PrefClientStore() override;
private:
- friend class PrefObserverStoreTest;
+ friend class PrefClientStoreTest;
- // Notifies |prefs_manager_| of the change in |key| - |value| pair.
+ // Notifies |prefs_service_| of the change in |key| - |value| pair.
void SetValueOnPreferenceManager(const std::string& key,
- base::Value const & value);
+ base::Value const& value);
- // prefs::mojom::PreferenceObserver:
+ // prefs::mojom::PreferencesServiceClient:
void OnPreferencesChanged(
std::unique_ptr<base::DictionaryValue> preferences) override;
- mojo::Binding<prefs::mojom::PreferencesObserver> prefs_binding_;
- prefs::mojom::PreferencesFactoryPtr pref_factory_ptr_;
- prefs::mojom::PreferencesManagerPtr prefs_manager_ptr_;
+ mojo::Binding<prefs::mojom::PreferencesServiceClient> prefs_binding_;
+ prefs::mojom::PreferencesServiceFactoryPtr pref_factory_ptr_;
+ prefs::mojom::PreferencesServicePtr prefs_service_ptr_;
std::set<std::string> keys_;
// True upon the first OnPreferencesChanged received after Init.
bool initialized_;
- DISALLOW_COPY_AND_ASSIGN(PrefObserverStore);
+ DISALLOW_COPY_AND_ASSIGN(PrefClientStore);
};
} // namespace preferences
-#endif // SERVICES_PREFERENCES_PUBLIC_CPP_PREFS_OBSERVER_STORE_H_
+#endif // SERVICES_PREFERENCES_PUBLIC_CPP_PREFS_CLIENT_STORE_H_
« no previous file with comments | « services/preferences/public/cpp/BUILD.gn ('k') | services/preferences/public/cpp/pref_client_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698