Index: content/common/indexed_db/indexed_db_dispatcher.cc |
diff --git a/content/common/indexed_db/indexed_db_dispatcher.cc b/content/common/indexed_db/indexed_db_dispatcher.cc |
index b725a7d7d400d3a7e9341bd69f2628320bd9c826..f3f4a27d68159847b091d91adc5fbb934d042c9e 100644 |
--- a/content/common/indexed_db/indexed_db_dispatcher.cc |
+++ b/content/common/indexed_db/indexed_db_dispatcher.cc |
@@ -80,6 +80,8 @@ void IndexedDBDispatcher::OnMessageReceived(const IPC::Message& msg) { |
IPC_BEGIN_MESSAGE_MAP(IndexedDBDispatcher, msg) |
IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIDBCursor, |
OnSuccessOpenCursor) |
+ IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessCursorAdvance, |
+ OnSuccessCursorAdvance) |
IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessCursorContinue, |
OnSuccessCursorContinue) |
IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessCursorPrefetch, |
@@ -136,6 +138,23 @@ void IndexedDBDispatcher::RequestIDBCursorUpdate( |
pending_callbacks_.Remove(response_id); |
} |
+void IndexedDBDispatcher::RequestIDBCursorAdvance( |
+ unsigned long count, |
+ WebIDBCallbacks* callbacks_ptr, |
+ int32 idb_cursor_id, |
+ WebExceptionCode* ec) { |
+ // Reset all cursor prefetch caches except for this cursor. |
+ ResetCursorPrefetchCaches(idb_cursor_id); |
+ |
+ scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); |
+ |
+ int32 response_id = pending_callbacks_.Add(callbacks.release()); |
+ Send(new IndexedDBHostMsg_CursorAdvance(idb_cursor_id, CurrentWorkerId(), |
+ response_id, count, ec)); |
+ if (*ec) |
+ pending_callbacks_.Remove(response_id); |
+} |
+ |
void IndexedDBDispatcher::RequestIDBCursorContinue( |
const IndexedDBKey& key, |
WebIDBCallbacks* callbacks_ptr, |
@@ -624,6 +643,19 @@ void IndexedDBDispatcher::OnSuccessOpenCursor( |
pending_callbacks_.Remove(response_id); |
} |
+void IndexedDBDispatcher::OnSuccessCursorAdvance( |
+ const IndexedDBMsg_CallbacksSuccessCursorAdvance_Params& p) { |
+ DCHECK_EQ(p.thread_id, CurrentWorkerId()); |
+ int32 response_id = p.response_id; |
jsbell
2012/04/24 15:41:08
This method is much simpler than OnSuccessCursorCo
alecflett
2012/04/24 16:34:22
Oops, I removed this as an experiment, and thought
|
+ |
+ WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id); |
+ if (!callbacks) |
+ return; |
+ callbacks->onSuccessWithContinuation(); |
+ |
+ pending_callbacks_.Remove(response_id); |
+} |
+ |
void IndexedDBDispatcher::OnSuccessCursorContinue( |
const IndexedDBMsg_CallbacksSuccessCursorContinue_Params& p) { |
DCHECK_EQ(p.thread_id, CurrentWorkerId()); |