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

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

Issue 2786463002: [IndexedDB] Fix cursor pooling IsValid(). (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 | « no previous file | content/browser/indexed_db/leveldb/leveldb_transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/indexed_db/leveldb/leveldb_iterator_impl.cc
diff --git a/content/browser/indexed_db/leveldb/leveldb_iterator_impl.cc b/content/browser/indexed_db/leveldb/leveldb_iterator_impl.cc
index b94a3d6150bee704eba43cefa3224682b9e08f60..eecc77c6323be06f74c5266e8d813788c4fb8af4 100644
--- a/content/browser/indexed_db/leveldb/leveldb_iterator_impl.cc
+++ b/content/browser/indexed_db/leveldb/leveldb_iterator_impl.cc
@@ -38,8 +38,16 @@ leveldb::Status LevelDBIteratorImpl::CheckStatus() {
}
bool LevelDBIteratorImpl::IsValid() const {
- return iterator_state_ == IteratorState::EVICTED_AND_VALID ||
- iterator_->Valid();
+ switch (iterator_state_) {
+ case IteratorState::EVICTED_AND_VALID:
+ return true;
+ case IteratorState::EVICTED_AND_INVALID:
+ return false;
+ case IteratorState::ACTIVE:
+ return iterator_->Valid();
+ }
+ NOTREACHED();
+ return false;
}
leveldb::Status LevelDBIteratorImpl::SeekToLast() {
« no previous file with comments | « no previous file | content/browser/indexed_db/leveldb/leveldb_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698