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

Unified Diff: content/browser/indexed_db/leveldb/leveldb_database.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_database.h
diff --git a/content/browser/indexed_db/leveldb/leveldb_database.h b/content/browser/indexed_db/leveldb/leveldb_database.h
index cdcabb54647c83c9d2f56690e2a84ba2fecd87c9..e0d855ce499be42d70d3eb574867de13c22a3fb6 100644
--- a/content/browser/indexed_db/leveldb/leveldb_database.h
+++ b/content/browser/indexed_db/leveldb/leveldb_database.h
@@ -8,6 +8,7 @@
#include <memory>
#include <string>
+#include "base/containers/mru_cache.h"
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/strings/string16.h"
@@ -102,6 +103,9 @@ class CONTENT_EXPORT LevelDBDatabase
bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd) override;
+ void NotifyIteratorUsed(LevelDBIterator*);
+ void NotifyIteratorDestroyed(LevelDBIterator*);
+
protected:
LevelDBDatabase();
@@ -115,6 +119,8 @@ class CONTENT_EXPORT LevelDBDatabase
std::unique_ptr<leveldb::DB> db_;
std::unique_ptr<const leveldb::FilterPolicy> filter_policy_;
const LevelDBComparator* comparator_;
+ base::MRUCache<LevelDBIterator*, LevelDBIterator*> iterator_lru_;
jsbell 2017/03/21 00:15:48 MRU vs lru ?
dmurph 2017/03/21 20:13:26 Incorrect type name. Very annoying for me haha.
+
std::string file_name_for_tracing;
};

Powered by Google App Engine
This is Rietveld 408576698