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

Unified Diff: content/browser/in_process_webkit/indexed_db_dispatcher_host.cc

Issue 8400061: IndexedDB: Recycle cursor objects when calling continue(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Callback renamed to onSuccessWithContinuation, and style fixes Created 9 years, 1 month 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/in_process_webkit/indexed_db_dispatcher_host.cc
diff --git a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
index 86e3e4974dc0f4bab757aa93bcb639f4d2711f58..a9dc7be6a09dc3518c87b22e56e1331944d0b2c0 100644
--- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
+++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
@@ -190,6 +190,11 @@ int32 IndexedDBDispatcherHost::Add(WebIDBTransaction* idb_transaction,
return id;
}
+WebIDBCursor* IndexedDBDispatcherHost::GetCursorFromId(int32 cursor_id) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
+ return cursor_dispatcher_host_->map_.Lookup(cursor_id);
+}
+
void IndexedDBDispatcherHost::OnIDBFactoryGetDatabaseNames(
const IndexedDBHostMsg_FactoryGetDatabaseNames_Params& params) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
@@ -552,7 +557,7 @@ void IndexedDBDispatcherHost::IndexDispatcherHost::OnOpenObjectCursor(
*ec = 0;
scoped_ptr<WebIDBCallbacks> callbacks(
- new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id));
+ new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id, -1));
idb_index->openObjectCursor(
WebIDBKeyRange(params.lower_key, params.upper_key, params.lower_open,
params.upper_open),
@@ -572,7 +577,7 @@ void IndexedDBDispatcherHost::IndexDispatcherHost::OnOpenKeyCursor(
*ec = 0;
scoped_ptr<WebIDBCallbacks> callbacks(
- new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id));
+ new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id, -1));
idb_index->openKeyCursor(
WebIDBKeyRange(params.lower_key, params.upper_key, params.lower_open,
params.upper_open),
@@ -843,7 +848,7 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnOpenCursor(
*ec = 0;
scoped_ptr<WebIDBCallbacks> callbacks(
- new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id));
+ new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id, -1));
idb_object_store->openCursor(
WebIDBKeyRange(params.lower_key, params.upper_key, params.lower_open,
params.upper_open),
@@ -953,7 +958,8 @@ void IndexedDBDispatcherHost::CursorDispatcherHost::OnContinue(
*ec = 0;
idb_cursor->continueFunction(
- key, new IndexedDBCallbacks<WebIDBCursor>(parent_, response_id), *ec);
+ key, new IndexedDBCallbacks<WebIDBCursor>(parent_, response_id,
+ cursor_id), *ec);
}
void IndexedDBDispatcherHost::CursorDispatcherHost::OnDelete(

Powered by Google App Engine
This is Rietveld 408576698