| 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 <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 struct IndexedDBHostMsg_DatabaseDeleteRange_Params; | 22 struct IndexedDBHostMsg_DatabaseDeleteRange_Params; |
| 23 struct IndexedDBHostMsg_DatabaseGet_Params; | 23 struct IndexedDBHostMsg_DatabaseGet_Params; |
| 24 struct IndexedDBHostMsg_DatabaseOpenCursor_Params; | 24 struct IndexedDBHostMsg_DatabaseOpenCursor_Params; |
| 25 struct IndexedDBHostMsg_DatabasePut_Params; | 25 struct IndexedDBHostMsg_DatabasePut_Params; |
| 26 struct IndexedDBHostMsg_DatabaseSetIndexKeys_Params; | 26 struct IndexedDBHostMsg_DatabaseSetIndexKeys_Params; |
| 27 struct IndexedDBHostMsg_FactoryDeleteDatabase_Params; | 27 struct IndexedDBHostMsg_FactoryDeleteDatabase_Params; |
| 28 struct IndexedDBHostMsg_FactoryGetDatabaseNames_Params; | 28 struct IndexedDBHostMsg_FactoryGetDatabaseNames_Params; |
| 29 struct IndexedDBHostMsg_FactoryOpen_Params; | 29 struct IndexedDBHostMsg_FactoryOpen_Params; |
| 30 | 30 |
| 31 namespace content { | 31 namespace content { |
| 32 class IndexedDBConnection; |
| 32 class IndexedDBContextImpl; | 33 class IndexedDBContextImpl; |
| 33 class IndexedDBCursor; | 34 class IndexedDBCursor; |
| 34 class IndexedDBKey; | 35 class IndexedDBKey; |
| 35 class IndexedDBKeyPath; | 36 class IndexedDBKeyPath; |
| 36 class IndexedDBKeyRange; | 37 class IndexedDBKeyRange; |
| 37 class WebIDBDatabaseImpl; | |
| 38 struct IndexedDBDatabaseMetadata; | 38 struct IndexedDBDatabaseMetadata; |
| 39 | 39 |
| 40 // Handles all IndexedDB related messages from a particular renderer process. | 40 // Handles all IndexedDB related messages from a particular renderer process. |
| 41 class IndexedDBDispatcherHost : public BrowserMessageFilter { | 41 class IndexedDBDispatcherHost : public BrowserMessageFilter { |
| 42 public: | 42 public: |
| 43 // Only call the constructor from the UI thread. | 43 // Only call the constructor from the UI thread. |
| 44 IndexedDBDispatcherHost(int ipc_process_id, | 44 IndexedDBDispatcherHost(int ipc_process_id, |
| 45 IndexedDBContextImpl* indexed_db_context); | 45 IndexedDBContextImpl* indexed_db_context); |
| 46 | 46 |
| 47 static ::IndexedDBDatabaseMetadata ConvertMetadata( | 47 static ::IndexedDBDatabaseMetadata ConvertMetadata( |
| 48 const content::IndexedDBDatabaseMetadata& metadata); | 48 const content::IndexedDBDatabaseMetadata& metadata); |
| 49 | 49 |
| 50 // BrowserMessageFilter implementation. | 50 // BrowserMessageFilter implementation. |
| 51 virtual void OnChannelClosing() OVERRIDE; | 51 virtual void OnChannelClosing() OVERRIDE; |
| 52 virtual void OnDestruct() const OVERRIDE; | 52 virtual void OnDestruct() const OVERRIDE; |
| 53 virtual base::TaskRunner* OverrideTaskRunnerForMessage( | 53 virtual base::TaskRunner* OverrideTaskRunnerForMessage( |
| 54 const IPC::Message& message) OVERRIDE; | 54 const IPC::Message& message) OVERRIDE; |
| 55 virtual bool OnMessageReceived(const IPC::Message& message, | 55 virtual bool OnMessageReceived(const IPC::Message& message, |
| 56 bool* message_was_ok) OVERRIDE; | 56 bool* message_was_ok) OVERRIDE; |
| 57 | 57 |
| 58 void FinishTransaction(int64 host_transaction_id, bool committed); | 58 void FinishTransaction(int64 host_transaction_id, bool committed); |
| 59 | 59 |
| 60 // A shortcut for accessing our context. | 60 // A shortcut for accessing our context. |
| 61 IndexedDBContextImpl* Context() { return indexed_db_context_.get(); } | 61 IndexedDBContextImpl* Context() { return indexed_db_context_.get(); } |
| 62 | 62 |
| 63 // IndexedDBCallbacks call these methods to add the results into the | 63 // IndexedDBCallbacks call these methods to add the results into the |
| 64 // applicable map. See below for more details. | 64 // applicable map. See below for more details. |
| 65 int32 Add(IndexedDBCursor* idb_cursor); | 65 int32 Add(IndexedDBCursor* cursor); |
| 66 int32 Add(WebIDBDatabaseImpl* idb_database, | 66 int32 Add(IndexedDBConnection* connection, |
| 67 int32 ipc_thread_id, | 67 int32 ipc_thread_id, |
| 68 const GURL& origin_url); | 68 const GURL& origin_url); |
| 69 | 69 |
| 70 void RegisterTransactionId(int64 host_transaction_id, const GURL& origin_url); | 70 void RegisterTransactionId(int64 host_transaction_id, const GURL& origin_url); |
| 71 | 71 |
| 72 IndexedDBCursor* GetCursorFromId(int32 ipc_cursor_id); | 72 IndexedDBCursor* GetCursorFromId(int32 ipc_cursor_id); |
| 73 | 73 |
| 74 int64 HostTransactionId(int64 transaction_id); | 74 int64 HostTransactionId(int64 transaction_id); |
| 75 int64 RendererTransactionId(int64 host_transaction_id); | 75 int64 RendererTransactionId(int64 host_transaction_id); |
| 76 | 76 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 void OnCreateIndex( | 183 void OnCreateIndex( |
| 184 const IndexedDBHostMsg_DatabaseCreateIndex_Params& params); | 184 const IndexedDBHostMsg_DatabaseCreateIndex_Params& params); |
| 185 void OnDeleteIndex(int32 ipc_database_id, | 185 void OnDeleteIndex(int32 ipc_database_id, |
| 186 int64 transaction_id, | 186 int64 transaction_id, |
| 187 int64 object_store_id, | 187 int64 object_store_id, |
| 188 int64 index_id); | 188 int64 index_id); |
| 189 | 189 |
| 190 void OnAbort(int32 ipc_database_id, int64 transaction_id); | 190 void OnAbort(int32 ipc_database_id, int64 transaction_id); |
| 191 void OnCommit(int32 ipc_database_id, int64 transaction_id); | 191 void OnCommit(int32 ipc_database_id, int64 transaction_id); |
| 192 IndexedDBDispatcherHost* parent_; | 192 IndexedDBDispatcherHost* parent_; |
| 193 IDMap<WebIDBDatabaseImpl, IDMapOwnPointer> map_; | 193 IDMap<IndexedDBConnection, IDMapOwnPointer> map_; |
| 194 WebIDBObjectIDToURLMap database_url_map_; | 194 WebIDBObjectIDToURLMap database_url_map_; |
| 195 TransactionIDToSizeMap transaction_size_map_; | 195 TransactionIDToSizeMap transaction_size_map_; |
| 196 TransactionIDToURLMap transaction_url_map_; | 196 TransactionIDToURLMap transaction_url_map_; |
| 197 TransactionIDToDatabaseIDMap transaction_database_map_; | 197 TransactionIDToDatabaseIDMap transaction_database_map_; |
| 198 }; | 198 }; |
| 199 | 199 |
| 200 class CursorDispatcherHost { | 200 class CursorDispatcherHost { |
| 201 public: | 201 public: |
| 202 explicit CursorDispatcherHost(IndexedDBDispatcherHost* parent); | 202 explicit CursorDispatcherHost(IndexedDBDispatcherHost* parent); |
| 203 ~CursorDispatcherHost(); | 203 ~CursorDispatcherHost(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 234 | 234 |
| 235 // Used to dispatch messages to the correct view host. | 235 // Used to dispatch messages to the correct view host. |
| 236 int ipc_process_id_; | 236 int ipc_process_id_; |
| 237 | 237 |
| 238 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBDispatcherHost); | 238 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBDispatcherHost); |
| 239 }; | 239 }; |
| 240 | 240 |
| 241 } // namespace content | 241 } // namespace content |
| 242 | 242 |
| 243 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DISPATCHER_HOST_H_ | 243 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DISPATCHER_HOST_H_ |
| OLD | NEW |