| 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 <utility> |
| 7 #include <vector> | 8 #include <vector> |
| 8 | 9 |
| 9 #include "content/common/indexed_db/indexed_db_key.h" | 10 #include "content/common/indexed_db/indexed_db_key.h" |
| 10 #include "content/common/indexed_db/indexed_db_key_path.h" | 11 #include "content/common/indexed_db/indexed_db_key_path.h" |
| 11 #include "content/common/indexed_db/indexed_db_key_range.h" | 12 #include "content/common/indexed_db/indexed_db_key_range.h" |
| 12 #include "content/common/indexed_db/indexed_db_param_traits.h" | 13 #include "content/common/indexed_db/indexed_db_param_traits.h" |
| 13 #include "ipc/ipc_message_macros.h" | 14 #include "ipc/ipc_message_macros.h" |
| 14 #include "ipc/ipc_param_traits.h" | 15 #include "ipc/ipc_param_traits.h" |
| 15 #include "third_party/WebKit/public/platform/WebIDBCursor.h" | 16 #include "third_party/WebKit/public/platform/WebIDBCursor.h" |
| 16 #include "third_party/WebKit/public/platform/WebIDBDatabase.h" | 17 #include "third_party/WebKit/public/platform/WebIDBDatabase.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) |
| 27 | 28 |
| 29 // An index id, and corresponding set of keys to insert. |
| 30 typedef std::pair<int64, std::vector<content::IndexedDBKey> > IndexKeys; |
| 31 |
| 28 // Used to enumerate indexed databases. | 32 // Used to enumerate indexed databases. |
| 29 IPC_STRUCT_BEGIN(IndexedDBHostMsg_FactoryGetDatabaseNames_Params) | 33 IPC_STRUCT_BEGIN(IndexedDBHostMsg_FactoryGetDatabaseNames_Params) |
| 30 // The response should have these ids. | 34 // The response should have these ids. |
| 31 IPC_STRUCT_MEMBER(int32, ipc_thread_id) | 35 IPC_STRUCT_MEMBER(int32, ipc_thread_id) |
| 32 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) | 36 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) |
| 33 // The string id of the origin doing the initiating. | 37 // The string id of the origin doing the initiating. |
| 34 IPC_STRUCT_MEMBER(std::string, database_identifier) | 38 IPC_STRUCT_MEMBER(std::string, database_identifier) |
| 35 IPC_STRUCT_END() | 39 IPC_STRUCT_END() |
| 36 | 40 |
| 37 // Used to open an indexed database. | 41 // Used to open an indexed database. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // The object store's id. | 127 // The object store's id. |
| 124 IPC_STRUCT_MEMBER(int64, object_store_id) | 128 IPC_STRUCT_MEMBER(int64, object_store_id) |
| 125 // The index's id. | 129 // The index's id. |
| 126 IPC_STRUCT_MEMBER(int64, index_id) | 130 IPC_STRUCT_MEMBER(int64, index_id) |
| 127 // The value to set. | 131 // The value to set. |
| 128 IPC_STRUCT_MEMBER(std::string, value) | 132 IPC_STRUCT_MEMBER(std::string, value) |
| 129 // The key to set it on (may not be "valid"/set in some cases). | 133 // The key to set it on (may not be "valid"/set in some cases). |
| 130 IPC_STRUCT_MEMBER(content::IndexedDBKey, key) | 134 IPC_STRUCT_MEMBER(content::IndexedDBKey, key) |
| 131 // Whether this is an add or a put. | 135 // Whether this is an add or a put. |
| 132 IPC_STRUCT_MEMBER(blink::WebIDBDatabase::PutMode, put_mode) | 136 IPC_STRUCT_MEMBER(blink::WebIDBDatabase::PutMode, put_mode) |
| 133 // The names of the indexes used below. | 137 // The index ids and the list of keys for each index. |
| 134 IPC_STRUCT_MEMBER(std::vector<int64>, index_ids) | 138 IPC_STRUCT_MEMBER(std::vector<IndexKeys>, index_keys) |
| 135 // The keys for each index, such that each inner vector corresponds | |
| 136 // to each index named in index_names, respectively. | |
| 137 IPC_STRUCT_MEMBER(std::vector<std::vector<content::IndexedDBKey> >, | |
| 138 index_keys) | |
| 139 IPC_STRUCT_END() | 139 IPC_STRUCT_END() |
| 140 | 140 |
| 141 // Used to open both cursors and object cursors in IndexedDB. | 141 // Used to open both cursors and object cursors in IndexedDB. |
| 142 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseOpenCursor_Params) | 142 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseOpenCursor_Params) |
| 143 // The response should have these ids. | 143 // The response should have these ids. |
| 144 IPC_STRUCT_MEMBER(int32, ipc_thread_id) | 144 IPC_STRUCT_MEMBER(int32, ipc_thread_id) |
| 145 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) | 145 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) |
| 146 // The database the object store belongs to. | 146 // The database the object store belongs to. |
| 147 IPC_STRUCT_MEMBER(int32, ipc_database_id) | 147 IPC_STRUCT_MEMBER(int32, ipc_database_id) |
| 148 // The transaction this request belongs to. | 148 // The transaction this request belongs to. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 | 194 |
| 195 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseSetIndexKeys_Params) | 195 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseSetIndexKeys_Params) |
| 196 // The IPC id of the database. | 196 // The IPC id of the database. |
| 197 IPC_STRUCT_MEMBER(int32, ipc_database_id) | 197 IPC_STRUCT_MEMBER(int32, ipc_database_id) |
| 198 // The transaction this request belongs to. | 198 // The transaction this request belongs to. |
| 199 IPC_STRUCT_MEMBER(int64, transaction_id) | 199 IPC_STRUCT_MEMBER(int64, transaction_id) |
| 200 // The object store's id. | 200 // The object store's id. |
| 201 IPC_STRUCT_MEMBER(int64, object_store_id) | 201 IPC_STRUCT_MEMBER(int64, object_store_id) |
| 202 // The object store key that we're setting index keys for. | 202 // The object store key that we're setting index keys for. |
| 203 IPC_STRUCT_MEMBER(content::IndexedDBKey, primary_key) | 203 IPC_STRUCT_MEMBER(content::IndexedDBKey, primary_key) |
| 204 // The indexes that we're setting keys on. | 204 // The index ids and the list of keys for each index. |
| 205 IPC_STRUCT_MEMBER(std::vector<int64>, index_ids) | 205 IPC_STRUCT_MEMBER(std::vector<IndexKeys>, index_keys) |
| 206 // A list of index keys for each index. | |
| 207 IPC_STRUCT_MEMBER(std::vector<std::vector<content::IndexedDBKey> >, | |
| 208 index_keys) | |
| 209 IPC_STRUCT_END() | 206 IPC_STRUCT_END() |
| 210 | 207 |
| 211 // Used to create an index. | 208 // Used to create an index. |
| 212 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseCreateIndex_Params) | 209 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseCreateIndex_Params) |
| 213 // The transaction this is associated with. | 210 // The transaction this is associated with. |
| 214 IPC_STRUCT_MEMBER(int64, transaction_id) | 211 IPC_STRUCT_MEMBER(int64, transaction_id) |
| 215 // The database being used. | 212 // The database being used. |
| 216 IPC_STRUCT_MEMBER(int32, ipc_database_id) | 213 IPC_STRUCT_MEMBER(int32, ipc_database_id) |
| 217 // The object store the index belongs to. | 214 // The object store the index belongs to. |
| 218 IPC_STRUCT_MEMBER(int64, object_store_id) | 215 IPC_STRUCT_MEMBER(int64, object_store_id) |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 int64) /* transaction_id */ | 494 int64) /* transaction_id */ |
| 498 | 495 |
| 499 // WebIDBDatabase::commit() message. | 496 // WebIDBDatabase::commit() message. |
| 500 IPC_MESSAGE_CONTROL2(IndexedDBHostMsg_DatabaseCommit, | 497 IPC_MESSAGE_CONTROL2(IndexedDBHostMsg_DatabaseCommit, |
| 501 int32, /* ipc_database_id */ | 498 int32, /* ipc_database_id */ |
| 502 int64) /* transaction_id */ | 499 int64) /* transaction_id */ |
| 503 | 500 |
| 504 // WebIDBDatabase::~WebIDBCursor() message. | 501 // WebIDBDatabase::~WebIDBCursor() message. |
| 505 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_CursorDestroyed, | 502 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_CursorDestroyed, |
| 506 int32 /* ipc_cursor_id */) | 503 int32 /* ipc_cursor_id */) |
| 507 | |
| OLD | NEW |