| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ | 5 #ifndef CONTENT_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ |
| 6 #define CONTENT_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ | 6 #define CONTENT_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" | 28 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" |
| 29 #include "url/origin.h" | 29 #include "url/origin.h" |
| 30 | 30 |
| 31 struct IndexedDBDatabaseMetadata; | 31 struct IndexedDBDatabaseMetadata; |
| 32 struct IndexedDBMsg_CallbacksSuccessCursorContinue_Params; | 32 struct IndexedDBMsg_CallbacksSuccessCursorContinue_Params; |
| 33 struct IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params; | 33 struct IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params; |
| 34 struct IndexedDBMsg_CallbacksSuccessIDBCursor_Params; | 34 struct IndexedDBMsg_CallbacksSuccessIDBCursor_Params; |
| 35 struct IndexedDBMsg_CallbacksSuccessArray_Params; | 35 struct IndexedDBMsg_CallbacksSuccessArray_Params; |
| 36 struct IndexedDBMsg_CallbacksSuccessValue_Params; | 36 struct IndexedDBMsg_CallbacksSuccessValue_Params; |
| 37 struct IndexedDBMsg_CallbacksUpgradeNeeded_Params; | 37 struct IndexedDBMsg_CallbacksUpgradeNeeded_Params; |
| 38 struct IndexedDBMsg_Observation; |
| 39 struct IndexedDBMsg_ObserverChanges; |
| 38 | 40 |
| 39 namespace blink { | 41 namespace blink { |
| 40 class WebData; | 42 class WebData; |
| 43 struct WebIDBObservation; |
| 41 } | 44 } |
| 42 | 45 |
| 43 namespace content { | 46 namespace content { |
| 44 class IndexedDBKey; | 47 class IndexedDBKey; |
| 45 class IndexedDBKeyPath; | 48 class IndexedDBKeyPath; |
| 46 class IndexedDBKeyRange; | 49 class IndexedDBKeyRange; |
| 47 class WebIDBCursorImpl; | 50 class WebIDBCursorImpl; |
| 48 class WebIDBDatabaseImpl; | 51 class WebIDBDatabaseImpl; |
| 49 class ThreadSafeSender; | 52 class ThreadSafeSender; |
| 50 | 53 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 62 // |thread_safe_sender| needs to be passed in because if the call leads to | 65 // |thread_safe_sender| needs to be passed in because if the call leads to |
| 63 // construction it will be needed. | 66 // construction it will be needed. |
| 64 static IndexedDBDispatcher* ThreadSpecificInstance( | 67 static IndexedDBDispatcher* ThreadSpecificInstance( |
| 65 ThreadSafeSender* thread_safe_sender); | 68 ThreadSafeSender* thread_safe_sender); |
| 66 | 69 |
| 67 // WorkerThread::Observer implementation. | 70 // WorkerThread::Observer implementation. |
| 68 void WillStopCurrentWorkerThread() override; | 71 void WillStopCurrentWorkerThread() override; |
| 69 | 72 |
| 70 static blink::WebIDBMetadata ConvertMetadata( | 73 static blink::WebIDBMetadata ConvertMetadata( |
| 71 const IndexedDBDatabaseMetadata& idb_metadata); | 74 const IndexedDBDatabaseMetadata& idb_metadata); |
| 75 static std::vector<blink::WebIDBObservation> ConvertObservations( |
| 76 const std::vector<IndexedDBMsg_Observation>& idb_observation); |
| 72 | 77 |
| 73 void OnMessageReceived(const IPC::Message& msg); | 78 void OnMessageReceived(const IPC::Message& msg); |
| 74 | 79 |
| 75 // This method is virtual so it can be overridden in unit tests. | 80 // This method is virtual so it can be overridden in unit tests. |
| 76 virtual bool Send(IPC::Message* msg); | 81 virtual bool Send(IPC::Message* msg); |
| 77 | 82 |
| 78 int32_t AddIDBObserver(int32_t ipc_database_id, | 83 int32_t AddIDBObserver(int32_t ipc_database_id, |
| 79 int64_t transaction_id, | 84 int64_t transaction_id, |
| 80 std::unique_ptr<blink::WebIDBObserver> observer); | 85 std::unique_ptr<blink::WebIDBObserver> observer); |
| 81 | 86 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 int64_t existing_version); | 255 int64_t existing_version); |
| 251 void OnUpgradeNeeded(const IndexedDBMsg_CallbacksUpgradeNeeded_Params& p); | 256 void OnUpgradeNeeded(const IndexedDBMsg_CallbacksUpgradeNeeded_Params& p); |
| 252 void OnAbort(int32_t ipc_thread_id, | 257 void OnAbort(int32_t ipc_thread_id, |
| 253 int32_t ipc_database_id, | 258 int32_t ipc_database_id, |
| 254 int64_t transaction_id, | 259 int64_t transaction_id, |
| 255 int code, | 260 int code, |
| 256 const base::string16& message); | 261 const base::string16& message); |
| 257 void OnComplete(int32_t ipc_thread_id, | 262 void OnComplete(int32_t ipc_thread_id, |
| 258 int32_t ipc_database_id, | 263 int32_t ipc_database_id, |
| 259 int64_t transaction_id); | 264 int64_t transaction_id); |
| 265 void OnDatabaseChanges(int32_t ipc_thread_id, |
| 266 int32_t ipc_database_id, |
| 267 const IndexedDBMsg_ObserverChanges&); |
| 268 |
| 260 void OnForcedClose(int32_t ipc_thread_id, int32_t ipc_database_id); | 269 void OnForcedClose(int32_t ipc_thread_id, int32_t ipc_database_id); |
| 261 void OnVersionChange(int32_t ipc_thread_id, | 270 void OnVersionChange(int32_t ipc_thread_id, |
| 262 int32_t ipc_database_id, | 271 int32_t ipc_database_id, |
| 263 int64_t old_version, | 272 int64_t old_version, |
| 264 int64_t new_version); | 273 int64_t new_version); |
| 265 | 274 |
| 266 // Reset cursor prefetch caches for all cursors except exception_cursor_id. | 275 // Reset cursor prefetch caches for all cursors except exception_cursor_id. |
| 267 void ResetCursorPrefetchCaches(int64_t transaction_id, | 276 void ResetCursorPrefetchCaches(int64_t transaction_id, |
| 268 int32_t ipc_exception_cursor_id); | 277 int32_t ipc_exception_cursor_id); |
| 269 | 278 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 291 std::map<int32_t, WebIDBCursorImpl*> cursors_; | 300 std::map<int32_t, WebIDBCursorImpl*> cursors_; |
| 292 | 301 |
| 293 std::map<int32_t, WebIDBDatabaseImpl*> databases_; | 302 std::map<int32_t, WebIDBDatabaseImpl*> databases_; |
| 294 | 303 |
| 295 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); | 304 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); |
| 296 }; | 305 }; |
| 297 | 306 |
| 298 } // namespace content | 307 } // namespace content |
| 299 | 308 |
| 300 #endif // CONTENT_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ | 309 #endif // CONTENT_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ |
| OLD | NEW |