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

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: More style nits fixed 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 baa1410f60639d5ca31438b0ab841f2eddf65a69..953445ce1b4d2f568635488914cca604fe53c41c 100644
--- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
+++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
@@ -191,6 +191,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));
@@ -553,7 +558,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),
@@ -573,7 +578,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),
@@ -844,7 +849,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),
@@ -954,7 +959,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(
« no previous file with comments | « content/browser/in_process_webkit/indexed_db_dispatcher_host.h ('k') | content/common/indexed_db_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698