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

Unified Diff: content/common/leveldb_wrapper.mojom

Issue 1837883003: Some fleshing out the mojo based localstorage implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: long lived observer Created 4 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 side-by-side diff with in-line comments
Download patch
Index: content/common/leveldb_wrapper.mojom
diff --git a/content/common/leveldb_wrapper.mojom b/content/common/leveldb_wrapper.mojom
index 27ad0cba2e59c00a46822903ee24b9293679b3d7..91c12f5f25a0a1b95e38d31cadd645826dfa2544 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);
};
struct KeyValue {
@@ -30,24 +32,21 @@ struct KeyValue {
// A wrapper around leveldb that supports giving notifications when values
// change.
interface LevelDBWrapper {
+ AddObserver(LevelDBObserver observer);
+
// 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);
};

Powered by Google App Engine
This is Rietveld 408576698