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

Side by Side Diff: content/renderer/indexed_db_dispatcher.h

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 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CONTENT_RENDERER_INDEXED_DB_DISPATCHER_H_ 5 #ifndef CONTENT_RENDERER_INDEXED_DB_DISPATCHER_H_
6 #define CONTENT_RENDERER_INDEXED_DB_DISPATCHER_H_ 6 #define CONTENT_RENDERER_INDEXED_DB_DISPATCHER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 WebKit::WebIDBCallbacks* callbacks_ptr, 62 WebKit::WebIDBCallbacks* callbacks_ptr,
63 int32 idb_cursor_id, 63 int32 idb_cursor_id,
64 WebKit::WebExceptionCode* ec); 64 WebKit::WebExceptionCode* ec);
65 65
66 void RequestIDBCursorContinue( 66 void RequestIDBCursorContinue(
67 const IndexedDBKey& key, 67 const IndexedDBKey& key,
68 WebKit::WebIDBCallbacks* callbacks_ptr, 68 WebKit::WebIDBCallbacks* callbacks_ptr,
69 int32 idb_cursor_id, 69 int32 idb_cursor_id,
70 WebKit::WebExceptionCode* ec); 70 WebKit::WebExceptionCode* ec);
71 71
72 void RequestIDBCursorPrefetch(
73 int n,
74 WebKit::WebIDBCallbacks* callbacks_ptr,
75 int32 idb_cursor_id,
76 WebKit::WebExceptionCode* ec);
77
78 void RequestIDBCursorPrefetchReset(int used_prefetches, int unused_prefetches,
79 int32 idb_cursor_id);
80
72 void RequestIDBCursorDelete( 81 void RequestIDBCursorDelete(
73 WebKit::WebIDBCallbacks* callbacks_ptr, 82 WebKit::WebIDBCallbacks* callbacks_ptr,
74 int32 idb_cursor_id, 83 int32 idb_cursor_id,
75 WebKit::WebExceptionCode* ec); 84 WebKit::WebExceptionCode* ec);
76 85
77 void RequestIDBDatabaseClose( 86 void RequestIDBDatabaseClose(
78 int32 idb_database_id); 87 int32 idb_database_id);
79 88
80 void RequestIDBDatabaseOpen( 89 void RequestIDBDatabaseOpen(
81 WebKit::WebIDBDatabaseCallbacks* callbacks_ptr, 90 WebKit::WebIDBDatabaseCallbacks* callbacks_ptr,
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 void OnSuccessIDBTransaction(int32 response_id, int32 object_id); 175 void OnSuccessIDBTransaction(int32 response_id, int32 object_id);
167 void OnSuccessOpenCursor(int32 response_id, int32 object_id, 176 void OnSuccessOpenCursor(int32 response_id, int32 object_id,
168 const IndexedDBKey& key, 177 const IndexedDBKey& key,
169 const IndexedDBKey& primary_key, 178 const IndexedDBKey& primary_key,
170 const content::SerializedScriptValue& value); 179 const content::SerializedScriptValue& value);
171 void OnSuccessCursorContinue(int32 response_id, 180 void OnSuccessCursorContinue(int32 response_id,
172 int32 cursor_id, 181 int32 cursor_id,
173 const IndexedDBKey& key, 182 const IndexedDBKey& key,
174 const IndexedDBKey& primary_key, 183 const IndexedDBKey& primary_key,
175 const content::SerializedScriptValue& value); 184 const content::SerializedScriptValue& value);
185 void OnSuccessCursorPrefetch(
186 int32 response_id,
187 int32 cursor_id,
188 const std::vector<IndexedDBKey>& keys,
189 const std::vector<IndexedDBKey>& primary_keys,
190 const std::vector<content::SerializedScriptValue>& values);
176 void OnSuccessStringList(int32 response_id, 191 void OnSuccessStringList(int32 response_id,
177 const std::vector<string16>& value); 192 const std::vector<string16>& value);
178 void OnSuccessSerializedScriptValue( 193 void OnSuccessSerializedScriptValue(
179 int32 response_id, 194 int32 response_id,
180 const content::SerializedScriptValue& value); 195 const content::SerializedScriptValue& value);
181 void OnError(int32 response_id, int code, const string16& message); 196 void OnError(int32 response_id, int code, const string16& message);
182 void OnBlocked(int32 response_id); 197 void OnBlocked(int32 response_id);
183 void OnAbort(int32 transaction_id); 198 void OnAbort(int32 transaction_id);
184 void OnComplete(int32 transaction_id); 199 void OnComplete(int32 transaction_id);
185 void OnVersionChange(int32 database_id, const string16& newVersion); 200 void OnVersionChange(int32 database_id, const string16& newVersion);
186 201
202 // Reset cursor prefetch caches for all cursors except exception_cursor_id.
203 void ResetCursorPrefetchCaches(int32 exception_cursor_id = -1);
204
187 // Careful! WebIDBCallbacks wraps non-threadsafe data types. It must be 205 // Careful! WebIDBCallbacks wraps non-threadsafe data types. It must be
188 // destroyed and used on the same thread it was created on. 206 // destroyed and used on the same thread it was created on.
189 IDMap<WebKit::WebIDBCallbacks, IDMapOwnPointer> pending_callbacks_; 207 IDMap<WebKit::WebIDBCallbacks, IDMapOwnPointer> pending_callbacks_;
190 IDMap<WebKit::WebIDBTransactionCallbacks, IDMapOwnPointer> 208 IDMap<WebKit::WebIDBTransactionCallbacks, IDMapOwnPointer>
191 pending_transaction_callbacks_; 209 pending_transaction_callbacks_;
192 IDMap<WebKit::WebIDBDatabaseCallbacks, IDMapOwnPointer> 210 IDMap<WebKit::WebIDBDatabaseCallbacks, IDMapOwnPointer>
193 pending_database_callbacks_; 211 pending_database_callbacks_;
194 212
195 // Map from cursor id to RendererWebIDBCursorImpl. 213 // Map from cursor id to RendererWebIDBCursorImpl.
196 std::map<int32, RendererWebIDBCursorImpl*> cursors_; 214 std::map<int32, RendererWebIDBCursorImpl*> cursors_;
197 215
198 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); 216 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher);
199 }; 217 };
200 218
201 #endif // CONTENT_RENDERER_INDEXED_DB_DISPATCHER_H_ 219 #endif // CONTENT_RENDERER_INDEXED_DB_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698