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