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

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

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 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 8
9 const string kServiceName = "preferences"; 9 const string kServiceName = "preferences";
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 Register(PrefStoreType type, PrefStore pref_store); 84 Register(PrefStoreType type, PrefStore pref_store);
85 }; 85 };
86 86
87 // Allows connections to pref stores registered with |PrefStoreRegistry|. 87 // Allows connections to pref stores registered with |PrefStoreRegistry|.
88 interface PrefStoreConnector { 88 interface PrefStoreConnector {
89 // Connect to all registered pref stores, retrieving the current values of all 89 // Connect to all registered pref stores, retrieving the current values of all
90 // prefs in each store and an |observer| interfaces through which updates can 90 // prefs in each store and an |observer| interfaces through which updates can
91 // be received. 91 // be received.
92 Connect() => (map<PrefStoreType, PrefStoreConnection> connections); 92 Connect() => (map<PrefStoreType, PrefStoreConnection> connections);
93 }; 93 };
94
95 // An interface providing mutation access to a PersistentPrefStore.
96 interface PersistentPrefStore {
97 // Sets the value for |key|. A null |value| indicates a delete. |flags| is a
98 // bitmask of WritablePrefStore::PrefWriteFlags.
99 SetValue(string key, mojo.common.mojom.Value? value, uint32 flags);
100
101 // These mirror the C++ PersistentPrefStore methods.
102 CommitPendingWrite();
103 SchedulePendingLossyWrites();
104 ClearMutableValues();
105 };
106
107 // A connector that provides a way to connect to a PersistentPrefStore.
108 interface PersistentPrefStoreConnector {
109 enum ReadError {
110 NONE = 0,
111 JSON_PARSE = 1,
112 JSON_TYPE = 2,
113 ACCESS_DENIED = 3,
114 FILE_OTHER = 4,
115 FILE_LOCKED = 5,
116 NO_FILE = 6,
117 JSON_REPEAT = 7,
118 // OTHER = 8, // Deprecated.
119 FILE_NOT_SPECIFIED = 9,
120 ASYNCHRONOUS_TASK_INCOMPLETE = 10,
121 };
122
123 // Connects to the PersistentPrefStore.
124 // A null |preferences| indicates that the pref service failed to load prefs.
125 // |pref_store| provides write access; |observer| is used to observe writes
126 // instigated by other clients.
127 [Sync]
128 Connect() => (
129 ReadError read_error,
130 bool read_only,
131 mojo.common.mojom.DictionaryValue? preferences,
132 PersistentPrefStore? pref_store,
133 PrefStoreObserver&? observer);
134 };
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