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

Unified Diff: trunk/src/content/browser/indexed_db/indexed_db_cursor.cc

Issue 126263003: Revert 243344 "IndexedDB: Fix cursor prefetching edge cases" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 11 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 | trunk/src/content/child/indexed_db/indexed_db_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/content/browser/indexed_db/indexed_db_cursor.cc
===================================================================
--- trunk/src/content/browser/indexed_db/indexed_db_cursor.cc (revision 243358)
+++ trunk/src/content/browser/indexed_db/indexed_db_cursor.cc (working copy)
@@ -108,7 +108,8 @@
std::vector<IndexedDBKey> found_primary_keys;
std::vector<std::string> found_values;
- saved_cursor_.reset();
+ if (cursor_)
+ saved_cursor_.reset(cursor_->Clone());
const size_t max_size_estimate = 10 * 1024 * 1024;
size_t size_estimate = 0;
@@ -118,12 +119,6 @@
break;
}
- if (i == 0) {
- // First prefetched result is always used, so that's the position
- // a cursor should be reset to if the prefetch is invalidated.
- saved_cursor_.reset(cursor_->Clone());
- }
-
found_keys.push_back(cursor_->key());
found_primary_keys.push_back(cursor_->primary_key());
@@ -157,8 +152,7 @@
found_keys, found_primary_keys, found_values);
}
-void IndexedDBCursor::PrefetchReset(int used_prefetches,
- int /* unused_prefetches */) {
+void IndexedDBCursor::PrefetchReset(int used_prefetches, int) {
IDB_TRACE("IndexedDBCursor::PrefetchReset");
cursor_.swap(saved_cursor_);
saved_cursor_.reset();
@@ -166,9 +160,7 @@
if (closed_)
return;
if (cursor_) {
- // First prefetched result is always used.
- DCHECK_GT(used_prefetches, 0);
- for (int i = 0; i < used_prefetches - 1; ++i) {
+ for (int i = 0; i < used_prefetches; ++i) {
bool ok = cursor_->Continue();
DCHECK(ok);
}
« no previous file with comments | « no previous file | trunk/src/content/child/indexed_db/indexed_db_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698