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 <map> | 8 #include <map> |
| 9 #include <string> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
12 #include "base/id_map.h" | 13 #include "base/id_map.h" |
13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
14 #include "base/strings/nullable_string16.h" | 15 #include "base/strings/nullable_string16.h" |
15 #include "content/child/worker_task_runner.h" | 16 #include "content/child/worker_task_runner.h" |
16 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
17 #include "ipc/ipc_sync_message_filter.h" | 18 #include "ipc/ipc_sync_message_filter.h" |
18 #include "third_party/WebKit/public/platform/WebBlobInfo.h" | 19 #include "third_party/WebKit/public/platform/WebBlobInfo.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 FRIEND_TEST_ALL_PREFIXES(IndexedDBDispatcherTest, CursorTransactionId); | 176 FRIEND_TEST_ALL_PREFIXES(IndexedDBDispatcherTest, CursorTransactionId); |
176 FRIEND_TEST_ALL_PREFIXES(IndexedDBDispatcherTest, ValueSizeTest); | 177 FRIEND_TEST_ALL_PREFIXES(IndexedDBDispatcherTest, ValueSizeTest); |
177 | 178 |
178 enum { kAllCursors = -1 }; | 179 enum { kAllCursors = -1 }; |
179 | 180 |
180 static int32 CurrentWorkerId() { | 181 static int32 CurrentWorkerId() { |
181 return WorkerTaskRunner::Instance()->CurrentWorkerId(); | 182 return WorkerTaskRunner::Instance()->CurrentWorkerId(); |
182 } | 183 } |
183 | 184 |
184 template <typename T> | 185 template <typename T> |
185 void init_params(T& params, blink::WebIDBCallbacks* callbacks_ptr) { | 186 void init_params(T* params, blink::WebIDBCallbacks* callbacks_ptr) { |
186 scoped_ptr<blink::WebIDBCallbacks> callbacks(callbacks_ptr); | 187 scoped_ptr<blink::WebIDBCallbacks> callbacks(callbacks_ptr); |
187 params.ipc_thread_id = CurrentWorkerId(); | 188 params->ipc_thread_id = CurrentWorkerId(); |
188 params.ipc_callbacks_id = pending_callbacks_.Add(callbacks.release()); | 189 params->ipc_callbacks_id = pending_callbacks_.Add(callbacks.release()); |
189 } | 190 } |
190 | 191 |
191 // IDBCallback message handlers. | 192 // IDBCallback message handlers. |
192 void OnSuccessIDBDatabase(int32 ipc_thread_id, | 193 void OnSuccessIDBDatabase(int32 ipc_thread_id, |
193 int32 ipc_callbacks_id, | 194 int32 ipc_callbacks_id, |
194 int32 ipc_database_callbacks_id, | 195 int32 ipc_database_callbacks_id, |
195 int32 ipc_object_id, | 196 int32 ipc_object_id, |
196 const IndexedDBDatabaseMetadata& idb_metadata); | 197 const IndexedDBDatabaseMetadata& idb_metadata); |
197 void OnSuccessIndexedDBKey(int32 ipc_thread_id, | 198 void OnSuccessIndexedDBKey(int32 ipc_thread_id, |
198 int32 ipc_callbacks_id, | 199 int32 ipc_callbacks_id, |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 std::map<int32, WebIDBCursorImpl*> cursors_; | 258 std::map<int32, WebIDBCursorImpl*> cursors_; |
258 | 259 |
259 std::map<int32, WebIDBDatabaseImpl*> databases_; | 260 std::map<int32, WebIDBDatabaseImpl*> databases_; |
260 | 261 |
261 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); | 262 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); |
262 }; | 263 }; |
263 | 264 |
264 } // namespace content | 265 } // namespace content |
265 | 266 |
266 #endif // CONTENT_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ | 267 #endif // CONTENT_CHILD_INDEXED_DB_INDEXED_DB_DISPATCHER_H_ |
OLD | NEW |