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

Side by Side Diff: content/browser/in_process_webkit/indexed_db_dispatcher_host.cc

Issue 10197001: IndexedDB: chromium side of IDBCursor.advance(). (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Additional key/value/primarykey for the current cursor Created 8 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" 5 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "content/browser/in_process_webkit/indexed_db_callbacks.h" 10 #include "content/browser/in_process_webkit/indexed_db_callbacks.h"
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 IndexedDBDispatcherHost::CursorDispatcherHost::~CursorDispatcherHost() { 959 IndexedDBDispatcherHost::CursorDispatcherHost::~CursorDispatcherHost() {
960 } 960 }
961 961
962 bool IndexedDBDispatcherHost::CursorDispatcherHost::OnMessageReceived( 962 bool IndexedDBDispatcherHost::CursorDispatcherHost::OnMessageReceived(
963 const IPC::Message& message, bool* msg_is_ok) { 963 const IPC::Message& message, bool* msg_is_ok) {
964 bool handled = true; 964 bool handled = true;
965 IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::CursorDispatcherHost, 965 IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::CursorDispatcherHost,
966 message, *msg_is_ok) 966 message, *msg_is_ok)
967 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorDirection, OnDirection) 967 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorDirection, OnDirection)
968 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorUpdate, OnUpdate) 968 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorUpdate, OnUpdate)
969 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorAdvance, OnAdvance)
969 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorContinue, OnContinue) 970 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorContinue, OnContinue)
970 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorPrefetch, OnPrefetch) 971 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorPrefetch, OnPrefetch)
971 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorPrefetchReset, OnPrefetchReset) 972 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorPrefetchReset, OnPrefetchReset)
972 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorDelete, OnDelete) 973 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorDelete, OnDelete)
973 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorDestroyed, OnDestroyed) 974 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorDestroyed, OnDestroyed)
974 IPC_MESSAGE_UNHANDLED(handled = false) 975 IPC_MESSAGE_UNHANDLED(handled = false)
975 IPC_END_MESSAGE_MAP() 976 IPC_END_MESSAGE_MAP()
976 return handled; 977 return handled;
977 } 978 }
978 979
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, cursor_id); 1030 WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, cursor_id);
1030 if (!idb_cursor) 1031 if (!idb_cursor)
1031 return; 1032 return;
1032 1033
1033 *ec = 0; 1034 *ec = 0;
1034 idb_cursor->update( 1035 idb_cursor->update(
1035 value, new IndexedDBCallbacks<WebIDBKey>(parent_, thread_id, response_id), 1036 value, new IndexedDBCallbacks<WebIDBKey>(parent_, thread_id, response_id),
1036 *ec); 1037 *ec);
1037 } 1038 }
1038 1039
1040 void IndexedDBDispatcherHost::CursorDispatcherHost::OnAdvance(
1041 int32 cursor_id,
1042 int32 thread_id,
1043 int32 response_id,
1044 unsigned long count,
1045 WebKit::WebExceptionCode* ec) {
1046 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
1047 WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, cursor_id);
1048 if (!idb_cursor)
1049 return;
1050
1051 *ec = 0;
1052 idb_cursor->advance(count,
1053 new IndexedDBCallbacks<WebIDBCursor>(parent_,
1054 thread_id,
1055 response_id,
1056 cursor_id),
1057 *ec);
1058 }
1059
1039 void IndexedDBDispatcherHost::CursorDispatcherHost::OnContinue( 1060 void IndexedDBDispatcherHost::CursorDispatcherHost::OnContinue(
1040 int32 cursor_id, 1061 int32 cursor_id,
1041 int32 thread_id, 1062 int32 thread_id,
1042 int32 response_id, 1063 int32 response_id,
1043 const IndexedDBKey& key, 1064 const IndexedDBKey& key,
1044 WebKit::WebExceptionCode* ec) { 1065 WebKit::WebExceptionCode* ec) {
1045 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); 1066 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
1046 WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, cursor_id); 1067 WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, cursor_id);
1047 if (!idb_cursor) 1068 if (!idb_cursor)
1048 return; 1069 return;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 } 1214 }
1194 idb_transaction->didCompleteTaskEvents(); 1215 idb_transaction->didCompleteTaskEvents();
1195 } 1216 }
1196 1217
1197 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( 1218 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed(
1198 int32 object_id) { 1219 int32 object_id) {
1199 transaction_size_map_.erase(object_id); 1220 transaction_size_map_.erase(object_id);
1200 transaction_url_map_.erase(object_id); 1221 transaction_url_map_.erase(object_id);
1201 parent_->DestroyObject(&map_, object_id); 1222 parent_->DestroyObject(&map_, object_id);
1202 } 1223 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698