| 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 <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "content/common/indexed_db/indexed_db_key.h" | 11 #include "content/common/indexed_db/indexed_db_key.h" |
| 12 #include "content/common/indexed_db/indexed_db_key_path.h" | 12 #include "content/common/indexed_db/indexed_db_key_path.h" |
| 13 #include "content/common/indexed_db/indexed_db_key_range.h" | 13 #include "content/common/indexed_db/indexed_db_key_range.h" |
| 14 #include "content/common/indexed_db/indexed_db_param_traits.h" | 14 #include "content/common/indexed_db/indexed_db_param_traits.h" |
| 15 #include "ipc/ipc_message_macros.h" | 15 #include "ipc/ipc_message_macros.h" |
| 16 #include "ipc/ipc_param_traits.h" | 16 #include "ipc/ipc_param_traits.h" |
| 17 #include "third_party/WebKit/public/platform/WebIDBCursor.h" | 17 #include "third_party/WebKit/public/platform/WebIDBTypes.h" |
| 18 #include "third_party/WebKit/public/platform/WebIDBDatabase.h" | |
| 19 | 18 |
| 20 #undef IPC_MESSAGE_EXPORT | 19 #undef IPC_MESSAGE_EXPORT |
| 21 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 20 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 22 #define IPC_MESSAGE_START IndexedDBMsgStart | 21 #define IPC_MESSAGE_START IndexedDBMsgStart |
| 23 | 22 |
| 24 // Argument structures used in messages | 23 // Argument structures used in messages |
| 25 | 24 |
| 26 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBCursor::Direction, | 25 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBCursorDirection, |
| 27 blink::WebIDBCursor::DirectionLast) | 26 blink::WebIDBCursorDirectionLast) |
| 28 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBDatabase::PutMode, | 27 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBPutMode, blink::WebIDBPutModeLast) |
| 29 blink::WebIDBDatabase::PutModeLast) | 28 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBTaskType, blink::WebIDBTaskTypeLast) |
| 30 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBDatabase::TaskType, | 29 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBTransactionMode, |
| 31 blink::WebIDBDatabase::TaskTypeLast) | 30 blink::WebIDBTransactionModeLast) |
| 32 IPC_ENUM_TRAITS(blink::WebIDBDatabase::TransactionMode) | |
| 33 | 31 |
| 34 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBDataLoss, blink::WebIDBDataLossTotal) | 32 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBDataLoss, blink::WebIDBDataLossTotal) |
| 35 | 33 |
| 36 // An index id, and corresponding set of keys to insert. | 34 // An index id, and corresponding set of keys to insert. |
| 37 typedef std::pair<int64, std::vector<content::IndexedDBKey> > IndexKeys; | 35 typedef std::pair<int64, std::vector<content::IndexedDBKey> > IndexKeys; |
| 38 | 36 |
| 39 // Used to enumerate indexed databases. | 37 // Used to enumerate indexed databases. |
| 40 IPC_STRUCT_BEGIN(IndexedDBHostMsg_FactoryGetDatabaseNames_Params) | 38 IPC_STRUCT_BEGIN(IndexedDBHostMsg_FactoryGetDatabaseNames_Params) |
| 41 // The response should have these ids. | 39 // The response should have these ids. |
| 42 IPC_STRUCT_MEMBER(int32, ipc_thread_id) | 40 IPC_STRUCT_MEMBER(int32, ipc_thread_id) |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 IPC_STRUCT_MEMBER(int32, ipc_thread_id) | 76 IPC_STRUCT_MEMBER(int32, ipc_thread_id) |
| 79 // The database the object store belongs to. | 77 // The database the object store belongs to. |
| 80 IPC_STRUCT_MEMBER(int32, ipc_database_id) | 78 IPC_STRUCT_MEMBER(int32, ipc_database_id) |
| 81 // The transaction id as minted by the frontend. | 79 // The transaction id as minted by the frontend. |
| 82 IPC_STRUCT_MEMBER(int64, transaction_id) | 80 IPC_STRUCT_MEMBER(int64, transaction_id) |
| 83 // To get to WebIDBDatabaseCallbacks. | 81 // To get to WebIDBDatabaseCallbacks. |
| 84 IPC_STRUCT_MEMBER(int32, ipc_database_callbacks_id) | 82 IPC_STRUCT_MEMBER(int32, ipc_database_callbacks_id) |
| 85 // The scope of the transaction. | 83 // The scope of the transaction. |
| 86 IPC_STRUCT_MEMBER(std::vector<int64>, object_store_ids) | 84 IPC_STRUCT_MEMBER(std::vector<int64>, object_store_ids) |
| 87 // The transaction mode. | 85 // The transaction mode. |
| 88 IPC_STRUCT_MEMBER(blink::WebIDBDatabase::TransactionMode, mode) | 86 IPC_STRUCT_MEMBER(blink::WebIDBTransactionMode, mode) |
| 89 IPC_STRUCT_END() | 87 IPC_STRUCT_END() |
| 90 | 88 |
| 91 // Used to create an object store. | 89 // Used to create an object store. |
| 92 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseCreateObjectStore_Params) | 90 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseCreateObjectStore_Params) |
| 93 // The database the object store belongs to. | 91 // The database the object store belongs to. |
| 94 IPC_STRUCT_MEMBER(int32, ipc_database_id) | 92 IPC_STRUCT_MEMBER(int32, ipc_database_id) |
| 95 // The transaction its associated with. | 93 // The transaction its associated with. |
| 96 IPC_STRUCT_MEMBER(int64, transaction_id) | 94 IPC_STRUCT_MEMBER(int64, transaction_id) |
| 97 // The storage id of the object store. | 95 // The storage id of the object store. |
| 98 IPC_STRUCT_MEMBER(int64, object_store_id) | 96 IPC_STRUCT_MEMBER(int64, object_store_id) |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 IPC_STRUCT_MEMBER(int64, transaction_id) | 141 IPC_STRUCT_MEMBER(int64, transaction_id) |
| 144 // The object store's id. | 142 // The object store's id. |
| 145 IPC_STRUCT_MEMBER(int64, object_store_id) | 143 IPC_STRUCT_MEMBER(int64, object_store_id) |
| 146 // The index's id. | 144 // The index's id. |
| 147 IPC_STRUCT_MEMBER(int64, index_id) | 145 IPC_STRUCT_MEMBER(int64, index_id) |
| 148 // The value to set. | 146 // The value to set. |
| 149 IPC_STRUCT_MEMBER(std::string, value) | 147 IPC_STRUCT_MEMBER(std::string, value) |
| 150 // The key to set it on (may not be "valid"/set in some cases). | 148 // The key to set it on (may not be "valid"/set in some cases). |
| 151 IPC_STRUCT_MEMBER(content::IndexedDBKey, key) | 149 IPC_STRUCT_MEMBER(content::IndexedDBKey, key) |
| 152 // Whether this is an add or a put. | 150 // Whether this is an add or a put. |
| 153 IPC_STRUCT_MEMBER(blink::WebIDBDatabase::PutMode, put_mode) | 151 IPC_STRUCT_MEMBER(blink::WebIDBPutMode, put_mode) |
| 154 // The index ids and the list of keys for each index. | 152 // The index ids and the list of keys for each index. |
| 155 IPC_STRUCT_MEMBER(std::vector<IndexKeys>, index_keys) | 153 IPC_STRUCT_MEMBER(std::vector<IndexKeys>, index_keys) |
| 156 // Sideband data for any blob or file encoded in value. | 154 // Sideband data for any blob or file encoded in value. |
| 157 IPC_STRUCT_MEMBER(std::vector<IndexedDBMsg_BlobOrFileInfo>, blob_or_file_info) | 155 IPC_STRUCT_MEMBER(std::vector<IndexedDBMsg_BlobOrFileInfo>, blob_or_file_info) |
| 158 IPC_STRUCT_END() | 156 IPC_STRUCT_END() |
| 159 | 157 |
| 160 // Used to open both cursors and object cursors in IndexedDB. | 158 // Used to open both cursors and object cursors in IndexedDB. |
| 161 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseOpenCursor_Params) | 159 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseOpenCursor_Params) |
| 162 // The response should have these ids. | 160 // The response should have these ids. |
| 163 IPC_STRUCT_MEMBER(int32, ipc_thread_id) | 161 IPC_STRUCT_MEMBER(int32, ipc_thread_id) |
| 164 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) | 162 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) |
| 165 // The database the object store belongs to. | 163 // The database the object store belongs to. |
| 166 IPC_STRUCT_MEMBER(int32, ipc_database_id) | 164 IPC_STRUCT_MEMBER(int32, ipc_database_id) |
| 167 // The transaction this request belongs to. | 165 // The transaction this request belongs to. |
| 168 IPC_STRUCT_MEMBER(int64, transaction_id) | 166 IPC_STRUCT_MEMBER(int64, transaction_id) |
| 169 // The object store. | 167 // The object store. |
| 170 IPC_STRUCT_MEMBER(int64, object_store_id) | 168 IPC_STRUCT_MEMBER(int64, object_store_id) |
| 171 // The index if any. | 169 // The index if any. |
| 172 IPC_STRUCT_MEMBER(int64, index_id) | 170 IPC_STRUCT_MEMBER(int64, index_id) |
| 173 // The serialized key range. | 171 // The serialized key range. |
| 174 IPC_STRUCT_MEMBER(content::IndexedDBKeyRange, key_range) | 172 IPC_STRUCT_MEMBER(content::IndexedDBKeyRange, key_range) |
| 175 // The direction of this cursor. | 173 // The direction of this cursor. |
| 176 IPC_STRUCT_MEMBER(blink::WebIDBCursor::Direction, direction) | 174 IPC_STRUCT_MEMBER(blink::WebIDBCursorDirection, direction) |
| 177 // If this is just retrieving the key | 175 // If this is just retrieving the key |
| 178 IPC_STRUCT_MEMBER(bool, key_only) | 176 IPC_STRUCT_MEMBER(bool, key_only) |
| 179 // The priority of this cursor. | 177 // The priority of this cursor. |
| 180 IPC_STRUCT_MEMBER(blink::WebIDBDatabase::TaskType, task_type) | 178 IPC_STRUCT_MEMBER(blink::WebIDBTaskType, task_type) |
| 181 IPC_STRUCT_END() | 179 IPC_STRUCT_END() |
| 182 | 180 |
| 183 // Used to open both cursors and object cursors in IndexedDB. | 181 // Used to open both cursors and object cursors in IndexedDB. |
| 184 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseCount_Params) | 182 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseCount_Params) |
| 185 // The response should have these ids. | 183 // The response should have these ids. |
| 186 IPC_STRUCT_MEMBER(int32, ipc_thread_id) | 184 IPC_STRUCT_MEMBER(int32, ipc_thread_id) |
| 187 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) | 185 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) |
| 188 // The transaction this request belongs to. | 186 // The transaction this request belongs to. |
| 189 IPC_STRUCT_MEMBER(int64, transaction_id) | 187 IPC_STRUCT_MEMBER(int64, transaction_id) |
| 190 // The IPC id of the database. | 188 // The IPC id of the database. |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 int64) /* transaction_id */ | 536 int64) /* transaction_id */ |
| 539 | 537 |
| 540 // WebIDBDatabase::commit() message. | 538 // WebIDBDatabase::commit() message. |
| 541 IPC_MESSAGE_CONTROL2(IndexedDBHostMsg_DatabaseCommit, | 539 IPC_MESSAGE_CONTROL2(IndexedDBHostMsg_DatabaseCommit, |
| 542 int32, /* ipc_database_id */ | 540 int32, /* ipc_database_id */ |
| 543 int64) /* transaction_id */ | 541 int64) /* transaction_id */ |
| 544 | 542 |
| 545 // WebIDBDatabase::~WebIDBCursor() message. | 543 // WebIDBDatabase::~WebIDBCursor() message. |
| 546 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_CursorDestroyed, | 544 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_CursorDestroyed, |
| 547 int32 /* ipc_cursor_id */) | 545 int32 /* ipc_cursor_id */) |
| OLD | NEW |