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

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

Issue 18023022: Blob support for IDB [Chromium] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge fixes [builds, untested] Created 7 years, 3 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 | Annotate | Revision Log
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 "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(WebKit::WebIDBCursor::Direction) 23 IPC_ENUM_TRAITS(WebKit::WebIDBCursor::Direction)
23 IPC_ENUM_TRAITS(WebKit::WebIDBDatabase::PutMode) 24 IPC_ENUM_TRAITS(WebKit::WebIDBDatabase::PutMode)
24 IPC_ENUM_TRAITS(WebKit::WebIDBDatabase::TaskType) 25 IPC_ENUM_TRAITS(WebKit::WebIDBDatabase::TaskType)
25 26
26 IPC_ENUM_TRAITS_MAX_VALUE(WebKit::WebIDBCallbacks::DataLoss, 27 IPC_ENUM_TRAITS_MAX_VALUE(WebKit::WebIDBCallbacks::DataLoss,
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 // The object store's id. 106 // The object store's id.
106 IPC_STRUCT_MEMBER(int64, object_store_id) 107 IPC_STRUCT_MEMBER(int64, object_store_id)
107 // The index's id. 108 // The index's id.
108 IPC_STRUCT_MEMBER(int64, index_id) 109 IPC_STRUCT_MEMBER(int64, index_id)
109 // The serialized key range. 110 // The serialized key range.
110 IPC_STRUCT_MEMBER(content::IndexedDBKeyRange, key_range) 111 IPC_STRUCT_MEMBER(content::IndexedDBKeyRange, key_range)
111 // If this is just retrieving the key 112 // If this is just retrieving the key
112 IPC_STRUCT_MEMBER(bool, key_only) 113 IPC_STRUCT_MEMBER(bool, key_only)
113 IPC_STRUCT_END() 114 IPC_STRUCT_END()
114 115
116 IPC_STRUCT_BEGIN(IndexedDBMsg_BlobOrFileInfo)
117 IPC_STRUCT_MEMBER(bool, is_file)
118 IPC_STRUCT_MEMBER(GURL, url) //TODO(ericu): UUID now?
119 IPC_STRUCT_MEMBER(string16, mime_type)
120 IPC_STRUCT_MEMBER(uint64, size)
121 IPC_STRUCT_MEMBER(string16, file_path)
122 IPC_STRUCT_MEMBER(string16, file_name)
123 IPC_STRUCT_MEMBER(double, last_modified)
124 IPC_STRUCT_END()
125
115 // Used to set a value in an object store. 126 // Used to set a value in an object store.
116 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabasePut_Params) 127 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabasePut_Params)
117 // The id any response should contain. 128 // The id any response should contain.
118 IPC_STRUCT_MEMBER(int32, ipc_thread_id) 129 IPC_STRUCT_MEMBER(int32, ipc_thread_id)
119 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) 130 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id)
120 // The database the object store belongs to. 131 // The database the object store belongs to.
121 IPC_STRUCT_MEMBER(int32, ipc_database_id) 132 IPC_STRUCT_MEMBER(int32, ipc_database_id)
122 // The transaction it's associated with. 133 // The transaction it's associated with.
123 IPC_STRUCT_MEMBER(int64, transaction_id) 134 IPC_STRUCT_MEMBER(int64, transaction_id)
124 // The object store's id. 135 // The object store's id.
125 IPC_STRUCT_MEMBER(int64, object_store_id) 136 IPC_STRUCT_MEMBER(int64, object_store_id)
126 // The index's id. 137 // The index's id.
127 IPC_STRUCT_MEMBER(int64, index_id) 138 IPC_STRUCT_MEMBER(int64, index_id)
128 // The value to set. 139 // The value to set.
129 IPC_STRUCT_MEMBER(std::string, value) 140 IPC_STRUCT_MEMBER(std::string, value)
130 // The key to set it on (may not be "valid"/set in some cases). 141 // The key to set it on (may not be "valid"/set in some cases).
131 IPC_STRUCT_MEMBER(content::IndexedDBKey, key) 142 IPC_STRUCT_MEMBER(content::IndexedDBKey, key)
132 // Whether this is an add or a put. 143 // Whether this is an add or a put.
133 IPC_STRUCT_MEMBER(WebKit::WebIDBDatabase::PutMode, put_mode) 144 IPC_STRUCT_MEMBER(WebKit::WebIDBDatabase::PutMode, put_mode)
134 // The names of the indexes used below. 145 // The names of the indexes used below.
135 IPC_STRUCT_MEMBER(std::vector<int64>, index_ids) 146 IPC_STRUCT_MEMBER(std::vector<int64>, index_ids)
136 // The keys for each index, such that each inner vector corresponds 147 // The keys for each index, such that each inner vector corresponds
137 // to each index named in index_names, respectively. 148 // to each index named in index_names, respectively.
138 IPC_STRUCT_MEMBER(std::vector<std::vector<content::IndexedDBKey> >, 149 IPC_STRUCT_MEMBER(std::vector<std::vector<content::IndexedDBKey> >,
139 index_keys) 150 index_keys)
151 // Sideband data for any blob or file encoded in value.
152 IPC_STRUCT_MEMBER(std::vector<IndexedDBMsg_BlobOrFileInfo>, blob_or_file_info)
140 IPC_STRUCT_END() 153 IPC_STRUCT_END()
141 154
142 // Used to open both cursors and object cursors in IndexedDB. 155 // Used to open both cursors and object cursors in IndexedDB.
143 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseOpenCursor_Params) 156 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseOpenCursor_Params)
144 // The response should have these ids. 157 // The response should have these ids.
145 IPC_STRUCT_MEMBER(int32, ipc_thread_id) 158 IPC_STRUCT_MEMBER(int32, ipc_thread_id)
146 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) 159 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id)
147 // The database the object store belongs to. 160 // The database the object store belongs to.
148 IPC_STRUCT_MEMBER(int32, ipc_database_id) 161 IPC_STRUCT_MEMBER(int32, ipc_database_id)
149 // The transaction this request belongs to. 162 // The transaction this request belongs to.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 IPC_STRUCT_MEMBER(bool, multi_entry) 242 IPC_STRUCT_MEMBER(bool, multi_entry)
230 IPC_STRUCT_END() 243 IPC_STRUCT_END()
231 244
232 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessIDBCursor_Params) 245 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessIDBCursor_Params)
233 IPC_STRUCT_MEMBER(int32, ipc_thread_id) 246 IPC_STRUCT_MEMBER(int32, ipc_thread_id)
234 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) 247 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id)
235 IPC_STRUCT_MEMBER(int32, ipc_cursor_id) 248 IPC_STRUCT_MEMBER(int32, ipc_cursor_id)
236 IPC_STRUCT_MEMBER(content::IndexedDBKey, key) 249 IPC_STRUCT_MEMBER(content::IndexedDBKey, key)
237 IPC_STRUCT_MEMBER(content::IndexedDBKey, primary_key) 250 IPC_STRUCT_MEMBER(content::IndexedDBKey, primary_key)
238 IPC_STRUCT_MEMBER(std::string, value) 251 IPC_STRUCT_MEMBER(std::string, value)
252 // Sideband data for any blob or file encoded in value.
253 IPC_STRUCT_MEMBER(std::vector<IndexedDBMsg_BlobOrFileInfo>, blob_or_file_info)
239 IPC_STRUCT_END() 254 IPC_STRUCT_END()
240 255
241 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessCursorContinue_Params) 256 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessCursorContinue_Params)
242 IPC_STRUCT_MEMBER(int32, ipc_thread_id) 257 IPC_STRUCT_MEMBER(int32, ipc_thread_id)
243 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) 258 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id)
244 IPC_STRUCT_MEMBER(int32, ipc_cursor_id) 259 IPC_STRUCT_MEMBER(int32, ipc_cursor_id)
245 IPC_STRUCT_MEMBER(content::IndexedDBKey, key) 260 IPC_STRUCT_MEMBER(content::IndexedDBKey, key)
246 IPC_STRUCT_MEMBER(content::IndexedDBKey, primary_key) 261 IPC_STRUCT_MEMBER(content::IndexedDBKey, primary_key)
247 IPC_STRUCT_MEMBER(std::string, value) 262 IPC_STRUCT_MEMBER(std::string, value)
263 // Sideband data for any blob or file encoded in value.
264 IPC_STRUCT_MEMBER(std::vector<IndexedDBMsg_BlobOrFileInfo>, blob_or_file_info)
248 IPC_STRUCT_END() 265 IPC_STRUCT_END()
249 266
250 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params) 267 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params)
251 IPC_STRUCT_MEMBER(int32, ipc_thread_id) 268 IPC_STRUCT_MEMBER(int32, ipc_thread_id)
252 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id) 269 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id)
253 IPC_STRUCT_MEMBER(int32, ipc_cursor_id) 270 IPC_STRUCT_MEMBER(int32, ipc_cursor_id)
254 IPC_STRUCT_MEMBER(std::vector<content::IndexedDBKey>, keys) 271 IPC_STRUCT_MEMBER(std::vector<content::IndexedDBKey>, keys)
255 IPC_STRUCT_MEMBER(std::vector<content::IndexedDBKey>, primary_keys) 272 IPC_STRUCT_MEMBER(std::vector<content::IndexedDBKey>, primary_keys)
256 IPC_STRUCT_MEMBER(std::vector<std::string>, values) 273 IPC_STRUCT_MEMBER(std::vector<std::string>, values)
274 // Sideband data for any blob or file encoded in value.
275 IPC_STRUCT_MEMBER(std::vector<std::vector<IndexedDBMsg_BlobOrFileInfo> >,
276 blob_or_file_infos)
277 IPC_STRUCT_END()
278
279 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessValue_Params)
280 IPC_STRUCT_MEMBER(int32, ipc_thread_id)
281 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id)
282 IPC_STRUCT_MEMBER(std::string, value)
283 // Sideband data for any blob or file encoded in value.
284 IPC_STRUCT_MEMBER(std::vector<IndexedDBMsg_BlobOrFileInfo>, blob_or_file_info)
285 IPC_STRUCT_END()
286
287 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessValueWithKey_Params)
288 IPC_STRUCT_MEMBER(int32, ipc_thread_id)
289 IPC_STRUCT_MEMBER(int32, ipc_callbacks_id)
290 IPC_STRUCT_MEMBER(std::string, value)
291 IPC_STRUCT_MEMBER(content::IndexedDBKey, primary_key)
292 IPC_STRUCT_MEMBER(content::IndexedDBKeyPath, key_path)
293 // Sideband data for any blob or file encoded in value.
294 IPC_STRUCT_MEMBER(std::vector<IndexedDBMsg_BlobOrFileInfo>, blob_or_file_info)
257 IPC_STRUCT_END() 295 IPC_STRUCT_END()
258 296
259 IPC_STRUCT_BEGIN(IndexedDBIndexMetadata) 297 IPC_STRUCT_BEGIN(IndexedDBIndexMetadata)
260 IPC_STRUCT_MEMBER(int64, id) 298 IPC_STRUCT_MEMBER(int64, id)
261 IPC_STRUCT_MEMBER(string16, name) 299 IPC_STRUCT_MEMBER(string16, name)
262 IPC_STRUCT_MEMBER(content::IndexedDBKeyPath, keyPath) 300 IPC_STRUCT_MEMBER(content::IndexedDBKeyPath, keyPath)
263 IPC_STRUCT_MEMBER(bool, unique) 301 IPC_STRUCT_MEMBER(bool, unique)
264 IPC_STRUCT_MEMBER(bool, multiEntry) 302 IPC_STRUCT_MEMBER(bool, multiEntry)
265 IPC_STRUCT_END() 303 IPC_STRUCT_END()
266 304
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 532
498 // WebIDBDatabase::commit() message. 533 // WebIDBDatabase::commit() message.
499 IPC_MESSAGE_CONTROL2(IndexedDBHostMsg_DatabaseCommit, 534 IPC_MESSAGE_CONTROL2(IndexedDBHostMsg_DatabaseCommit,
500 int32, /* ipc_database_id */ 535 int32, /* ipc_database_id */
501 int64) /* transaction_id */ 536 int64) /* transaction_id */
502 537
503 // WebIDBDatabase::~WebIDBCursor() message. 538 // WebIDBDatabase::~WebIDBCursor() message.
504 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_CursorDestroyed, 539 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_CursorDestroyed,
505 int32 /* ipc_cursor_id */) 540 int32 /* ipc_cursor_id */)
506 541
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698