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

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

Issue 2760163002: [IndexedDB] Pool and evict leveldb iterators, to save memory (Closed)
Patch Set: 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_transaction.h
diff --git a/content/browser/indexed_db/leveldb/leveldb_transaction.h b/content/browser/indexed_db/leveldb/leveldb_transaction.h
index a701a94748a6b02c10dcfdbd4f947084fa0f2a8f..3a55121ba254d0f36e5d84e3fda63dab098b2783 100644
--- a/content/browser/indexed_db/leveldb/leveldb_transaction.h
+++ b/content/browser/indexed_db/leveldb/leveldb_transaction.h
@@ -93,6 +93,7 @@ class CONTENT_EXPORT LevelDBTransaction
leveldb::Status Prev() override;
base::StringPiece Key() const override;
base::StringPiece Value() const override;
+
bool IsDeleted() const;
// Mark the current record as deleted.
@@ -123,6 +124,8 @@ class CONTENT_EXPORT LevelDBTransaction
leveldb::Status Prev() override;
base::StringPiece Key() const override;
base::StringPiece Value() const override;
+ void EvictWorkingMemory() override;
+
void DataChanged();
// Mark the current record as deleted. If an existing record
@@ -141,12 +144,17 @@ class CONTENT_EXPORT LevelDBTransaction
bool DataIteratorIsLower() const;
bool DataIteratorIsHigher() const;
+ void LoadDBIteratorIfEvicted();
+
scoped_refptr<LevelDBTransaction> transaction_;
const LevelDBComparator* comparator_;
mutable std::unique_ptr<DataIterator> data_iterator_;
std::unique_ptr<LevelDBIterator> db_iterator_;
LevelDBIterator* current_ = nullptr;
+ bool is_evicted_ = false;
+ std::string key_after_eviction_;
+
Direction direction_ = FORWARD;
mutable bool data_changed_ = false;

Powered by Google App Engine
This is Rietveld 408576698