| 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 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 16 #include "base/id_map.h" | 16 #include "base/id_map.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "base/strings/nullable_string16.h" | 19 #include "base/strings/nullable_string16.h" |
| 20 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
| 21 #include "content/common/indexed_db/indexed_db_constants.h" | 21 #include "content/common/indexed_db/indexed_db_constants.h" |
| 22 #include "content/public/child/worker_thread.h" | 22 #include "content/public/child/worker_thread.h" |
| 23 #include "ipc/ipc_sync_message_filter.h" | 23 #include "ipc/ipc_sync_message_filter.h" |
| 24 #include "third_party/WebKit/public/platform/WebBlobInfo.h" | 24 #include "third_party/WebKit/public/platform/WebBlobInfo.h" |
| 25 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBCallbacks.h
" | 25 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBCallbacks.h
" |
| 26 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBDatabaseCal
lbacks.h" | 26 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBDatabaseCal
lbacks.h" |
| 27 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" | 27 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" |
| 28 #include "url/gurl.h" | 28 #include "url/origin.h" |
| 29 | 29 |
| 30 struct IndexedDBDatabaseMetadata; | 30 struct IndexedDBDatabaseMetadata; |
| 31 struct IndexedDBMsg_CallbacksSuccessCursorContinue_Params; | 31 struct IndexedDBMsg_CallbacksSuccessCursorContinue_Params; |
| 32 struct IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params; | 32 struct IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params; |
| 33 struct IndexedDBMsg_CallbacksSuccessIDBCursor_Params; | 33 struct IndexedDBMsg_CallbacksSuccessIDBCursor_Params; |
| 34 struct IndexedDBMsg_CallbacksSuccessArray_Params; | 34 struct IndexedDBMsg_CallbacksSuccessArray_Params; |
| 35 struct IndexedDBMsg_CallbacksSuccessValue_Params; | 35 struct IndexedDBMsg_CallbacksSuccessValue_Params; |
| 36 struct IndexedDBMsg_CallbacksUpgradeNeeded_Params; | 36 struct IndexedDBMsg_CallbacksUpgradeNeeded_Params; |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 68 | 68 |
| 69 static blink::WebIDBMetadata ConvertMetadata( | 69 static blink::WebIDBMetadata ConvertMetadata( |
| 70 const IndexedDBDatabaseMetadata& idb_metadata); | 70 const IndexedDBDatabaseMetadata& idb_metadata); |
| 71 | 71 |
| 72 void OnMessageReceived(const IPC::Message& msg); | 72 void OnMessageReceived(const IPC::Message& msg); |
| 73 | 73 |
| 74 // This method is virtual so it can be overridden in unit tests. | 74 // This method is virtual so it can be overridden in unit tests. |
| 75 virtual bool Send(IPC::Message* msg); | 75 virtual bool Send(IPC::Message* msg); |
| 76 | 76 |
| 77 void RequestIDBFactoryGetDatabaseNames(blink::WebIDBCallbacks* callbacks, | 77 void RequestIDBFactoryGetDatabaseNames(blink::WebIDBCallbacks* callbacks, |
| 78 const GURL& origin); | 78 const url::Origin& origin); |
| 79 | 79 |
| 80 void RequestIDBFactoryOpen(const base::string16& name, | 80 void RequestIDBFactoryOpen(const base::string16& name, |
| 81 int64_t version, | 81 int64_t version, |
| 82 int64_t transaction_id, | 82 int64_t transaction_id, |
| 83 blink::WebIDBCallbacks* callbacks, | 83 blink::WebIDBCallbacks* callbacks, |
| 84 blink::WebIDBDatabaseCallbacks* database_callbacks, | 84 blink::WebIDBDatabaseCallbacks* database_callbacks, |
| 85 const GURL& origin); | 85 const url::Origin& origin); |
| 86 | 86 |
| 87 void RequestIDBFactoryDeleteDatabase(const base::string16& name, | 87 void RequestIDBFactoryDeleteDatabase(const base::string16& name, |
| 88 blink::WebIDBCallbacks* callbacks, | 88 blink::WebIDBCallbacks* callbacks, |
| 89 const GURL& origin); | 89 const url::Origin& origin); |
| 90 | 90 |
| 91 // This method is virtual so it can be overridden in unit tests. | 91 // This method is virtual so it can be overridden in unit tests. |
| 92 virtual void RequestIDBCursorAdvance(unsigned long count, | 92 virtual void RequestIDBCursorAdvance(unsigned long count, |
| 93 blink::WebIDBCallbacks* callbacks_ptr, | 93 blink::WebIDBCallbacks* callbacks_ptr, |
| 94 int32_t ipc_cursor_id, | 94 int32_t ipc_cursor_id, |
| 95 int64_t transaction_id); | 95 int64_t transaction_id); |
| 96 | 96 |
| 97 // This method is virtual so it can be overridden in unit tests. | 97 // This method is virtual so it can be overridden in unit tests. |
| 98 virtual void RequestIDBCursorContinue(const IndexedDBKey& key, | 98 virtual void RequestIDBCursorContinue(const IndexedDBKey& key, |
| 99 const IndexedDBKey& primary_key, | 99 const IndexedDBKey& primary_key, |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 std::map<int32_t, WebIDBCursorImpl*> cursors_; | 274 std::map<int32_t, WebIDBCursorImpl*> cursors_; |
| 275 | 275 |
| 276 std::map<int32_t, WebIDBDatabaseImpl*> databases_; | 276 std::map<int32_t, WebIDBDatabaseImpl*> databases_; |
| 277 | 277 |
| 278 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); | 278 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); |
| 279 }; | 279 }; |
| 280 | 280 |
| 281 } // namespace content | 281 } // namespace content |
| 282 | 282 |
| 283 #endif // CONTENT_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ | 283 #endif // CONTENT_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ |
| OLD | NEW |