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

Unified Diff: content/browser/indexed_db/leveldb/leveldb_iterator.h

Issue 2760163002: [IndexedDB] Pool and evict leveldb iterators, to save memory (Closed)
Patch Set: comments & simplifying MRU interaction Created 3 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/browser/indexed_db/leveldb/leveldb_iterator.h
diff --git a/content/browser/indexed_db/leveldb/leveldb_iterator.h b/content/browser/indexed_db/leveldb/leveldb_iterator.h
index d5efa4bf51951f6218d0cbcb804e282c6397b4d2..ce56ab9a5eea3cc336ecc764c701602d2616f677 100644
--- a/content/browser/indexed_db/leveldb/leveldb_iterator.h
+++ b/content/browser/indexed_db/leveldb/leveldb_iterator.h
@@ -21,6 +21,12 @@ class CONTENT_EXPORT LevelDBIterator {
virtual leveldb::Status Prev() = 0;
virtual base::StringPiece Key() const = 0;
virtual base::StringPiece Value() const = 0;
+
+ // Detaches the internal iterator which saves memory at the performance
+ // expense of reloading and seeking later if the iterator is needed again for
+ // |Seek*|, |Next|, |Prev|, or |Value|.
+ virtual void Detach(){};
jsbell 2017/03/27 15:35:34 Nit: space between ) and { Also, since we DCHECK
dmurph 2017/03/27 21:32:05 ugh. Darn clang format! Actually, should I just ke
pwnall 2017/03/27 21:52:18 I would suggest keeping the code as-is and and fil
+ virtual bool IsDetached() const;
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698