OLD | NEW |
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // connected to through the |PrefStoreConnector| interface. | 83 // connected to through the |PrefStoreConnector| interface. |
84 interface PrefStoreRegistry { | 84 interface PrefStoreRegistry { |
85 // Register a pref store. | 85 // Register a pref store. |
86 Register(PrefStoreType type, PrefStore pref_store); | 86 Register(PrefStoreType type, PrefStore pref_store); |
87 }; | 87 }; |
88 | 88 |
89 // Allows connections to pref stores registered with |PrefStoreRegistry|. | 89 // Allows connections to pref stores registered with |PrefStoreRegistry|. |
90 interface PrefStoreConnector { | 90 interface PrefStoreConnector { |
91 // Connect to all registered pref stores, retrieving the current values of all | 91 // Connect to all registered pref stores, retrieving the current values of all |
92 // prefs in each store and an |observer| interfaces through which updates can | 92 // prefs in each store and an |observer| interfaces through which updates can |
93 // be received. | 93 // be received. The client asserts that it is already connected to the |
| 94 // |already_connected_types| pref stores through some other means, so the |
| 95 // Connect call will not connect to those. |
94 [Sync] | 96 [Sync] |
95 Connect(PrefRegistry pref_registry) => | 97 Connect(PrefRegistry pref_registry, |
| 98 array<PrefStoreType> already_connected_types) => |
96 (PersistentPrefStoreConnection connection, | 99 (PersistentPrefStoreConnection connection, |
97 map<PrefStoreType, PrefStoreConnection> connections); | 100 map<PrefStoreType, PrefStoreConnection> connections); |
98 }; | 101 }; |
99 | 102 |
100 // An interface providing mutation access to a PersistentPrefStore. | 103 // An interface providing mutation access to a PersistentPrefStore. |
101 interface PersistentPrefStore { | 104 interface PersistentPrefStore { |
102 // Sets the value for |key|. A null |value| indicates a delete. |flags| is a | 105 // Sets the value for |key|. A null |value| indicates a delete. |flags| is a |
103 // bitmask of WritablePrefStore::PrefWriteFlags. | 106 // bitmask of WritablePrefStore::PrefWriteFlags. |
104 SetValue(string key, mojo.common.mojom.Value? value, uint32 flags); | 107 SetValue(string key, mojo.common.mojom.Value? value, uint32 flags); |
105 | 108 |
(...skipping 15 matching lines...) Expand all Loading... |
121 // PrefRegistry::PrefRegistrationFlags and | 124 // PrefRegistry::PrefRegistrationFlags and |
122 // PrefRegistrySyncable::PrefRegistrationFlags. | 125 // PrefRegistrySyncable::PrefRegistrationFlags. |
123 uint32 flags; | 126 uint32 flags; |
124 }; | 127 }; |
125 | 128 |
126 interface PrefServiceControl { | 129 interface PrefServiceControl { |
127 // Initializes the pref service. This must be called before the service can | 130 // Initializes the pref service. This must be called before the service can |
128 // be used. | 131 // be used. |
129 Init(PersistentPrefStoreConfiguration configuration); | 132 Init(PersistentPrefStoreConfiguration configuration); |
130 }; | 133 }; |
OLD | NEW |