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

Unified Diff: components/leveldb/leveldb_database_impl.h

Issue 1861903002: mojo leveldb: Add an iteration interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + comments Created 4 years, 8 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 | « components/leveldb/leveldb.gyp ('k') | components/leveldb/leveldb_database_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/leveldb/leveldb_database_impl.h
diff --git a/components/leveldb/leveldb_database_impl.h b/components/leveldb/leveldb_database_impl.h
index 0f218d3e39f6241921cd0d22c3c4c20c2857c288..a6ccab77dcb23af4f9f928e8fc3f4c7524f93a09 100644
--- a/components/leveldb/leveldb_database_impl.h
+++ b/components/leveldb/leveldb_database_impl.h
@@ -37,8 +37,30 @@ class LevelDBDatabaseImpl : public LevelDBDatabase {
void GetFromSnapshot(uint64_t snapshot_id,
mojo::Array<uint8_t> key,
const GetCallback& callback) override;
+ void NewIterator(const NewIteratorCallback& callback) override;
+ void NewIteratorFromSnapshot(uint64_t snapshot_id,
+ const NewIteratorCallback& callback) override;
+ void ReleaseIterator(uint64_t iterator_id) override;
+ void IteratorSeekToFirst(
+ uint64_t iterator_id,
+ const IteratorSeekToFirstCallback& callback) override;
+ void IteratorSeekToLast(uint64_t iterator_id,
+ const IteratorSeekToLastCallback& callback) override;
+ void IteratorSeek(uint64_t iterator_id,
+ mojo::Array<uint8_t> target,
+ const IteratorSeekToLastCallback& callback) override;
+ void IteratorNext(uint64_t iterator_id,
+ const IteratorNextCallback& callback) override;
+ void IteratorPrev(uint64_t iterator_id,
+ const IteratorPrevCallback& callback) override;
private:
+ // Returns the state of |it| to a caller. Note: This assumes that all the
+ // iterator movement methods have the same callback signature. We don't
+ // directly reference the underlying type in case of bindings change.
+ void ReplyToIteratorMessage(leveldb::Iterator* it,
+ const IteratorSeekToFirstCallback& callback);
+
mojo::StrongBinding<LevelDBDatabase> binding_;
scoped_ptr<leveldb::Env> environment_;
scoped_ptr<leveldb::DB> db_;
« no previous file with comments | « components/leveldb/leveldb.gyp ('k') | components/leveldb/leveldb_database_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698