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

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

Issue 2712713005: Revert of IndexedDB: Optimize range deletion operations (e.g. clearing a store) (Closed)
Patch Set: Created 3 years, 10 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.cc
diff --git a/content/browser/indexed_db/leveldb/leveldb_transaction.cc b/content/browser/indexed_db/leveldb/leveldb_transaction.cc
index 76a7403ba5b2e91928040a3c36c8157918bd60cc..016e7dea72b90ed23f1247f28813119d1f615f56 100644
--- a/content/browser/indexed_db/leveldb/leveldb_transaction.cc
+++ b/content/browser/indexed_db/leveldb/leveldb_transaction.cc
@@ -25,7 +25,7 @@
data_(data_comparator_),
finished_(false) {}
-LevelDBTransaction::Record::Record() {}
+LevelDBTransaction::Record::Record() : deleted(false) {}
LevelDBTransaction::Record::~Record() {}
LevelDBTransaction::~LevelDBTransaction() {}
@@ -58,29 +58,6 @@
bool LevelDBTransaction::Remove(const StringPiece& key) {
std::string empty;
return !Set(key, &empty, true);
-}
-
-leveldb::Status LevelDBTransaction::RemoveRange(const StringPiece& begin,
- const StringPiece& end,
- bool upper_open) {
- IDB_TRACE("LevelDBTransaction::RemoveRange");
- data_.erase(data_.lower_bound(begin), data_.lower_bound(end));
- if (!upper_open)
- data_.erase(end);
- std::unique_ptr<LevelDBIterator> it = CreateIterator();
- leveldb::Status s;
- for (s = it->Seek(begin);
- s.ok() && it->IsValid() &&
- (upper_open ? comparator_->Compare(it->Key(), end) < 0
- : comparator_->Compare(it->Key(), end) <= 0);
- s = it->Next()) {
- std::unique_ptr<Record> record = base::MakeUnique<Record>();
- record->key = it->Key().as_string();
- record->deleted = true;
- data_[record->key] = std::move(record);
- }
- NotifyIterators();
- return s;
}
leveldb::Status LevelDBTransaction::Get(const StringPiece& key,

Powered by Google App Engine
This is Rietveld 408576698