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_BROWSER_INDEXED_DB_INDEXED_DB_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DISPATCHER_HOST_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
| 11 #include <memory> |
11 #include <string> | 12 #include <string> |
12 #include <utility> | 13 #include <utility> |
13 #include <vector> | 14 #include <vector> |
14 | 15 |
15 #include "base/id_map.h" | 16 #include "base/id_map.h" |
16 #include "base/macros.h" | 17 #include "base/macros.h" |
17 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
18 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
19 #include "content/browser/blob_storage/chrome_blob_storage_context.h" | 20 #include "content/browser/blob_storage/chrome_blob_storage_context.h" |
20 #include "content/public/browser/browser_message_filter.h" | 21 #include "content/public/browser/browser_message_filter.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 void OnObserve(const IndexedDBHostMsg_DatabaseObserve_Params&); | 185 void OnObserve(const IndexedDBHostMsg_DatabaseObserve_Params&); |
185 void OnUnobserve(int32_t ipc_database_id, | 186 void OnUnobserve(int32_t ipc_database_id, |
186 const std::vector<int32_t>& observer_ids_to_remove); | 187 const std::vector<int32_t>& observer_ids_to_remove); |
187 | 188 |
188 void OnGet(const IndexedDBHostMsg_DatabaseGet_Params& params); | 189 void OnGet(const IndexedDBHostMsg_DatabaseGet_Params& params); |
189 void OnGetAll(const IndexedDBHostMsg_DatabaseGetAll_Params& params); | 190 void OnGetAll(const IndexedDBHostMsg_DatabaseGetAll_Params& params); |
190 // OnPutWrapper starts on the IO thread so that it can grab BlobDataHandles | 191 // OnPutWrapper starts on the IO thread so that it can grab BlobDataHandles |
191 // before posting to the IDB TaskRunner for the rest of the job. | 192 // before posting to the IDB TaskRunner for the rest of the job. |
192 void OnPutWrapper(const IndexedDBHostMsg_DatabasePut_Params& params); | 193 void OnPutWrapper(const IndexedDBHostMsg_DatabasePut_Params& params); |
193 void OnPut(const IndexedDBHostMsg_DatabasePut_Params& params, | 194 void OnPut(const IndexedDBHostMsg_DatabasePut_Params& params, |
194 std::vector<storage::BlobDataHandle*> handles); | 195 std::vector<std::unique_ptr<storage::BlobDataHandle>> handles); |
195 void OnSetIndexKeys( | 196 void OnSetIndexKeys( |
196 const IndexedDBHostMsg_DatabaseSetIndexKeys_Params& params); | 197 const IndexedDBHostMsg_DatabaseSetIndexKeys_Params& params); |
197 void OnSetIndexesReady(int32_t ipc_database_id, | 198 void OnSetIndexesReady(int32_t ipc_database_id, |
198 int64_t transaction_id, | 199 int64_t transaction_id, |
199 int64_t object_store_id, | 200 int64_t object_store_id, |
200 const std::vector<int64_t>& ids); | 201 const std::vector<int64_t>& ids); |
201 void OnOpenCursor(const IndexedDBHostMsg_DatabaseOpenCursor_Params& params); | 202 void OnOpenCursor(const IndexedDBHostMsg_DatabaseOpenCursor_Params& params); |
202 void OnCount(const IndexedDBHostMsg_DatabaseCount_Params& params); | 203 void OnCount(const IndexedDBHostMsg_DatabaseCount_Params& params); |
203 void OnDeleteRange( | 204 void OnDeleteRange( |
204 const IndexedDBHostMsg_DatabaseDeleteRange_Params& params); | 205 const IndexedDBHostMsg_DatabaseDeleteRange_Params& params); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 // Message processing. Most of the work is delegated to the dispatcher hosts | 286 // Message processing. Most of the work is delegated to the dispatcher hosts |
286 // below. | 287 // below. |
287 void OnIDBFactoryGetDatabaseNames( | 288 void OnIDBFactoryGetDatabaseNames( |
288 const IndexedDBHostMsg_FactoryGetDatabaseNames_Params& p); | 289 const IndexedDBHostMsg_FactoryGetDatabaseNames_Params& p); |
289 void OnIDBFactoryOpen(const IndexedDBHostMsg_FactoryOpen_Params& p); | 290 void OnIDBFactoryOpen(const IndexedDBHostMsg_FactoryOpen_Params& p); |
290 | 291 |
291 void OnIDBFactoryDeleteDatabase( | 292 void OnIDBFactoryDeleteDatabase( |
292 const IndexedDBHostMsg_FactoryDeleteDatabase_Params& p); | 293 const IndexedDBHostMsg_FactoryDeleteDatabase_Params& p); |
293 | 294 |
294 void OnAckReceivedBlobs(const std::vector<std::string>& uuids); | 295 void OnAckReceivedBlobs(const std::vector<std::string>& uuids); |
295 void OnPutHelper(const IndexedDBHostMsg_DatabasePut_Params& params, | 296 void OnPutHelper( |
296 std::vector<storage::BlobDataHandle*> handles); | 297 const IndexedDBHostMsg_DatabasePut_Params& params, |
| 298 std::vector<std::unique_ptr<storage::BlobDataHandle>> handles); |
297 | 299 |
298 void ResetDispatcherHosts(); | 300 void ResetDispatcherHosts(); |
299 void DropBlobData(const std::string& uuid); | 301 void DropBlobData(const std::string& uuid); |
300 | 302 |
301 // The getter holds the context until OnChannelConnected() can be called from | 303 // The getter holds the context until OnChannelConnected() can be called from |
302 // the IO thread, which will extract the net::URLRequestContext from it. | 304 // the IO thread, which will extract the net::URLRequestContext from it. |
303 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | 305 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
304 net::URLRequestContext* request_context_; | 306 net::URLRequestContext* request_context_; |
305 scoped_refptr<IndexedDBContextImpl> indexed_db_context_; | 307 scoped_refptr<IndexedDBContextImpl> indexed_db_context_; |
306 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; | 308 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
(...skipping 11 matching lines...) Expand all Loading... |
318 | 320 |
319 // Used to set file permissions for blob storage. | 321 // Used to set file permissions for blob storage. |
320 int ipc_process_id_; | 322 int ipc_process_id_; |
321 | 323 |
322 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBDispatcherHost); | 324 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBDispatcherHost); |
323 }; | 325 }; |
324 | 326 |
325 } // namespace content | 327 } // namespace content |
326 | 328 |
327 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DISPATCHER_HOST_H_ | 329 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DISPATCHER_HOST_H_ |
OLD | NEW |