Chromium Code Reviews| Index: content/renderer/indexed_db_dispatcher.cc |
| diff --git a/content/renderer/indexed_db_dispatcher.cc b/content/renderer/indexed_db_dispatcher.cc |
| index c3eea0e949e87aa64a1326f261f215cdc2ec8a60..bb3741bd5ec5a99cb1a727acfef1ea9d92a7a755 100644 |
| --- a/content/renderer/indexed_db_dispatcher.cc |
| +++ b/content/renderer/indexed_db_dispatcher.cc |
| @@ -42,6 +42,8 @@ bool IndexedDBDispatcher::OnMessageReceived(const IPC::Message& msg) { |
| IPC_BEGIN_MESSAGE_MAP(IndexedDBDispatcher, msg) |
| IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIDBCursor, |
| OnSuccessOpenCursor) |
| + IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessCursorContinue, |
| + OnSuccessCursorContinue) |
| IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIDBDatabase, |
| OnSuccessIDBDatabase) |
| IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIndexedDBKey, |
| @@ -426,15 +428,36 @@ void IndexedDBDispatcher::OnSuccessSerializedScriptValue( |
| } |
| void IndexedDBDispatcher::OnSuccessOpenCursor(int32 repsonse_id, |
| - int32 object_id, const IndexedDBKey& key, const IndexedDBKey& primaryKey, |
| + int32 object_id, const IndexedDBKey& key, const IndexedDBKey& primary_key, |
| const content::SerializedScriptValue& value) { |
| WebIDBCallbacks* callbacks = |
| pending_callbacks_.Lookup(repsonse_id); |
| - callbacks->onSuccess(new RendererWebIDBCursorImpl(object_id, key, |
| - primaryKey, value)); |
| + |
| + RendererWebIDBCursorImpl* cursor = new RendererWebIDBCursorImpl(object_id); |
| + cursors_[object_id] = cursor; |
| + cursor->SetKeyAndValue(key, primary_key, value); |
| + callbacks->onSuccess(cursor); |
| + |
| pending_callbacks_.Remove(repsonse_id); |
| } |
| +void IndexedDBDispatcher::OnSuccessCursorContinue( |
| + int32 response_id, |
| + int32 cursor_id, |
| + const IndexedDBKey& key, |
| + const IndexedDBKey& primary_key, |
| + const content::SerializedScriptValue& value) { |
| + |
|
michaeln
2011/11/03 18:10:04
nit: blank line not needed
hans
2011/11/04 10:09:44
Done.
|
| + RendererWebIDBCursorImpl* cursor = cursors_[cursor_id]; |
| + DCHECK(cursor); |
| + cursor->SetKeyAndValue(key, primary_key, value); |
| + |
| + WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id); |
| + callbacks->onSuccessWithContinuation(); |
| + |
| + pending_callbacks_.Remove(response_id); |
| +} |
| + |
| void IndexedDBDispatcher::OnBlocked(int32 response_id) { |
| WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id); |
| callbacks->onBlocked(); |
| @@ -470,3 +493,7 @@ void IndexedDBDispatcher::OnVersionChange(int32 database_id, |
| if (callbacks) |
| callbacks->onVersionChange(newVersion); |
| } |
| + |
| +void IndexedDBDispatcher::CursorDestroyed(int32 cursor_id) { |
|
michaeln
2011/11/03 18:10:04
please move this to a position in the .cc file tha
hans
2011/11/04 10:09:44
Done.
|
| + cursors_.erase(cursor_id); |
| +} |