Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: content/common/indexed_db/indexed_db_messages.h

Issue 11567029: Proxy new objectstore/index methods through IPC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix nits, use faster copies Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/public/common/serialized_script_value.h" 13 #include "content/public/common/serialized_script_value.h"
14 #include "ipc/ipc_message_macros.h" 14 #include "ipc/ipc_message_macros.h"
15 #include "ipc/ipc_param_traits.h" 15 #include "ipc/ipc_param_traits.h"
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebExceptionCode.h" 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebExceptionCode.h"
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCursor.h" 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBCursor.h"
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabase.h"
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBMetadata.h" 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBMetadata.h"
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBObjectStore.h" 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBObjectStore.h"
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBTransaction.h" 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBTransaction.h"
21 22
22 #define IPC_MESSAGE_START IndexedDBMsgStart 23 #define IPC_MESSAGE_START IndexedDBMsgStart
23 24
24 // Argument structures used in messages 25 // Argument structures used in messages
25 26
26 IPC_ENUM_TRAITS(WebKit::WebIDBObjectStore::PutMode) 27 IPC_ENUM_TRAITS(WebKit::WebIDBObjectStore::PutMode)
27 IPC_ENUM_TRAITS(WebKit::WebIDBCursor::Direction) 28 IPC_ENUM_TRAITS(WebKit::WebIDBCursor::Direction)
28 IPC_ENUM_TRAITS(WebKit::WebIDBTransaction::TaskType) 29 IPC_ENUM_TRAITS(WebKit::WebIDBTransaction::TaskType)
30 IPC_ENUM_TRAITS(WebKit::WebIDBDatabase::PutMode)
31 IPC_ENUM_TRAITS(WebKit::WebIDBDatabase::TaskType)
29 32
30 // Used to enumerate indexed databases. 33 // Used to enumerate indexed databases.
31 IPC_STRUCT_BEGIN(IndexedDBHostMsg_FactoryGetDatabaseNames_Params) 34 IPC_STRUCT_BEGIN(IndexedDBHostMsg_FactoryGetDatabaseNames_Params)
32 // The response should have these ids. 35 // The response should have these ids.
33 IPC_STRUCT_MEMBER(int32, ipc_thread_id) 36 IPC_STRUCT_MEMBER(int32, ipc_thread_id)
34 IPC_STRUCT_MEMBER(int32, ipc_response_id) 37 IPC_STRUCT_MEMBER(int32, ipc_response_id)
35 // The origin doing the initiating. 38 // The origin doing the initiating.
36 IPC_STRUCT_MEMBER(string16, origin) 39 IPC_STRUCT_MEMBER(string16, origin)
37 IPC_STRUCT_END() 40 IPC_STRUCT_END()
38 41
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // The keyPath of the object store. 77 // The keyPath of the object store.
75 IPC_STRUCT_MEMBER(content::IndexedDBKeyPath, key_path) 78 IPC_STRUCT_MEMBER(content::IndexedDBKeyPath, key_path)
76 // Whether the object store created should have a key generator. 79 // Whether the object store created should have a key generator.
77 IPC_STRUCT_MEMBER(bool, auto_increment) 80 IPC_STRUCT_MEMBER(bool, auto_increment)
78 // The transaction this is associated with. 81 // The transaction this is associated with.
79 IPC_STRUCT_MEMBER(int32, ipc_transaction_id) 82 IPC_STRUCT_MEMBER(int32, ipc_transaction_id)
80 // The database the object store belongs to. 83 // The database the object store belongs to.
81 IPC_STRUCT_MEMBER(int32, ipc_database_id) 84 IPC_STRUCT_MEMBER(int32, ipc_database_id)
82 IPC_STRUCT_END() 85 IPC_STRUCT_END()
83 86
87 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseGet_Params)
88 IPC_STRUCT_MEMBER(int32, ipc_thread_id)
89 // The id any response should contain.
90 IPC_STRUCT_MEMBER(int32, ipc_response_id)
91 // The database the object store belongs to.
92 IPC_STRUCT_MEMBER(int32, ipc_database_id)
93 // The transaction its associated with.
94 IPC_STRUCT_MEMBER(int64, transaction_id)
95 // The object store's id.
96 IPC_STRUCT_MEMBER(int64, object_store_id)
97 // The index's id.
98 IPC_STRUCT_MEMBER(int64, index_id)
99 // The serialized key range.
100 IPC_STRUCT_MEMBER(content::IndexedDBKeyRange, key_range)
101 // If this is just retrieving the key
102 IPC_STRUCT_MEMBER(bool, key_only)
103 IPC_STRUCT_END()
104
105 // Used to set a value in an object store.
106 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabasePut_Params)
107 // The id any response should contain.
108 IPC_STRUCT_MEMBER(int32, ipc_thread_id)
109 IPC_STRUCT_MEMBER(int32, ipc_response_id)
110 // The database the object store belongs to.
111 IPC_STRUCT_MEMBER(int32, ipc_database_id)
112 // The transaction it's associated with.
113 IPC_STRUCT_MEMBER(int64, transaction_id)
114 // The object store's id.
115 IPC_STRUCT_MEMBER(int64, object_store_id)
116 // The index's id.
117 IPC_STRUCT_MEMBER(int64, index_id)
118 // The value to set.
119 IPC_STRUCT_MEMBER(std::vector<uint8>, value)
120 // The key to set it on (may not be "valid"/set in some cases).
121 IPC_STRUCT_MEMBER(content::IndexedDBKey, key)
122 // Whether this is an add or a put.
123 IPC_STRUCT_MEMBER(WebKit::WebIDBDatabase::PutMode, put_mode)
124 // The names of the indexes used below.
125 IPC_STRUCT_MEMBER(std::vector<int64>, index_ids)
126 // The keys for each index, such that each inner vector corresponds
127 // to each index named in index_names, respectively.
128 IPC_STRUCT_MEMBER(std::vector<std::vector<content::IndexedDBKey> >,
129 index_keys)
130 IPC_STRUCT_END()
131
132 // Used to open both cursors and object cursors in IndexedDB.
133 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseOpenCursor_Params)
134 // The response should have these ids.
135 IPC_STRUCT_MEMBER(int32, ipc_thread_id)
136 IPC_STRUCT_MEMBER(int32, ipc_response_id)
137 // The database the object store belongs to.
138 IPC_STRUCT_MEMBER(int32, ipc_database_id)
139 // The transaction this request belongs to.
140 IPC_STRUCT_MEMBER(int64, transaction_id)
141 // The object store.
142 IPC_STRUCT_MEMBER(int64, object_store_id)
143 // The index if any.
144 IPC_STRUCT_MEMBER(int64, index_id)
145 // The serialized key range.
146 IPC_STRUCT_MEMBER(content::IndexedDBKeyRange, key_range)
147 // The direction of this cursor.
148 IPC_STRUCT_MEMBER(int32, direction)
149 // If this is just retrieving the key
150 IPC_STRUCT_MEMBER(bool, key_only)
151 // The priority of this cursor.
152 IPC_STRUCT_MEMBER(WebKit::WebIDBDatabase::TaskType, task_type)
153 IPC_STRUCT_END()
154
155 // Used to open both cursors and object cursors in IndexedDB.
156 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseCount_Params)
157 // The response should have these ids.
158 IPC_STRUCT_MEMBER(int32, ipc_thread_id)
159 IPC_STRUCT_MEMBER(int32, ipc_response_id)
160 // The transaction this request belongs to.
161 IPC_STRUCT_MEMBER(int64, transaction_id)
162 // The IPC id of the database.
163 IPC_STRUCT_MEMBER(int32, ipc_database_id)
164 // The object store.
165 IPC_STRUCT_MEMBER(int64, object_store_id)
166 // The index if any.
167 IPC_STRUCT_MEMBER(int64, index_id)
168 // The serialized key range.
169 IPC_STRUCT_MEMBER(content::IndexedDBKeyRange, key_range)
170 IPC_STRUCT_END()
171
172 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseDeleteRange_Params)
173 // The response should have these ids.
174 IPC_STRUCT_MEMBER(int32, ipc_thread_id)
175 IPC_STRUCT_MEMBER(int32, ipc_response_id)
176 // The IPC id of the database.
177 IPC_STRUCT_MEMBER(int32, ipc_database_id)
178 // The transaction this request belongs to.
179 IPC_STRUCT_MEMBER(int64, transaction_id)
180 // The object store.
181 IPC_STRUCT_MEMBER(int64, object_store_id)
182 // The serialized key range.
183 IPC_STRUCT_MEMBER(content::IndexedDBKeyRange, key_range)
184 IPC_STRUCT_END()
185
84 // Used to open both cursors and object cursors in IndexedDB. 186 // Used to open both cursors and object cursors in IndexedDB.
85 IPC_STRUCT_BEGIN(IndexedDBHostMsg_IndexOpenCursor_Params) 187 IPC_STRUCT_BEGIN(IndexedDBHostMsg_IndexOpenCursor_Params)
86 // The response should have these ids. 188 // The response should have these ids.
87 IPC_STRUCT_MEMBER(int32, ipc_thread_id) 189 IPC_STRUCT_MEMBER(int32, ipc_thread_id)
88 IPC_STRUCT_MEMBER(int32, ipc_response_id) 190 IPC_STRUCT_MEMBER(int32, ipc_response_id)
89 // The serialized key range. 191 // The serialized key range.
90 IPC_STRUCT_MEMBER(content::IndexedDBKeyRange, key_range) 192 IPC_STRUCT_MEMBER(content::IndexedDBKeyRange, key_range)
91 // The direction of this cursor. 193 // The direction of this cursor.
92 IPC_STRUCT_MEMBER(int32, direction) 194 IPC_STRUCT_MEMBER(int32, direction)
93 // The index the index belongs to. 195 // The index the index belongs to.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // The names of the indexes used below. 227 // The names of the indexes used below.
126 IPC_STRUCT_MEMBER(std::vector<int64>, index_ids) 228 IPC_STRUCT_MEMBER(std::vector<int64>, index_ids)
127 // The keys for each index, such that each inner vector corresponds 229 // The keys for each index, such that each inner vector corresponds
128 // to each index named in index_names, respectively. 230 // to each index named in index_names, respectively.
129 IPC_STRUCT_MEMBER(std::vector<std::vector<content::IndexedDBKey> >, 231 IPC_STRUCT_MEMBER(std::vector<std::vector<content::IndexedDBKey> >,
130 index_keys) 232 index_keys)
131 // The transaction it's associated with. 233 // The transaction it's associated with.
132 IPC_STRUCT_MEMBER(int, ipc_transaction_id) 234 IPC_STRUCT_MEMBER(int, ipc_transaction_id)
133 IPC_STRUCT_END() 235 IPC_STRUCT_END()
134 236
237 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseSetIndexKeys_Params)
238 // The IPC id of the database.
239 IPC_STRUCT_MEMBER(int32, ipc_database_id)
240 // The transaction this request belongs to.
241 IPC_STRUCT_MEMBER(int64, transaction_id)
242 // The object store's id.
243 IPC_STRUCT_MEMBER(int64, object_store_id)
244 // The object store key that we're setting index keys for.
245 IPC_STRUCT_MEMBER(content::IndexedDBKey, primary_key)
246 // The indexes that we're setting keys on.
247 IPC_STRUCT_MEMBER(std::vector<int64>, index_ids)
248 // A list of index keys for each index.
249 IPC_STRUCT_MEMBER(std::vector<std::vector<content::IndexedDBKey> >,
250 index_keys)
251 IPC_STRUCT_END()
252
135 // Used to create an index. 253 // Used to create an index.
136 IPC_STRUCT_BEGIN(IndexedDBHostMsg_ObjectStoreCreateIndex_Params) 254 IPC_STRUCT_BEGIN(IndexedDBHostMsg_ObjectStoreCreateIndex_Params)
137 // The storage id of the index. 255 // The storage id of the index.
138 IPC_STRUCT_MEMBER(int64, id) 256 IPC_STRUCT_MEMBER(int64, id)
139 // The name of the index. 257 // The name of the index.
140 IPC_STRUCT_MEMBER(string16, name) 258 IPC_STRUCT_MEMBER(string16, name)
141 // The keyPath of the index. 259 // The keyPath of the index.
142 IPC_STRUCT_MEMBER(content::IndexedDBKeyPath, key_path) 260 IPC_STRUCT_MEMBER(content::IndexedDBKeyPath, key_path)
143 // Whether the index created has unique keys. 261 // Whether the index created has unique keys.
144 IPC_STRUCT_MEMBER(bool, unique) 262 IPC_STRUCT_MEMBER(bool, unique)
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 int32) /* ipc_transaction_id */ 524 int32) /* ipc_transaction_id */
407 525
408 // WebIDBDatabase::close() message. 526 // WebIDBDatabase::close() message.
409 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseClose, 527 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseClose,
410 int32 /* ipc_database_id */) 528 int32 /* ipc_database_id */)
411 529
412 // WebIDBDatabase::~WebIDBDatabase() message. 530 // WebIDBDatabase::~WebIDBDatabase() message.
413 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseDestroyed, 531 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseDestroyed,
414 int32 /* ipc_database_id */) 532 int32 /* ipc_database_id */)
415 533
534 // WebIDBDatabase::get() message.
535 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseGet,
536 IndexedDBHostMsg_DatabaseGet_Params)
537
538 // WebIDBDatabase::put() message.
539 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabasePut,
540 IndexedDBHostMsg_DatabasePut_Params)
541
542 // WebIDBDatabase::setIndexKeys() message.
543 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseSetIndexKeys,
544 IndexedDBHostMsg_DatabaseSetIndexKeys_Params)
545
546 // WebIDBDatabase::setIndexesReady() message.
547 IPC_MESSAGE_CONTROL4(IndexedDBHostMsg_DatabaseSetIndexesReady,
548 int32, /* ipc_database_id */
549 int64, /* transaction_id */
550 int64, /* object_store_id */
551 std::vector<int64>) /* index_ids */
552
553 // WebIDBDatabase::openCursor() message.
554 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseOpenCursor,
555 IndexedDBHostMsg_DatabaseOpenCursor_Params)
556
557 // WebIDBDatabase::count() message.
558 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseCount,
559 IndexedDBHostMsg_DatabaseCount_Params)
560
561 // WebIDBDatabase::deleteRange() message.
562 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseDeleteRange,
563 IndexedDBHostMsg_DatabaseDeleteRange_Params)
564
565 // WebIDBDatabase::clear() message.
566 IPC_MESSAGE_CONTROL5(IndexedDBHostMsg_DatabaseClear,
567 int32, /* ipc_thread_id */
568 int32, /* ipc_response_id */
569 int32, /* ipc_database_id */
570 int64, /* transaction_id */
571 int64) /* object_store_id */
572
416 // WebIDBIndex::openObjectCursor() message. 573 // WebIDBIndex::openObjectCursor() message.
417 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_IndexOpenObjectCursor, 574 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_IndexOpenObjectCursor,
418 IndexedDBHostMsg_IndexOpenCursor_Params) 575 IndexedDBHostMsg_IndexOpenCursor_Params)
419 576
420 // WebIDBIndex::openKeyCursor() message. 577 // WebIDBIndex::openKeyCursor() message.
421 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_IndexOpenKeyCursor, 578 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_IndexOpenKeyCursor,
422 IndexedDBHostMsg_IndexOpenCursor_Params) 579 IndexedDBHostMsg_IndexOpenCursor_Params)
423 580
424 // WebIDBIndex::count() message. 581 // WebIDBIndex::count() message.
425 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_IndexCount, 582 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_IndexCount,
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionAbort, 694 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionAbort,
538 int32 /* ipc_transaction_id */) 695 int32 /* ipc_transaction_id */)
539 696
540 // IDBTransaction::DidCompleteTaskEvents() message. 697 // IDBTransaction::DidCompleteTaskEvents() message.
541 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionDidCompleteTaskEvents, 698 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionDidCompleteTaskEvents,
542 int32 /* ipc_transaction_id */) 699 int32 /* ipc_transaction_id */)
543 700
544 // WebIDBTransaction::~WebIDBTransaction() message. 701 // WebIDBTransaction::~WebIDBTransaction() message.
545 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionDestroyed, 702 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionDestroyed,
546 int32 /* ipc_transaction_id */) 703 int32 /* ipc_transaction_id */)
OLDNEW
« no previous file with comments | « content/common/indexed_db/indexed_db_dispatcher.cc ('k') | content/common/indexed_db/proxy_webidbdatabase_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698