| OLD | NEW |
| 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 #ifndef CONTENT_COMMON_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ | 5 #ifndef CONTENT_COMMON_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ |
| 6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ | 6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/id_map.h" | 11 #include "base/id_map.h" |
| 12 #include "base/nullable_string16.h" | 12 #include "base/nullable_string16.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "ipc/ipc_sync_message_filter.h" | 14 #include "ipc/ipc_sync_message_filter.h" |
| 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebExceptionCode.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebExceptionCode.h" |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCallbacks.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCallbacks.h" |
| 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCursor.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCursor.h" |
| 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabase.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabase.h" |
| 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabaseCallbac
ks.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabaseCallbac
ks.h" |
| 20 #include "webkit/glue/worker_task_runner.h" | 20 #include "webkit/glue/worker_task_runner.h" |
| 21 | 21 |
| 22 struct IndexedDBDatabaseMetadata; |
| 23 struct IndexedDBMsg_CallbacksSuccessCursorContinueOld_Params; |
| 22 struct IndexedDBMsg_CallbacksSuccessCursorContinue_Params; | 24 struct IndexedDBMsg_CallbacksSuccessCursorContinue_Params; |
| 25 struct IndexedDBMsg_CallbacksSuccessCursorPrefetchOld_Params; |
| 23 struct IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params; | 26 struct IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params; |
| 27 struct IndexedDBMsg_CallbacksSuccessIDBCursorOld_Params; |
| 24 struct IndexedDBMsg_CallbacksSuccessIDBCursor_Params; | 28 struct IndexedDBMsg_CallbacksSuccessIDBCursor_Params; |
| 25 struct IndexedDBDatabaseMetadata; | |
| 26 | 29 |
| 27 namespace WebKit { | 30 namespace WebKit { |
| 31 class WebData; |
| 28 class WebFrame; | 32 class WebFrame; |
| 29 class WebIDBKeyRange; | |
| 30 } | 33 } |
| 31 | 34 |
| 32 namespace content { | 35 namespace content { |
| 33 class IndexedDBKey; | 36 class IndexedDBKey; |
| 34 class IndexedDBKeyPath; | 37 class IndexedDBKeyPath; |
| 35 class IndexedDBKeyRange; | 38 class IndexedDBKeyRange; |
| 36 class RendererWebIDBCursorImpl; | 39 class RendererWebIDBCursorImpl; |
| 37 class RendererWebIDBDatabaseImpl; | 40 class RendererWebIDBDatabaseImpl; |
| 38 class SerializedScriptValue; | 41 class SerializedScriptValue; |
| 39 | 42 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 199 } |
| 197 | 200 |
| 198 // IDBCallback message handlers. | 201 // IDBCallback message handlers. |
| 199 void OnSuccessIDBDatabase(int32 ipc_thread_id, | 202 void OnSuccessIDBDatabase(int32 ipc_thread_id, |
| 200 int32 ipc_response_id, | 203 int32 ipc_response_id, |
| 201 int32 ipc_object_id, | 204 int32 ipc_object_id, |
| 202 const IndexedDBDatabaseMetadata& idb_metadata); | 205 const IndexedDBDatabaseMetadata& idb_metadata); |
| 203 void OnSuccessIndexedDBKey(int32 ipc_thread_id, | 206 void OnSuccessIndexedDBKey(int32 ipc_thread_id, |
| 204 int32 ipc_response_id, | 207 int32 ipc_response_id, |
| 205 const IndexedDBKey& key); | 208 const IndexedDBKey& key); |
| 209 |
| 210 void OnSuccessOpenCursorOld( |
| 211 const IndexedDBMsg_CallbacksSuccessIDBCursorOld_Params& p); |
| 206 void OnSuccessOpenCursor( | 212 void OnSuccessOpenCursor( |
| 207 const IndexedDBMsg_CallbacksSuccessIDBCursor_Params& p); | 213 const IndexedDBMsg_CallbacksSuccessIDBCursor_Params& p); |
| 214 void OnSuccessCursorContinueOld( |
| 215 const IndexedDBMsg_CallbacksSuccessCursorContinueOld_Params& p); |
| 208 void OnSuccessCursorContinue( | 216 void OnSuccessCursorContinue( |
| 209 const IndexedDBMsg_CallbacksSuccessCursorContinue_Params& p); | 217 const IndexedDBMsg_CallbacksSuccessCursorContinue_Params& p); |
| 218 void OnSuccessCursorPrefetchOld( |
| 219 const IndexedDBMsg_CallbacksSuccessCursorPrefetchOld_Params& p); |
| 210 void OnSuccessCursorPrefetch( | 220 void OnSuccessCursorPrefetch( |
| 211 const IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params& p); | 221 const IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params& p); |
| 212 void OnSuccessStringList(int32 ipc_thread_id, | 222 void OnSuccessStringList(int32 ipc_thread_id, |
| 213 int32 ipc_response_id, | 223 int32 ipc_response_id, |
| 214 const std::vector<string16>& value); | 224 const std::vector<string16>& value); |
| 225 void OnSuccessValue( |
| 226 int32 ipc_thread_id, |
| 227 int32 ipc_response_id, |
| 228 const std::vector<char>& value); |
| 215 void OnSuccessSerializedScriptValue( | 229 void OnSuccessSerializedScriptValue( |
| 216 int32 ipc_thread_id, | 230 int32 ipc_thread_id, |
| 217 int32 ipc_response_id, | 231 int32 ipc_response_id, |
| 218 const SerializedScriptValue& value); | 232 const SerializedScriptValue& value); |
| 219 void OnSuccessSerializedScriptValueWithKey( | 233 void OnSuccessSerializedScriptValueWithKey( |
| 220 int32 ipc_thread_id, | 234 int32 ipc_thread_id, |
| 221 int32 ipc_response_id, | 235 int32 ipc_response_id, |
| 222 const SerializedScriptValue& value, | 236 const SerializedScriptValue& value, |
| 223 const IndexedDBKey& primary_key, | 237 const IndexedDBKey& primary_key, |
| 224 const IndexedDBKeyPath& key_path); | 238 const IndexedDBKeyPath& key_path); |
| 239 void OnSuccessValueWithKey( |
| 240 int32 ipc_thread_id, |
| 241 int32 ipc_response_id, |
| 242 const std::vector<char>& value, |
| 243 const IndexedDBKey& primary_key, |
| 244 const IndexedDBKeyPath& key_path); |
| 225 void OnSuccessInteger( | 245 void OnSuccessInteger( |
| 226 int32 ipc_thread_id, | 246 int32 ipc_thread_id, |
| 227 int32 ipc_response_id, | 247 int32 ipc_response_id, |
| 228 int64 value); | 248 int64 value); |
| 229 void OnSuccessUndefined( | 249 void OnSuccessUndefined( |
| 230 int32 ipc_thread_id, | 250 int32 ipc_thread_id, |
| 231 int32 ipc_response_id); | 251 int32 ipc_response_id); |
| 232 void OnError(int32 ipc_thread_id, | 252 void OnError(int32 ipc_thread_id, |
| 233 int32 ipc_response_id, | 253 int32 ipc_response_id, |
| 234 int code, | 254 int code, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 std::map<int32, RendererWebIDBCursorImpl*> cursors_; | 290 std::map<int32, RendererWebIDBCursorImpl*> cursors_; |
| 271 | 291 |
| 272 std::map<int32, RendererWebIDBDatabaseImpl*> databases_; | 292 std::map<int32, RendererWebIDBDatabaseImpl*> databases_; |
| 273 | 293 |
| 274 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); | 294 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); |
| 275 }; | 295 }; |
| 276 | 296 |
| 277 } // namespace content | 297 } // namespace content |
| 278 | 298 |
| 279 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ | 299 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ |
| OLD | NEW |