Chromium Code Reviews| Index: content/common/leveldb_wrapper.mojom |
| diff --git a/content/common/leveldb_wrapper.mojom b/content/common/leveldb_wrapper.mojom |
| index b3949ca855d57ca8a9f6f0cb783f3e4150c6b878..1ffc71b8365cb7e70c377b4b15f18d38d8eab808 100644 |
| --- a/content/common/leveldb_wrapper.mojom |
| +++ b/content/common/leveldb_wrapper.mojom |
| @@ -16,10 +16,12 @@ import "components/leveldb/public/interfaces/leveldb.mojom"; |
| // Note that observer methods are called before the callbacks for the |
| // LevelDBWrapper methods are run. |
| interface LevelDBObserver { |
| + KeyAdded(array<uint8> key, array<uint8> value, string source); |
| KeyChanged(array<uint8> key, array<uint8> new_value, array<uint8> old_value, |
| string source); |
| KeyDeleted(array<uint8> key, array<uint8> old_value, string source); |
| AllDeleted(string source); |
| + GetAllComplete(uint64 request_id); |
|
jam
2016/03/30 17:15:16
for consistency with the other methods, GetAll sho
michaeln
2016/03/30 21:57:01
Done
The magic cookie value for the localstorage
|
| }; |
| struct KeyValue { |
| @@ -30,24 +32,21 @@ struct KeyValue { |
| // A wrapper around leveldb that supports giving notifications when values |
| // change. |
| interface LevelDBWrapper { |
| + AddObserver(LevelDBObserver observer); |
|
jam
2016/03/30 17:15:16
how about combining this with StoragePartitionServ
michaeln
2016/03/30 21:57:01
Done.
|
| + |
| // Sets the database entry for |key| to |value|. Returns OK on success. |
| - Put(array<uint8> key, array<uint8> value, string source) |
| - => (leveldb.DatabaseError status); |
| + Put(array<uint8> key, array<uint8> value, string source) => (bool success); |
| // Remove the database entry (if any) for |key|. Returns OK on success, and a |
| // non-OK status on error. It is not an error if |key| did not exist in the |
| // database. |
| - Delete(array<uint8> key, string source) => (leveldb.DatabaseError status); |
| + Delete(array<uint8> key, string source) => (bool success); |
| // Removes all the entries. |
| - DeleteAll(LevelDBObserver observer, string source) |
| - => (leveldb.DatabaseError status); |
| - |
| - // Returns the value of the |key|. |
| - Get(array<uint8> key) => (leveldb.DatabaseError status, array<uint8> value); |
| + DeleteAll(string source) => (bool success); |
| // Only used with small databases. Returns all key/value pairs. |
| [Sync] |
| - GetAll(LevelDBObserver observer) |
| + GetAll(uint64 reqeust_id) |
| => (leveldb.DatabaseError status, array<KeyValue> data); |
| }; |