| 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_IN_PROCESS_WEBKIT_INDEXED_DB_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_DISPATCHER_HOST_H_ |
| 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_DISPATCHER_HOST_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/id_map.h" | 12 #include "base/id_map.h" |
| 13 #include "content/public/browser/browser_message_filter.h" | 13 #include "content/public/browser/browser_message_filter.h" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebExceptionCode.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebExceptionCode.h" |
| 15 | 15 |
| 16 class GURL; | 16 class GURL; |
| 17 struct IndexedDBDatabaseMetadata; | 17 struct IndexedDBDatabaseMetadata; |
| 18 struct IndexedDBHostMsg_DatabaseCreateObjectStore_Params; | 18 struct IndexedDBHostMsg_DatabaseCreateObjectStore_Params; |
| 19 struct IndexedDBHostMsg_FactoryDeleteDatabase_Params; | 19 struct IndexedDBHostMsg_FactoryDeleteDatabase_Params; |
| 20 struct IndexedDBHostMsg_FactoryGetDatabaseNames_Params; | 20 struct IndexedDBHostMsg_FactoryGetDatabaseNames_Params; |
| 21 struct IndexedDBHostMsg_FactoryOpen_Params; | 21 struct IndexedDBHostMsg_FactoryOpen_Params; |
| 22 struct IndexedDBHostMsg_IndexCount_Params; | 22 struct IndexedDBHostMsg_IndexCount_Params; |
| 23 struct IndexedDBHostMsg_IndexOpenCursor_Params; | 23 struct IndexedDBHostMsg_IndexOpenCursor_Params; |
| 24 struct IndexedDBHostMsg_ObjectStoreCount_Params; | 24 struct IndexedDBHostMsg_ObjectStoreCount_Params; |
| 25 struct IndexedDBHostMsg_ObjectStoreCreateIndex_Params; | 25 struct IndexedDBHostMsg_ObjectStoreCreateIndex_Params; |
| 26 struct IndexedDBHostMsg_ObjectStoreOpenCursor_Params; | 26 struct IndexedDBHostMsg_ObjectStoreOpenCursor_Params; |
| 27 struct IndexedDBHostMsg_ObjectStorePutOld_Params; | |
| 28 struct IndexedDBHostMsg_ObjectStorePut_Params; | 27 struct IndexedDBHostMsg_ObjectStorePut_Params; |
| 29 | 28 |
| 30 namespace WebKit { | 29 namespace WebKit { |
| 31 class WebDOMStringList; | 30 class WebDOMStringList; |
| 32 class WebIDBCursor; | 31 class WebIDBCursor; |
| 33 class WebIDBDatabase; | 32 class WebIDBDatabase; |
| 34 class WebIDBIndex; | 33 class WebIDBIndex; |
| 35 class WebIDBObjectStore; | 34 class WebIDBObjectStore; |
| 36 class WebIDBTransaction; | 35 class WebIDBTransaction; |
| 37 struct WebIDBMetadata; | 36 struct WebIDBMetadata; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 ~DatabaseDispatcherHost(); | 109 ~DatabaseDispatcherHost(); |
| 111 | 110 |
| 112 bool OnMessageReceived(const IPC::Message& message, bool *msg_is_ok); | 111 bool OnMessageReceived(const IPC::Message& message, bool *msg_is_ok); |
| 113 void Send(IPC::Message* message); | 112 void Send(IPC::Message* message); |
| 114 | 113 |
| 115 void OnMetadata(int32 idb_database_id, | 114 void OnMetadata(int32 idb_database_id, |
| 116 IndexedDBDatabaseMetadata* metadata); | 115 IndexedDBDatabaseMetadata* metadata); |
| 117 void OnCreateObjectStore( | 116 void OnCreateObjectStore( |
| 118 const IndexedDBHostMsg_DatabaseCreateObjectStore_Params& params, | 117 const IndexedDBHostMsg_DatabaseCreateObjectStore_Params& params, |
| 119 int32* object_store_id, WebKit::WebExceptionCode* ec); | 118 int32* object_store_id, WebKit::WebExceptionCode* ec); |
| 120 void OnDeleteObjectStoreOld(int32 idb_database_id, | |
| 121 const string16& name, | |
| 122 int32 transaction_id, | |
| 123 WebKit::WebExceptionCode* ec); | |
| 124 void OnDeleteObjectStore(int32 idb_database_id, | 119 void OnDeleteObjectStore(int32 idb_database_id, |
| 125 int64 object_store_id, | 120 int64 object_store_id, |
| 126 int32 transaction_id, | 121 int32 transaction_id, |
| 127 WebKit::WebExceptionCode* ec); | 122 WebKit::WebExceptionCode* ec); |
| 128 void OnSetVersion(int32 idb_database_id, | 123 void OnSetVersion(int32 idb_database_id, |
| 129 int32 thread_id, | 124 int32 thread_id, |
| 130 int32 response_id, | 125 int32 response_id, |
| 131 const string16& version, | 126 const string16& version, |
| 132 WebKit::WebExceptionCode* ec); | 127 WebKit::WebExceptionCode* ec); |
| 133 void OnTransactionOld(int32 thread_id, | |
| 134 int32 idb_database_id, | |
| 135 const std::vector<string16>& names, | |
| 136 int32 mode, | |
| 137 int32* idb_transaction_id, | |
| 138 WebKit::WebExceptionCode* ec); | |
| 139 void OnTransaction(int32 thread_id, | 128 void OnTransaction(int32 thread_id, |
| 140 int32 idb_database_id, | 129 int32 idb_database_id, |
| 141 const std::vector<int64>& names, | 130 const std::vector<int64>& names, |
| 142 int32 mode, | 131 int32 mode, |
| 143 int32* idb_transaction_id); | 132 int32* idb_transaction_id); |
| 144 void OnOpen(int32 idb_database_id, int32 thread_id, int32 response_id); | 133 void OnOpen(int32 idb_database_id, int32 thread_id, int32 response_id); |
| 145 void OnClose(int32 idb_database_id); | 134 void OnClose(int32 idb_database_id); |
| 146 void OnDestroyed(int32 idb_database_id); | 135 void OnDestroyed(int32 idb_database_id); |
| 147 | 136 |
| 148 IndexedDBDispatcherHost* parent_; | 137 IndexedDBDispatcherHost* parent_; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 ~ObjectStoreDispatcherHost(); | 173 ~ObjectStoreDispatcherHost(); |
| 185 | 174 |
| 186 bool OnMessageReceived(const IPC::Message& message, bool *msg_is_ok); | 175 bool OnMessageReceived(const IPC::Message& message, bool *msg_is_ok); |
| 187 void Send(IPC::Message* message); | 176 void Send(IPC::Message* message); |
| 188 | 177 |
| 189 void OnGet(int idb_object_store_id, | 178 void OnGet(int idb_object_store_id, |
| 190 int32 thread_id, | 179 int32 thread_id, |
| 191 int32 response_id, | 180 int32 response_id, |
| 192 const IndexedDBKeyRange& key_range, | 181 const IndexedDBKeyRange& key_range, |
| 193 int32 transaction_id); | 182 int32 transaction_id); |
| 194 void OnPutOld(const IndexedDBHostMsg_ObjectStorePutOld_Params& params); | |
| 195 void OnPut(const IndexedDBHostMsg_ObjectStorePut_Params& params); | 183 void OnPut(const IndexedDBHostMsg_ObjectStorePut_Params& params); |
| 196 void OnSetIndexKeysOld( | |
| 197 int32 idb_object_store_id, | |
| 198 const IndexedDBKey& primary_key, | |
| 199 const std::vector<string16>& index_names, | |
| 200 const std::vector<std::vector<IndexedDBKey> >& index_keys, | |
| 201 int32 transaction_id); | |
| 202 void OnSetIndexKeys( | 184 void OnSetIndexKeys( |
| 203 int32 idb_object_store_id, | 185 int32 idb_object_store_id, |
| 204 const IndexedDBKey& primary_key, | 186 const IndexedDBKey& primary_key, |
| 205 const std::vector<int64>& index_ids, | 187 const std::vector<int64>& index_ids, |
| 206 const std::vector<std::vector<IndexedDBKey> >& index_keys, | 188 const std::vector<std::vector<IndexedDBKey> >& index_keys, |
| 207 int32 transaction_id); | 189 int32 transaction_id); |
| 208 void OnSetIndexesReadyOld(int32 idb_object_store_id, | |
| 209 const std::vector<string16>& names, | |
| 210 int32 transaction_id); | |
| 211 void OnSetIndexesReady(int32 idb_object_store_id, | 190 void OnSetIndexesReady(int32 idb_object_store_id, |
| 212 const std::vector<int64>& ids, | 191 const std::vector<int64>& ids, |
| 213 int32 transaction_id); | 192 int32 transaction_id); |
| 214 void OnDelete(int idb_object_store_id, | 193 void OnDelete(int idb_object_store_id, |
| 215 int32 thread_id, | 194 int32 thread_id, |
| 216 int32 response_id, | 195 int32 response_id, |
| 217 const IndexedDBKeyRange& key_range, | 196 const IndexedDBKeyRange& key_range, |
| 218 int32 transaction_id); | 197 int32 transaction_id); |
| 219 void OnClear(int idb_object_store_id, | 198 void OnClear(int idb_object_store_id, |
| 220 int32 thread_id, | 199 int32 thread_id, |
| 221 int32 response_id, | 200 int32 response_id, |
| 222 int32 transaction_id); | 201 int32 transaction_id); |
| 223 void OnCreateIndex( | 202 void OnCreateIndex( |
| 224 const IndexedDBHostMsg_ObjectStoreCreateIndex_Params& params, | 203 const IndexedDBHostMsg_ObjectStoreCreateIndex_Params& params, |
| 225 int32* index_id, | 204 int32* index_id, |
| 226 WebKit::WebExceptionCode* ec); | 205 WebKit::WebExceptionCode* ec); |
| 227 void OnIndexOld(int32 idb_object_store_id, | |
| 228 const string16& name, | |
| 229 int32* idb_index_id, | |
| 230 WebKit::WebExceptionCode* ec); | |
| 231 void OnIndex(int32 idb_object_store_id, | 206 void OnIndex(int32 idb_object_store_id, |
| 232 int64 index_id, | 207 int64 index_id, |
| 233 int32* idb_index_id); | 208 int32* idb_index_id); |
| 234 void OnDeleteIndexOld(int32 idb_object_store_id, | |
| 235 const string16& name, | |
| 236 int32 transaction_id, | |
| 237 WebKit::WebExceptionCode* ec); | |
| 238 void OnDeleteIndex(int32 idb_object_store_id, | 209 void OnDeleteIndex(int32 idb_object_store_id, |
| 239 int64 index_id, | 210 int64 index_id, |
| 240 int32 transaction_id, | 211 int32 transaction_id, |
| 241 WebKit::WebExceptionCode* ec); | 212 WebKit::WebExceptionCode* ec); |
| 242 void OnOpenCursor( | 213 void OnOpenCursor( |
| 243 const IndexedDBHostMsg_ObjectStoreOpenCursor_Params& params); | 214 const IndexedDBHostMsg_ObjectStoreOpenCursor_Params& params); |
| 244 void OnCount(const IndexedDBHostMsg_ObjectStoreCount_Params& params); | 215 void OnCount(const IndexedDBHostMsg_ObjectStoreCount_Params& params); |
| 245 void OnDestroyed(int32 idb_object_store_id); | 216 void OnDestroyed(int32 idb_object_store_id); |
| 246 | 217 |
| 247 IndexedDBDispatcherHost* parent_; | 218 IndexedDBDispatcherHost* parent_; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 class TransactionDispatcherHost { | 257 class TransactionDispatcherHost { |
| 287 public: | 258 public: |
| 288 explicit TransactionDispatcherHost(IndexedDBDispatcherHost* parent); | 259 explicit TransactionDispatcherHost(IndexedDBDispatcherHost* parent); |
| 289 ~TransactionDispatcherHost(); | 260 ~TransactionDispatcherHost(); |
| 290 | 261 |
| 291 bool OnMessageReceived(const IPC::Message& message, bool *msg_is_ok); | 262 bool OnMessageReceived(const IPC::Message& message, bool *msg_is_ok); |
| 292 void Send(IPC::Message* message); | 263 void Send(IPC::Message* message); |
| 293 | 264 |
| 294 void OnCommit(int32 transaction_id); | 265 void OnCommit(int32 transaction_id); |
| 295 void OnAbort(int32 transaction_id); | 266 void OnAbort(int32 transaction_id); |
| 296 void OnObjectStoreOld(int32 transaction_id, | |
| 297 const string16& name, | |
| 298 int32* object_store_ipc_id, | |
| 299 WebKit::WebExceptionCode* ec); | |
| 300 void OnObjectStore(int32 transaction_id, | 267 void OnObjectStore(int32 transaction_id, |
| 301 int64 object_store_id, | 268 int64 object_store_id, |
| 302 int32* object_store_ipc_id, | 269 int32* object_store_ipc_id, |
| 303 WebKit::WebExceptionCode* ec); | 270 WebKit::WebExceptionCode* ec); |
| 304 void OnDidCompleteTaskEvents(int transaction_id); | 271 void OnDidCompleteTaskEvents(int transaction_id); |
| 305 void OnDestroyed(int32 idb_transaction_id); | 272 void OnDestroyed(int32 idb_transaction_id); |
| 306 | 273 |
| 307 IndexedDBDispatcherHost* parent_; | 274 IndexedDBDispatcherHost* parent_; |
| 308 typedef IDMap<WebKit::WebIDBTransaction, IDMapOwnPointer> MapType; | 275 typedef IDMap<WebKit::WebIDBTransaction, IDMapOwnPointer> MapType; |
| 309 MapType map_; | 276 MapType map_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 322 | 289 |
| 323 // Used to dispatch messages to the correct view host. | 290 // Used to dispatch messages to the correct view host. |
| 324 int process_id_; | 291 int process_id_; |
| 325 | 292 |
| 326 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBDispatcherHost); | 293 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBDispatcherHost); |
| 327 }; | 294 }; |
| 328 | 295 |
| 329 } // namespace content | 296 } // namespace content |
| 330 | 297 |
| 331 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_DISPATCHER_HOST_H_ | 298 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_DISPATCHER_HOST_H_ |
| OLD | NEW |