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

Side by Side Diff: services/preferences/public/interfaces/preferences.mojom

Issue 2812863002: Pref service: Add a ScopedDictionaryPrefUpdate to track value changes. (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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 module prefs.mojom; 5 module prefs.mojom;
6 6
7 import "mojo/common/values.mojom"; 7 import "mojo/common/values.mojom";
8 import "services/preferences/public/interfaces/preferences_configuration.mojom"; 8 import "services/preferences/public/interfaces/preferences_configuration.mojom";
9 9
10 const string kServiceName = "preferences"; 10 const string kServiceName = "preferences";
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // be received. The client asserts that it is already connected to the 92 // be received. The client asserts that it is already connected to the
93 // |already_connected_types| pref stores through some other means, so the 93 // |already_connected_types| pref stores through some other means, so the
94 // Connect call will not connect to those. 94 // Connect call will not connect to those.
95 [Sync] 95 [Sync]
96 Connect(PrefRegistry pref_registry, 96 Connect(PrefRegistry pref_registry,
97 array<PrefStoreType> already_connected_types) => 97 array<PrefStoreType> already_connected_types) =>
98 (PersistentPrefStoreConnection connection, 98 (PersistentPrefStoreConnection connection,
99 map<PrefStoreType, PrefStoreConnection> connections); 99 map<PrefStoreType, PrefStoreConnection> connections);
100 }; 100 };
101 101
102 // An update to a subcomponent of a pref.
103 struct SubPrefUpdate {
104 // The path to the changed value within the pref.
105 array<string> path;
106 // The new value; a null |value| indicates a delete.
107 mojo.common.mojom.Value? value;
108 };
109
110 union PrefUpdateValue {
111 array<SubPrefUpdate> split_updates;
112 // An atomic update to the pref. A null |atomic_update| indicates a delete.
113 mojo.common.mojom.Value? atomic_update;
114 };
115
102 // An update to a pref. 116 // An update to a pref.
103 struct PrefUpdate { 117 struct PrefUpdate {
104 // The key of the pref being updated. 118 // The key of the pref being updated.
105 string key; 119 string key;
106 // The new value; a null |value| indicates a delete. 120 // The value update.
107 mojo.common.mojom.Value? value; 121 PrefUpdateValue value;
108 //|flags| is a bitmask of WritablePrefStore::PrefWriteFlags. 122 // |flags| is a bitmask of WritablePrefStore::PrefWriteFlags.
109 uint32 flags; 123 uint32 flags;
110 }; 124 };
111 125
112 // An interface providing mutation access to a PersistentPrefStore. 126 // An interface providing mutation access to a PersistentPrefStore.
113 interface PersistentPrefStore { 127 interface PersistentPrefStore {
114 // Sets the values for prefs. 128 // Sets the values for prefs.
115 SetValues(array<PrefUpdate> updates); 129 SetValues(array<PrefUpdate> updates);
116 130
117 // These mirror the C++ PersistentPrefStore methods. 131 // These mirror the C++ PersistentPrefStore methods.
118 CommitPendingWrite(); 132 CommitPendingWrite();
(...skipping 13 matching lines...) Expand all
132 // PrefRegistry::PrefRegistrationFlags and 146 // PrefRegistry::PrefRegistrationFlags and
133 // PrefRegistrySyncable::PrefRegistrationFlags. 147 // PrefRegistrySyncable::PrefRegistrationFlags.
134 uint32 flags; 148 uint32 flags;
135 }; 149 };
136 150
137 interface PrefServiceControl { 151 interface PrefServiceControl {
138 // Initializes the pref service. This must be called before the service can 152 // Initializes the pref service. This must be called before the service can
139 // be used. 153 // be used.
140 Init(PersistentPrefStoreConfiguration configuration); 154 Init(PersistentPrefStoreConfiguration configuration);
141 }; 155 };
OLDNEW
« 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