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

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

Issue 8662017: IndexedDB: Cursor pre-fetching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tighten the browser test a little 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 953445ce1b4d2f568635488914cca604fe53c41c..ca56dbdc9c742d1a279054dfb59b962678836358 100644
--- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
+++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
@@ -882,6 +882,8 @@ bool IndexedDBDispatcherHost::CursorDispatcherHost::OnMessageReceived(
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorDirection, OnDirection)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorUpdate, OnUpdate)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorContinue, OnContinue)
+ IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorPrefetch, OnPrefetch)
+ IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorPrefetchReset, OnPrefetchReset)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorDelete, OnDelete)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorDestroyed, OnDestroyed)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -963,6 +965,32 @@ void IndexedDBDispatcherHost::CursorDispatcherHost::OnContinue(
cursor_id), *ec);
}
+void IndexedDBDispatcherHost::CursorDispatcherHost::OnPrefetch(
+ int32 cursor_id,
+ int32 response_id,
+ int n,
+ WebKit::WebExceptionCode* ec) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
+ WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, cursor_id);
+ if (!idb_cursor)
+ return;
+
+ *ec = 0;
+ idb_cursor->prefetchContinue(
+ n, new IndexedDBCallbacks<WebIDBCursor>(parent_, response_id,
+ cursor_id), *ec);
+}
+
+void IndexedDBDispatcherHost::CursorDispatcherHost::OnPrefetchReset(
+ int32 cursor_id, int used_prefetches, int unused_prefetches) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
+ WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, cursor_id);
+ if (!idb_cursor)
+ return;
+
+ idb_cursor->prefetchReset(used_prefetches, unused_prefetches);
+}
+
void IndexedDBDispatcherHost::CursorDispatcherHost::OnDelete(
int32 cursor_id,
int32 response_id,

Powered by Google App Engine
This is Rietveld 408576698