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

Unified Diff: content/common/indexed_db/proxy_webidbcursor_impl.cc

Issue 9691021: IndexedDB: Fix prefetching; cache was always being bypassed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix memory leak Created 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/indexed_db/proxy_webidbcursor_impl.cc
diff --git a/content/common/indexed_db/proxy_webidbcursor_impl.cc b/content/common/indexed_db/proxy_webidbcursor_impl.cc
index f043356171fdbe58f43eac00908d79113b030043..a86a74e361977797b3f3276521a222af13f24c26 100644
--- a/content/common/indexed_db/proxy_webidbcursor_impl.cc
+++ b/content/common/indexed_db/proxy_webidbcursor_impl.cc
@@ -62,24 +62,26 @@ void RendererWebIDBCursorImpl::update(const WebSerializedScriptValue& value,
}
void RendererWebIDBCursorImpl::continueFunction(const WebIDBKey& key,
- WebIDBCallbacks* callbacks,
+ WebIDBCallbacks* callbacks_ptr,
WebExceptionCode& ec) {
IndexedDBDispatcher* dispatcher =
IndexedDBDispatcher::ThreadSpecificInstance();
+ scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr);
michaeln 2012/03/17 02:44:46 lgtm
- if (key.type() == WebIDBKey::InvalidType) {
+ if (key.type() == WebIDBKey::NullType) {
// No key, so this would qualify for a prefetch.
++continue_count_;
if (!prefetch_keys_.empty()) {
// We have a prefetch cache, so serve the result from that.
- CachedContinue(callbacks);
+ CachedContinue(callbacks.get());
return;
}
if (continue_count_ > kPrefetchContinueThreshold) {
// Request pre-fetch.
- dispatcher->RequestIDBCursorPrefetch(prefetch_amount_, callbacks,
+ dispatcher->RequestIDBCursorPrefetch(prefetch_amount_,
+ callbacks.release(),
idb_cursor_id_, &ec);
// Increase prefetch_amount_ exponentially.
@@ -94,7 +96,7 @@ void RendererWebIDBCursorImpl::continueFunction(const WebIDBKey& key,
ResetPrefetchCache();
}
- dispatcher->RequestIDBCursorContinue(IndexedDBKey(key), callbacks,
+ dispatcher->RequestIDBCursorContinue(IndexedDBKey(key), callbacks.release(),
idb_cursor_id_, &ec);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698