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

Unified Diff: content/common/leveldb_wrapper.mojom

Issue 1745603002: Switch LevelDBWrapper::GetAll to use the new Mojo sync IPC mechanism. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comment Created 4 years, 10 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
« no previous file with comments | « content/browser/storage_partition_impl.cc ('k') | content/common/storage_partition_service.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/leveldb_wrapper.mojom
diff --git a/content/common/leveldb_wrapper.mojom b/content/common/leveldb_wrapper.mojom
index 045b858acb36929e53771364e88da2ab46ab2194..32edb09f2eb311ac19b65023114d916f96816e8b 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 below, instead of
+// 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);
};
« no previous file with comments | « content/browser/storage_partition_impl.cc ('k') | content/common/storage_partition_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698