Chromium Code Reviews| Index: content/common/leveldb_wrapper.mojom |
| diff --git a/content/common/leveldb_wrapper.mojom b/content/common/leveldb_wrapper.mojom |
| index 045b858acb36929e53771364e88da2ab46ab2194..bb9a9d9474cd0dcb134a941440229a5c2ac57944 100644 |
| --- a/content/common/leveldb_wrapper.mojom |
| +++ b/content/common/leveldb_wrapper.mojom |
| @@ -6,6 +6,18 @@ module content; |
| import "components/leveldb/public/interfaces/leveldb.mojom"; |
| +// Gives information about changes to a LevelDB database. |
| +// The reason this is a parameter to DeleteAll and GetAll above, instead of |
|
dcheng
2016/03/02 18:40:23
Below?
jam
2016/03/02 19:08:19
Done.
|
| +// being specified when opening a LevelDBWrapper, is to avoid the client getting |
| +// callbacks for changes that have already been applied to its database that |
| +// it's fetching via GetAll or it's clearing via DeleteAll. |
| +interface LevelDBObserver { |
| + KeyChanged(array<uint8> key, array<uint8> new_value, array<uint8> old_value, |
| + string source); |
| + KeyDeleted(array<uint8> key, string source); |
| + AllDeleted(string source); |
| +}; |
| + |
| struct KeyValue { |
| array<uint8> key; |
| array<uint8> value; |
| @@ -24,19 +36,14 @@ interface LevelDBWrapper { |
| Delete(array<uint8> key, string source) => (leveldb.DatabaseError status); |
| // Removes all the entries. |
| - DeleteAll(string source) => (leveldb.DatabaseError status); |
| + DeleteAll(LevelDBObserver observer, string source) |
| + => (leveldb.DatabaseError status); |
| // Returns the value of the given key. |
| Get(array<uint8> key) => (leveldb.DatabaseError status, array<uint8> value); |
| // Only used with small databases. Returns all key/value pairs. |
| - GetAll() => (leveldb.DatabaseError status, array<KeyValue> data); |
| -}; |
| - |
| -// Gives information about changes to a LevelDB database. |
| -interface LevelDBObserver { |
| - KeyChanged(array<uint8> key, array<uint8> new_value, array<uint8> old_value, |
| - string source); |
| - KeyDeleted(array<uint8> key, string source); |
| - AllDeleted(string source); |
| + [Sync] |
| + GetAll(LevelDBObserver observer) |
| + => (leveldb.DatabaseError status, array<KeyValue> data); |
| }; |