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> |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 int64_t HostTransactionId(int64_t transaction_id); | 108 int64_t HostTransactionId(int64_t transaction_id); |
109 int64_t RendererTransactionId(int64_t host_transaction_id); | 109 int64_t RendererTransactionId(int64_t host_transaction_id); |
110 | 110 |
111 // These are called to decode a host transaction ID, for diagnostic purposes. | 111 // These are called to decode a host transaction ID, for diagnostic purposes. |
112 static uint32_t TransactionIdToRendererTransactionId( | 112 static uint32_t TransactionIdToRendererTransactionId( |
113 int64_t host_transaction_id); | 113 int64_t host_transaction_id); |
114 static uint32_t TransactionIdToProcessId(int64_t host_transaction_id); | 114 static uint32_t TransactionIdToProcessId(int64_t host_transaction_id); |
115 | 115 |
116 std::string HoldBlobData(const IndexedDBBlobInfo& blob_info); | 116 std::string HoldBlobData(const IndexedDBBlobInfo& blob_info); |
117 | 117 |
| 118 // True if the channel is closing/closed and outstanding requests |
| 119 // can be abandoned. Only access on IndexedDB thread. |
| 120 bool IsOpen() const; |
| 121 |
118 private: | 122 private: |
119 // Friends to enable OnDestruct() delegation. | 123 // Friends to enable OnDestruct() delegation. |
120 friend class BrowserThread; | 124 friend class BrowserThread; |
121 friend class base::DeleteHelper<IndexedDBDispatcherHost>; | 125 friend class base::DeleteHelper<IndexedDBDispatcherHost>; |
122 | 126 |
123 // Used in nested classes. | 127 // Used in nested classes. |
124 typedef std::map<int64_t, int64_t> TransactionIDToDatabaseIDMap; | 128 typedef std::map<int64_t, int64_t> TransactionIDToDatabaseIDMap; |
125 typedef std::map<int64_t, uint64_t> TransactionIDToSizeMap; | 129 typedef std::map<int64_t, uint64_t> TransactionIDToSizeMap; |
126 typedef std::map<int64_t, url::Origin> TransactionIDToOriginMap; | 130 typedef std::map<int64_t, url::Origin> TransactionIDToOriginMap; |
127 typedef std::map<int32_t, url::Origin> WebIDBObjectIDToOriginMap; | 131 typedef std::map<int32_t, url::Origin> WebIDBObjectIDToOriginMap; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; | 313 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
310 | 314 |
311 // Maps blob uuid to a pair (handle, ref count). Entry is added and/or count | 315 // Maps blob uuid to a pair (handle, ref count). Entry is added and/or count |
312 // is incremented in HoldBlobData(), and count is decremented and/or entry | 316 // is incremented in HoldBlobData(), and count is decremented and/or entry |
313 // removed in DropBlobData(). | 317 // removed in DropBlobData(). |
314 std::map<std::string, | 318 std::map<std::string, |
315 std::pair<std::unique_ptr<storage::BlobDataHandle>, int>> | 319 std::pair<std::unique_ptr<storage::BlobDataHandle>, int>> |
316 blob_data_handle_map_; | 320 blob_data_handle_map_; |
317 | 321 |
318 // Only access on IndexedDB thread. | 322 // Only access on IndexedDB thread. |
| 323 bool is_open_ = true; |
319 std::unique_ptr<DatabaseDispatcherHost> database_dispatcher_host_; | 324 std::unique_ptr<DatabaseDispatcherHost> database_dispatcher_host_; |
320 std::unique_ptr<CursorDispatcherHost> cursor_dispatcher_host_; | 325 std::unique_ptr<CursorDispatcherHost> cursor_dispatcher_host_; |
321 | 326 |
322 // Used to set file permissions for blob storage. | 327 // Used to set file permissions for blob storage. |
323 int ipc_process_id_; | 328 int ipc_process_id_; |
324 | 329 |
325 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBDispatcherHost); | 330 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBDispatcherHost); |
326 }; | 331 }; |
327 | 332 |
328 } // namespace content | 333 } // namespace content |
329 | 334 |
330 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DISPATCHER_HOST_H_ | 335 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DISPATCHER_HOST_H_ |
OLD | NEW |