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

Unified Diff: content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc

Issue 2760163002: [IndexedDB] Pool and evict leveldb iterators, to save memory (Closed)
Patch Set: comments 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
« no previous file with comments | « content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc
diff --git a/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc b/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc
index c4084948abb6940da102d48df4b622370e5b7bb6..83af4cb9f2ca7e17eaed1a481fe518d4e4c9c25b 100644
--- a/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc
+++ b/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc
@@ -167,8 +167,10 @@ const std::string LevelDBTraceTransaction::s_class_name = "LevelDBTransaction";
class LevelDBTraceIteratorImpl : public LevelDBIteratorImpl {
public:
LevelDBTraceIteratorImpl(std::unique_ptr<leveldb::Iterator> iterator,
+ LevelDBDatabase* db,
+ const leveldb::Snapshot* snapshot,
int inst_num)
- : LevelDBIteratorImpl(std::move(iterator)),
+ : LevelDBIteratorImpl(std::move(iterator), db, snapshot),
is_valid_tracer_(s_class_name, "IsValid", inst_num),
seek_to_last_tracer_(s_class_name, "SeekToLast", inst_num),
seek_tracer_(s_class_name, "Seek", inst_num),
@@ -224,9 +226,11 @@ const std::string LevelDBTraceIteratorImpl::s_class_name = "LevelDBIterator";
class LevelDBTestIteratorImpl : public content::LevelDBIteratorImpl {
public:
LevelDBTestIteratorImpl(std::unique_ptr<leveldb::Iterator> iterator,
+ LevelDBDatabase* db,
+ const leveldb::Snapshot* snapshot,
FailMethod fail_method,
int fail_on_call_num)
- : LevelDBIteratorImpl(std::move(iterator)),
+ : LevelDBIteratorImpl(std::move(iterator), db, snapshot),
fail_method_(fail_method),
fail_on_call_num_(fail_on_call_num),
current_call_num_(0) {}
@@ -299,21 +303,25 @@ MockBrowserTestIndexedDBClassFactory::CreateLevelDBTransaction(
std::unique_ptr<LevelDBIteratorImpl>
MockBrowserTestIndexedDBClassFactory::CreateIteratorImpl(
- std::unique_ptr<leveldb::Iterator> iterator) {
+ std::unique_ptr<leveldb::Iterator> iterator,
+ LevelDBDatabase* db,
+ const leveldb::Snapshot* snapshot) {
instance_count_[FAIL_CLASS_LEVELDB_ITERATOR] =
instance_count_[FAIL_CLASS_LEVELDB_ITERATOR] + 1;
if (only_trace_calls_) {
return base::MakeUnique<LevelDBTraceIteratorImpl>(
- std::move(iterator), instance_count_[FAIL_CLASS_LEVELDB_ITERATOR]);
+ std::move(iterator), db, snapshot,
+ instance_count_[FAIL_CLASS_LEVELDB_ITERATOR]);
} else {
if (failure_class_ == FAIL_CLASS_LEVELDB_ITERATOR &&
instance_count_[FAIL_CLASS_LEVELDB_ITERATOR] ==
fail_on_instance_num_[FAIL_CLASS_LEVELDB_ITERATOR]) {
return base::MakeUnique<LevelDBTestIteratorImpl>(
- std::move(iterator), failure_method_,
+ std::move(iterator), db, snapshot, failure_method_,
fail_on_call_num_[FAIL_CLASS_LEVELDB_ITERATOR]);
} else {
- return base::WrapUnique(new LevelDBIteratorImpl(std::move(iterator)));
+ return base::WrapUnique(
+ new LevelDBIteratorImpl(std::move(iterator), db, snapshot));
}
}
}
« no previous file with comments | « content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698