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

Unified Diff: services/preferences/public/interfaces/preferences.mojom

Issue 2791893002: Pref service: Batch pref updates. (Closed)
Patch Set: rebase 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
« no previous file with comments | « services/preferences/public/cpp/tests/pref_store_client_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/preferences/public/interfaces/preferences.mojom
diff --git a/services/preferences/public/interfaces/preferences.mojom b/services/preferences/public/interfaces/preferences.mojom
index 99c0d80dfca81df4732c9fd4a2f3225f5ad55c96..47a79dc538663c83bcbf39c83e5ee82d1f3f0a2c 100644
--- a/services/preferences/public/interfaces/preferences.mojom
+++ b/services/preferences/public/interfaces/preferences.mojom
@@ -25,9 +25,8 @@ enum PrefStoreType {
// Allows observing changes to prefs stored in a |PrefStore|.
interface PrefStoreObserver {
- // The preference with the given |key| has changed. If |value| is null then
- // the preference was deleted.
- OnPrefChanged(string key, mojo.common.mojom.Value? value);
+ // Preferences have been changed.
+ OnPrefsChanged(array<PrefUpdate> updates);
// The PrefStore has been initialized (asynchronously).
OnInitializationCompleted(bool succeeded);
@@ -100,11 +99,20 @@ interface PrefStoreConnector {
map<PrefStoreType, PrefStoreConnection> connections);
};
+// An update to a pref.
+struct PrefUpdate {
+ // The key of the pref being updated.
+ string key;
+ // The new value; a null |value| indicates a delete.
+ mojo.common.mojom.Value? value;
+ //|flags| is a bitmask of WritablePrefStore::PrefWriteFlags.
+ uint32 flags;
+};
+
// An interface providing mutation access to a PersistentPrefStore.
interface PersistentPrefStore {
- // Sets the value for |key|. A null |value| indicates a delete. |flags| is a
- // bitmask of WritablePrefStore::PrefWriteFlags.
- SetValue(string key, mojo.common.mojom.Value? value, uint32 flags);
+ // Sets the values for prefs.
+ SetValues(array<PrefUpdate> updates);
// These mirror the C++ PersistentPrefStore methods.
CommitPendingWrite();
« no previous file with comments | « services/preferences/public/cpp/tests/pref_store_client_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698