Index: content/common/leveldb_wrapper.mojom |
diff --git a/content/common/leveldb_wrapper.mojom b/content/common/leveldb_wrapper.mojom |
index 6295be0b9789a4075e1a7195e418557acb6022c6..e099618c3727e8a5442c9cf388ebf0aaecc61dff 100644 |
--- a/content/common/leveldb_wrapper.mojom |
+++ b/content/common/leveldb_wrapper.mojom |
@@ -15,11 +15,6 @@ interface LevelDBObserver { |
string source); |
KeyDeleted(array<uint8> key, array<uint8> old_value, string source); |
AllDeleted(string source); |
- |
- // Since the GetAll call is synchronous, observers need this asynchronously |
- // delivered notification to avoid applying changes to the returned array |
- // that it already contains. |
- GetAllComplete(string source); |
}; |
struct KeyValue { |
@@ -27,6 +22,16 @@ struct KeyValue { |
array<uint8> value; |
}; |
+// Since the GetAll call is synchronous, LevelDBWrapper users need this |
+// asynchronously delivered notification to avoid applying changes to the |
+// returned array that it already contains. This is not sent over the |
+// normal LevelDBObserver interface as there can be many observers and |
+// only the connection that made the GetAll call needs to be notified of |
+// its completion. |
+interface LevelDBWrapperGetAllCallback { |
+ Complete(bool success); |
+}; |
+ |
// A wrapper around leveldb that supports giving notifications when values |
// change. |
interface LevelDBWrapper { |
@@ -48,6 +53,6 @@ interface LevelDBWrapper { |
// Only used with small databases. Returns all key/value pairs. |
[Sync] |
- GetAll(string source) |
+ GetAll(associated LevelDBWrapperGetAllCallback complete_callback) |
=> (leveldb.mojom.DatabaseError status, array<KeyValue> data); |
}; |