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 // Message definition file, included multiple times, hence no include guard. | 5 // Message definition file, included multiple times, hence no include guard. |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "content/common/indexed_db/indexed_db_key.h" | 9 #include "content/common/indexed_db/indexed_db_key.h" |
10 #include "content/common/indexed_db/indexed_db_key_path.h" | 10 #include "content/common/indexed_db/indexed_db_key_path.h" |
11 #include "content/common/indexed_db/indexed_db_key_range.h" | 11 #include "content/common/indexed_db/indexed_db_key_range.h" |
12 #include "content/common/indexed_db/indexed_db_param_traits.h" | 12 #include "content/common/indexed_db/indexed_db_param_traits.h" |
13 #include "ipc/ipc_message_macros.h" | 13 #include "ipc/ipc_message_macros.h" |
14 #include "ipc/ipc_param_traits.h" | 14 #include "ipc/ipc_param_traits.h" |
15 #include "third_party/WebKit/public/platform/WebIDBCursor.h" | 15 #include "third_party/WebKit/public/platform/WebIDBCursor.h" |
16 #include "third_party/WebKit/public/platform/WebIDBDatabase.h" | 16 #include "third_party/WebKit/public/platform/WebIDBDatabase.h" |
| 17 #include "url/gurl.h" |
17 | 18 |
18 #define IPC_MESSAGE_START IndexedDBMsgStart | 19 #define IPC_MESSAGE_START IndexedDBMsgStart |
19 | 20 |
20 // Argument structures used in messages | 21 // Argument structures used in messages |
21 | 22 |
22 IPC_ENUM_TRAITS(blink::WebIDBCursor::Direction) | 23 IPC_ENUM_TRAITS(blink::WebIDBCursor::Direction) |
23 IPC_ENUM_TRAITS(blink::WebIDBDatabase::PutMode) | 24 IPC_ENUM_TRAITS(blink::WebIDBDatabase::PutMode) |
24 IPC_ENUM_TRAITS(blink::WebIDBDatabase::TaskType) | 25 IPC_ENUM_TRAITS(blink::WebIDBDatabase::TaskType) |
25 | 26 |
26 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBDataLoss, blink::WebIDBDataLossTotal) | 27 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBDataLoss, blink::WebIDBDataLossTotal) |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // The object store's id. | 105 // The object store's id. |
105 IPC_STRUCT_MEMBER(int64, object_store_id) | 106 IPC_STRUCT_MEMBER(int64, object_store_id) |
106 // The index's id. | 107 // The index's id. |
107 IPC_STRUCT_MEMBER(int64, index_id) | 108 IPC_STRUCT_MEMBER(int64, index_id) |
108 // The serialized key range. | 109 // The serialized key range. |
109 IPC_STRUCT_MEMBER(content::IndexedDBKeyRange, key_range) | 110 IPC_STRUCT_MEMBER(content::IndexedDBKeyRange, key_range) |
110 // If this is just retrieving the key | 111 // If this is just retrieving the key |
111 IPC_STRUCT_MEMBER(bool, key_only) | 112 IPC_STRUCT_MEMBER(bool, key_only) |
112 IPC_STRUCT_END() | 113 IPC_STRUCT_END() |
113 | 114 |
| 115 IPC_STRUCT_BEGIN(IndexedDBMsg_BlobOrFileInfo) |
| 116 IPC_STRUCT_MEMBER(bool, is_file) |
| 117 IPC_STRUCT_MEMBER(std::string, uuid) |
| 118 IPC_STRUCT_MEMBER(string16, mime_type) |
| 119 IPC_STRUCT_MEMBER(uint64, size) |
| 120 IPC_STRUCT_MEMBER(string16, file_path) |
| 121 IPC_STRUCT_MEMBER(string16, file_name) |
| 122 IPC_STRUCT_MEMBER(double, last_modified) |
| 123 IPC_STRUCT_END() |
| 124 |
114 // Used to set a value in an object store. | 125 // Used to set a value in an object store. |
115 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabasePut_Params) | 126 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabasePut_Params) |
116 // The id any response should contain. | 127 // The id any response should contain. |
117 IPC_STRUCT_MEMBER(int32, ipc_thread_id) | 128 IPC_STRUCT_MEMBER(int32, ipc_thread_id) |
118 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) | 129 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) |
119 // The database the object store belongs to. | 130 // The database the object store belongs to. |
120 IPC_STRUCT_MEMBER(int32, ipc_database_id) | 131 IPC_STRUCT_MEMBER(int32, ipc_database_id) |
121 // The transaction it's associated with. | 132 // The transaction it's associated with. |
122 IPC_STRUCT_MEMBER(int64, transaction_id) | 133 IPC_STRUCT_MEMBER(int64, transaction_id) |
123 // The object store's id. | 134 // The object store's id. |
124 IPC_STRUCT_MEMBER(int64, object_store_id) | 135 IPC_STRUCT_MEMBER(int64, object_store_id) |
125 // The index's id. | 136 // The index's id. |
126 IPC_STRUCT_MEMBER(int64, index_id) | 137 IPC_STRUCT_MEMBER(int64, index_id) |
127 // The value to set. | 138 // The value to set. |
128 IPC_STRUCT_MEMBER(std::string, value) | 139 IPC_STRUCT_MEMBER(std::string, value) |
129 // The key to set it on (may not be "valid"/set in some cases). | 140 // The key to set it on (may not be "valid"/set in some cases). |
130 IPC_STRUCT_MEMBER(content::IndexedDBKey, key) | 141 IPC_STRUCT_MEMBER(content::IndexedDBKey, key) |
131 // Whether this is an add or a put. | 142 // Whether this is an add or a put. |
132 IPC_STRUCT_MEMBER(blink::WebIDBDatabase::PutMode, put_mode) | 143 IPC_STRUCT_MEMBER(blink::WebIDBDatabase::PutMode, put_mode) |
133 // The names of the indexes used below. | 144 // The names of the indexes used below. |
134 IPC_STRUCT_MEMBER(std::vector<int64>, index_ids) | 145 IPC_STRUCT_MEMBER(std::vector<int64>, index_ids) |
135 // The keys for each index, such that each inner vector corresponds | 146 // The keys for each index, such that each inner vector corresponds |
136 // to each index named in index_names, respectively. | 147 // to each index named in index_names, respectively. |
137 IPC_STRUCT_MEMBER(std::vector<std::vector<content::IndexedDBKey> >, | 148 IPC_STRUCT_MEMBER(std::vector<std::vector<content::IndexedDBKey> >, |
138 index_keys) | 149 index_keys) |
| 150 // Sideband data for any blob or file encoded in value. |
| 151 IPC_STRUCT_MEMBER(std::vector<IndexedDBMsg_BlobOrFileInfo>, blob_or_file_info) |
139 IPC_STRUCT_END() | 152 IPC_STRUCT_END() |
140 | 153 |
141 // Used to open both cursors and object cursors in IndexedDB. | 154 // Used to open both cursors and object cursors in IndexedDB. |
142 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseOpenCursor_Params) | 155 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseOpenCursor_Params) |
143 // The response should have these ids. | 156 // The response should have these ids. |
144 IPC_STRUCT_MEMBER(int32, ipc_thread_id) | 157 IPC_STRUCT_MEMBER(int32, ipc_thread_id) |
145 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) | 158 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) |
146 // The database the object store belongs to. | 159 // The database the object store belongs to. |
147 IPC_STRUCT_MEMBER(int32, ipc_database_id) | 160 IPC_STRUCT_MEMBER(int32, ipc_database_id) |
148 // The transaction this request belongs to. | 161 // The transaction this request belongs to. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 IPC_STRUCT_MEMBER(bool, multi_entry) | 241 IPC_STRUCT_MEMBER(bool, multi_entry) |
229 IPC_STRUCT_END() | 242 IPC_STRUCT_END() |
230 | 243 |
231 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessIDBCursor_Params) | 244 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessIDBCursor_Params) |
232 IPC_STRUCT_MEMBER(int32, ipc_thread_id) | 245 IPC_STRUCT_MEMBER(int32, ipc_thread_id) |
233 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) | 246 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) |
234 IPC_STRUCT_MEMBER(int32, ipc_cursor_id) | 247 IPC_STRUCT_MEMBER(int32, ipc_cursor_id) |
235 IPC_STRUCT_MEMBER(content::IndexedDBKey, key) | 248 IPC_STRUCT_MEMBER(content::IndexedDBKey, key) |
236 IPC_STRUCT_MEMBER(content::IndexedDBKey, primary_key) | 249 IPC_STRUCT_MEMBER(content::IndexedDBKey, primary_key) |
237 IPC_STRUCT_MEMBER(std::string, value) | 250 IPC_STRUCT_MEMBER(std::string, value) |
| 251 // Sideband data for any blob or file encoded in value. |
| 252 IPC_STRUCT_MEMBER(std::vector<IndexedDBMsg_BlobOrFileInfo>, blob_or_file_info) |
238 IPC_STRUCT_END() | 253 IPC_STRUCT_END() |
239 | 254 |
240 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessCursorContinue_Params) | 255 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessCursorContinue_Params) |
241 IPC_STRUCT_MEMBER(int32, ipc_thread_id) | 256 IPC_STRUCT_MEMBER(int32, ipc_thread_id) |
242 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) | 257 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) |
243 IPC_STRUCT_MEMBER(int32, ipc_cursor_id) | 258 IPC_STRUCT_MEMBER(int32, ipc_cursor_id) |
244 IPC_STRUCT_MEMBER(content::IndexedDBKey, key) | 259 IPC_STRUCT_MEMBER(content::IndexedDBKey, key) |
245 IPC_STRUCT_MEMBER(content::IndexedDBKey, primary_key) | 260 IPC_STRUCT_MEMBER(content::IndexedDBKey, primary_key) |
246 IPC_STRUCT_MEMBER(std::string, value) | 261 IPC_STRUCT_MEMBER(std::string, value) |
| 262 // Sideband data for any blob or file encoded in value. |
| 263 IPC_STRUCT_MEMBER(std::vector<IndexedDBMsg_BlobOrFileInfo>, blob_or_file_info) |
247 IPC_STRUCT_END() | 264 IPC_STRUCT_END() |
248 | 265 |
249 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params) | 266 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params) |
250 IPC_STRUCT_MEMBER(int32, ipc_thread_id) | 267 IPC_STRUCT_MEMBER(int32, ipc_thread_id) |
251 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) | 268 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) |
252 IPC_STRUCT_MEMBER(int32, ipc_cursor_id) | 269 IPC_STRUCT_MEMBER(int32, ipc_cursor_id) |
253 IPC_STRUCT_MEMBER(std::vector<content::IndexedDBKey>, keys) | 270 IPC_STRUCT_MEMBER(std::vector<content::IndexedDBKey>, keys) |
254 IPC_STRUCT_MEMBER(std::vector<content::IndexedDBKey>, primary_keys) | 271 IPC_STRUCT_MEMBER(std::vector<content::IndexedDBKey>, primary_keys) |
255 IPC_STRUCT_MEMBER(std::vector<std::string>, values) | 272 IPC_STRUCT_MEMBER(std::vector<std::string>, values) |
| 273 // Sideband data for any blob or file encoded in value. |
| 274 IPC_STRUCT_MEMBER(std::vector<std::vector<IndexedDBMsg_BlobOrFileInfo> >, |
| 275 blob_or_file_infos) |
| 276 IPC_STRUCT_END() |
| 277 |
| 278 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessValue_Params) |
| 279 IPC_STRUCT_MEMBER(int32, ipc_thread_id) |
| 280 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) |
| 281 IPC_STRUCT_MEMBER(std::string, value) |
| 282 // Sideband data for any blob or file encoded in value. |
| 283 IPC_STRUCT_MEMBER(std::vector<IndexedDBMsg_BlobOrFileInfo>, blob_or_file_info) |
| 284 IPC_STRUCT_END() |
| 285 |
| 286 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessValueWithKey_Params) |
| 287 IPC_STRUCT_MEMBER(int32, ipc_thread_id) |
| 288 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) |
| 289 IPC_STRUCT_MEMBER(std::string, value) |
| 290 IPC_STRUCT_MEMBER(content::IndexedDBKey, primary_key) |
| 291 IPC_STRUCT_MEMBER(content::IndexedDBKeyPath, key_path) |
| 292 // Sideband data for any blob or file encoded in value. |
| 293 IPC_STRUCT_MEMBER(std::vector<IndexedDBMsg_BlobOrFileInfo>, blob_or_file_info) |
256 IPC_STRUCT_END() | 294 IPC_STRUCT_END() |
257 | 295 |
258 IPC_STRUCT_BEGIN(IndexedDBIndexMetadata) | 296 IPC_STRUCT_BEGIN(IndexedDBIndexMetadata) |
259 IPC_STRUCT_MEMBER(int64, id) | 297 IPC_STRUCT_MEMBER(int64, id) |
260 IPC_STRUCT_MEMBER(string16, name) | 298 IPC_STRUCT_MEMBER(string16, name) |
261 IPC_STRUCT_MEMBER(content::IndexedDBKeyPath, keyPath) | 299 IPC_STRUCT_MEMBER(content::IndexedDBKeyPath, keyPath) |
262 IPC_STRUCT_MEMBER(bool, unique) | 300 IPC_STRUCT_MEMBER(bool, unique) |
263 IPC_STRUCT_MEMBER(bool, multiEntry) | 301 IPC_STRUCT_MEMBER(bool, multiEntry) |
264 IPC_STRUCT_END() | 302 IPC_STRUCT_END() |
265 | 303 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 IPC_MESSAGE_CONTROL5(IndexedDBMsg_CallbacksSuccessIDBDatabase, | 352 IPC_MESSAGE_CONTROL5(IndexedDBMsg_CallbacksSuccessIDBDatabase, |
315 int32 /* ipc_thread_id */, | 353 int32 /* ipc_thread_id */, |
316 int32 /* ipc_callbacks_id */, | 354 int32 /* ipc_callbacks_id */, |
317 int32 /* ipc_database_callbacks_id */, | 355 int32 /* ipc_database_callbacks_id */, |
318 int32 /* ipc_database_id */, | 356 int32 /* ipc_database_id */, |
319 IndexedDBDatabaseMetadata) | 357 IndexedDBDatabaseMetadata) |
320 IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksSuccessIndexedDBKey, | 358 IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksSuccessIndexedDBKey, |
321 int32 /* ipc_thread_id */, | 359 int32 /* ipc_thread_id */, |
322 int32 /* ipc_callbacks_id */, | 360 int32 /* ipc_callbacks_id */, |
323 content::IndexedDBKey /* indexed_db_key */) | 361 content::IndexedDBKey /* indexed_db_key */) |
324 IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksSuccessValue, | 362 |
325 int32 /* ipc_thread_id */, | 363 IPC_MESSAGE_CONTROL1(IndexedDBMsg_CallbacksSuccessValue, |
326 int32 /* ipc_callbacks_id */, | 364 IndexedDBMsg_CallbacksSuccessValue_Params) |
327 std::string /* value */) | 365 |
328 IPC_MESSAGE_CONTROL5(IndexedDBMsg_CallbacksSuccessValueWithKey, | 366 IPC_MESSAGE_CONTROL1(IndexedDBMsg_CallbacksSuccessValueWithKey, |
329 int32 /* ipc_thread_id */, | 367 IndexedDBMsg_CallbacksSuccessValueWithKey_Params) |
330 int32 /* ipc_callbacks_id */, | 368 |
331 std::string /* value */, | |
332 content::IndexedDBKey /* indexed_db_key */, | |
333 content::IndexedDBKeyPath /* indexed_db_keypath */) | |
334 IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksSuccessInteger, | 369 IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksSuccessInteger, |
335 int32 /* ipc_thread_id */, | 370 int32 /* ipc_thread_id */, |
336 int32 /* ipc_callbacks_id */, | 371 int32 /* ipc_callbacks_id */, |
337 int64 /* value */) | 372 int64 /* value */) |
338 IPC_MESSAGE_CONTROL2(IndexedDBMsg_CallbacksSuccessUndefined, | 373 IPC_MESSAGE_CONTROL2(IndexedDBMsg_CallbacksSuccessUndefined, |
339 int32 /* ipc_thread_id */, | 374 int32 /* ipc_thread_id */, |
340 int32 /* ipc_callbacks_id */) | 375 int32 /* ipc_callbacks_id */) |
341 IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksSuccessStringList, | 376 IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksSuccessStringList, |
342 int32 /* ipc_thread_id */, | 377 int32 /* ipc_thread_id */, |
343 int32 /* ipc_callbacks_id */, | 378 int32 /* ipc_callbacks_id */, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 IndexedDBHostMsg_FactoryGetDatabaseNames_Params) | 447 IndexedDBHostMsg_FactoryGetDatabaseNames_Params) |
413 | 448 |
414 // WebIDBFactory::open() message. | 449 // WebIDBFactory::open() message. |
415 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_FactoryOpen, | 450 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_FactoryOpen, |
416 IndexedDBHostMsg_FactoryOpen_Params) | 451 IndexedDBHostMsg_FactoryOpen_Params) |
417 | 452 |
418 // WebIDBFactory::deleteDatabase() message. | 453 // WebIDBFactory::deleteDatabase() message. |
419 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_FactoryDeleteDatabase, | 454 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_FactoryDeleteDatabase, |
420 IndexedDBHostMsg_FactoryDeleteDatabase_Params) | 455 IndexedDBHostMsg_FactoryDeleteDatabase_Params) |
421 | 456 |
| 457 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_AckReceivedBlobs, |
| 458 std::vector<std::string>) /* uuids */ |
| 459 |
422 // WebIDBDatabase::createObjectStore() message. | 460 // WebIDBDatabase::createObjectStore() message. |
423 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseCreateObjectStore, | 461 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseCreateObjectStore, |
424 IndexedDBHostMsg_DatabaseCreateObjectStore_Params) | 462 IndexedDBHostMsg_DatabaseCreateObjectStore_Params) |
425 | 463 |
426 // WebIDBDatabase::deleteObjectStore() message. | 464 // WebIDBDatabase::deleteObjectStore() message. |
427 IPC_MESSAGE_CONTROL3(IndexedDBHostMsg_DatabaseDeleteObjectStore, | 465 IPC_MESSAGE_CONTROL3(IndexedDBHostMsg_DatabaseDeleteObjectStore, |
428 int32, /* ipc_database_id */ | 466 int32, /* ipc_database_id */ |
429 int64, /* transaction_id */ | 467 int64, /* transaction_id */ |
430 int64) /* object_store_id */ | 468 int64) /* object_store_id */ |
431 | 469 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 | 536 |
499 // WebIDBDatabase::commit() message. | 537 // WebIDBDatabase::commit() message. |
500 IPC_MESSAGE_CONTROL2(IndexedDBHostMsg_DatabaseCommit, | 538 IPC_MESSAGE_CONTROL2(IndexedDBHostMsg_DatabaseCommit, |
501 int32, /* ipc_database_id */ | 539 int32, /* ipc_database_id */ |
502 int64) /* transaction_id */ | 540 int64) /* transaction_id */ |
503 | 541 |
504 // WebIDBDatabase::~WebIDBCursor() message. | 542 // WebIDBDatabase::~WebIDBCursor() message. |
505 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_CursorDestroyed, | 543 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_CursorDestroyed, |
506 int32 /* ipc_cursor_id */) | 544 int32 /* ipc_cursor_id */) |
507 | 545 |
OLD | NEW |