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

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

Issue 2370643004: Port messages sent by WebIDBFactoryImpl to Mojo. (Closed)
Patch Set: Address last nits and fix leaks in unit tests. Created 4 years, 2 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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 blink::WebIDBCursorDirectionLast) 47 blink::WebIDBCursorDirectionLast)
48 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBPutMode, blink::WebIDBPutModeLast) 48 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBPutMode, blink::WebIDBPutModeLast)
49 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBTaskType, blink::WebIDBTaskTypeLast) 49 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBTaskType, blink::WebIDBTaskTypeLast)
50 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBTransactionMode, 50 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBTransactionMode,
51 blink::WebIDBTransactionModeLast) 51 blink::WebIDBTransactionModeLast)
52 52
53 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBDataLoss, blink::WebIDBDataLossTotal) 53 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBDataLoss, blink::WebIDBDataLossTotal)
54 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBOperationType, 54 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBOperationType,
55 blink::WebIDBOperationTypeLast) 55 blink::WebIDBOperationTypeLast)
56 56
57 // Used to enumerate indexed databases.
58 IPC_STRUCT_BEGIN(IndexedDBHostMsg_FactoryGetDatabaseNames_Params)
59 // The response should have these ids.
60 IPC_STRUCT_MEMBER(int32_t, ipc_thread_id)
61 IPC_STRUCT_MEMBER(int32_t, ipc_callbacks_id)
62 // The origin doing the initiating.
63 IPC_STRUCT_MEMBER(url::Origin, origin)
64 IPC_STRUCT_END()
65
66 // Used to open an indexed database.
67 IPC_STRUCT_BEGIN(IndexedDBHostMsg_FactoryOpen_Params)
68 // The response should have these ids.
69 IPC_STRUCT_MEMBER(int32_t, ipc_thread_id)
70 // Identifier of the request
71 IPC_STRUCT_MEMBER(int32_t, ipc_callbacks_id)
72 // Identifier for database callbacks
73 IPC_STRUCT_MEMBER(int32_t, ipc_database_callbacks_id)
74 // The origin doing the initiating.
75 IPC_STRUCT_MEMBER(url::Origin, origin)
76 // The name of the database.
77 IPC_STRUCT_MEMBER(base::string16, name)
78 // The transaction id used if a database upgrade is needed.
79 IPC_STRUCT_MEMBER(int64_t, transaction_id)
80 // The requested version of the database.
81 IPC_STRUCT_MEMBER(int64_t, version)
82 IPC_STRUCT_END()
83
84 // Used to delete an indexed database.
85 IPC_STRUCT_BEGIN(IndexedDBHostMsg_FactoryDeleteDatabase_Params)
86 // The response should have these ids.
87 IPC_STRUCT_MEMBER(int32_t, ipc_thread_id)
88 IPC_STRUCT_MEMBER(int32_t, ipc_callbacks_id)
89 // The origin doing the initiating.
90 IPC_STRUCT_MEMBER(url::Origin, origin)
91 // The name of the database.
92 IPC_STRUCT_MEMBER(base::string16, name)
93 IPC_STRUCT_END()
94
95 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseCreateTransaction_Params) 57 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseCreateTransaction_Params)
96 IPC_STRUCT_MEMBER(int32_t, ipc_thread_id) 58 IPC_STRUCT_MEMBER(int32_t, ipc_thread_id)
97 // The database the object store belongs to. 59 // The database the object store belongs to.
98 IPC_STRUCT_MEMBER(int32_t, ipc_database_id) 60 IPC_STRUCT_MEMBER(int32_t, ipc_database_id)
99 // The transaction id as minted by the frontend. 61 // The transaction id as minted by the frontend.
100 IPC_STRUCT_MEMBER(int64_t, transaction_id) 62 IPC_STRUCT_MEMBER(int64_t, transaction_id)
101 // The scope of the transaction. 63 // The scope of the transaction.
102 IPC_STRUCT_MEMBER(std::vector<int64_t>, object_store_ids) 64 IPC_STRUCT_MEMBER(std::vector<int64_t>, object_store_ids)
103 // The transaction mode. 65 // The transaction mode.
104 IPC_STRUCT_MEMBER(blink::WebIDBTransactionMode, mode) 66 IPC_STRUCT_MEMBER(blink::WebIDBTransactionMode, mode)
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 IPC_STRUCT_MEMBER(int32_t, ipc_callbacks_id) 299 IPC_STRUCT_MEMBER(int32_t, ipc_callbacks_id)
338 IPC_STRUCT_MEMBER(std::vector<IndexedDBMsg_ReturnValue>, values) 300 IPC_STRUCT_MEMBER(std::vector<IndexedDBMsg_ReturnValue>, values)
339 IPC_STRUCT_END() 301 IPC_STRUCT_END()
340 302
341 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessValue_Params) 303 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksSuccessValue_Params)
342 IPC_STRUCT_MEMBER(int32_t, ipc_thread_id) 304 IPC_STRUCT_MEMBER(int32_t, ipc_thread_id)
343 IPC_STRUCT_MEMBER(int32_t, ipc_callbacks_id) 305 IPC_STRUCT_MEMBER(int32_t, ipc_callbacks_id)
344 IPC_STRUCT_MEMBER(IndexedDBMsg_ReturnValue, value) 306 IPC_STRUCT_MEMBER(IndexedDBMsg_ReturnValue, value)
345 IPC_STRUCT_END() 307 IPC_STRUCT_END()
346 308
347 IPC_STRUCT_BEGIN(IndexedDBIndexMetadata)
348 IPC_STRUCT_MEMBER(int64_t, id)
349 IPC_STRUCT_MEMBER(base::string16, name)
350 IPC_STRUCT_MEMBER(content::IndexedDBKeyPath, key_path)
351 IPC_STRUCT_MEMBER(bool, unique)
352 IPC_STRUCT_MEMBER(bool, multi_entry)
353 IPC_STRUCT_END()
354
355 IPC_STRUCT_BEGIN(IndexedDBObjectStoreMetadata)
356 IPC_STRUCT_MEMBER(int64_t, id)
357 IPC_STRUCT_MEMBER(base::string16, name)
358 IPC_STRUCT_MEMBER(content::IndexedDBKeyPath, key_path)
359 IPC_STRUCT_MEMBER(bool, auto_increment)
360 IPC_STRUCT_MEMBER(int64_t, max_index_id)
361 IPC_STRUCT_MEMBER(std::vector<IndexedDBIndexMetadata>, indexes)
362 IPC_STRUCT_END()
363
364 IPC_STRUCT_BEGIN(IndexedDBDatabaseMetadata)
365 IPC_STRUCT_MEMBER(int64_t, id)
366 IPC_STRUCT_MEMBER(base::string16, name)
367 IPC_STRUCT_MEMBER(int64_t, version)
368 IPC_STRUCT_MEMBER(int64_t, max_object_store_id)
369 IPC_STRUCT_MEMBER(std::vector<IndexedDBObjectStoreMetadata>, object_stores)
370 IPC_STRUCT_END()
371
372 IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksUpgradeNeeded_Params)
373 IPC_STRUCT_MEMBER(int32_t, ipc_thread_id)
374 IPC_STRUCT_MEMBER(int32_t, ipc_callbacks_id)
375 IPC_STRUCT_MEMBER(int32_t, ipc_database_callbacks_id)
376 IPC_STRUCT_MEMBER(int32_t, ipc_database_id)
377 IPC_STRUCT_MEMBER(int64_t, old_version)
378 IPC_STRUCT_MEMBER(blink::WebIDBDataLoss, data_loss)
379 IPC_STRUCT_MEMBER(std::string, data_loss_message)
380 IPC_STRUCT_MEMBER(IndexedDBDatabaseMetadata, idb_metadata)
381 IPC_STRUCT_END()
382
383 IPC_STRUCT_BEGIN(IndexedDBMsg_Observation) 309 IPC_STRUCT_BEGIN(IndexedDBMsg_Observation)
384 IPC_STRUCT_MEMBER(int64_t, object_store_id) 310 IPC_STRUCT_MEMBER(int64_t, object_store_id)
385 IPC_STRUCT_MEMBER(blink::WebIDBOperationType, type) 311 IPC_STRUCT_MEMBER(blink::WebIDBOperationType, type)
386 IPC_STRUCT_MEMBER(content::IndexedDBKeyRange, key_range) 312 IPC_STRUCT_MEMBER(content::IndexedDBKeyRange, key_range)
387 IPC_STRUCT_END() 313 IPC_STRUCT_END()
388 314
389 IPC_STRUCT_BEGIN(IndexedDBMsg_ObserverChanges) 315 IPC_STRUCT_BEGIN(IndexedDBMsg_ObserverChanges)
390 IPC_STRUCT_MEMBER(ObservationIndex, observation_index) 316 IPC_STRUCT_MEMBER(ObservationIndex, observation_index)
391 IPC_STRUCT_MEMBER(std::vector<IndexedDBMsg_Observation>, observations) 317 IPC_STRUCT_MEMBER(std::vector<IndexedDBMsg_Observation>, observations)
392 IPC_STRUCT_END() 318 IPC_STRUCT_END()
(...skipping 13 matching lines...) Expand all
406 332
407 IPC_MESSAGE_CONTROL1(IndexedDBMsg_CallbacksSuccessCursorAdvance, 333 IPC_MESSAGE_CONTROL1(IndexedDBMsg_CallbacksSuccessCursorAdvance,
408 IndexedDBMsg_CallbacksSuccessCursorContinue_Params) 334 IndexedDBMsg_CallbacksSuccessCursorContinue_Params)
409 335
410 IPC_MESSAGE_CONTROL1(IndexedDBMsg_CallbacksSuccessCursorPrefetch, 336 IPC_MESSAGE_CONTROL1(IndexedDBMsg_CallbacksSuccessCursorPrefetch,
411 IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params) 337 IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params)
412 338
413 IPC_MESSAGE_CONTROL1(IndexedDBMsg_CallbacksSuccessArray, 339 IPC_MESSAGE_CONTROL1(IndexedDBMsg_CallbacksSuccessArray,
414 IndexedDBMsg_CallbacksSuccessArray_Params) 340 IndexedDBMsg_CallbacksSuccessArray_Params)
415 341
416 IPC_MESSAGE_CONTROL5(IndexedDBMsg_CallbacksSuccessIDBDatabase,
417 int32_t /* ipc_thread_id */,
418 int32_t /* ipc_callbacks_id */,
419 int32_t /* ipc_database_callbacks_id */,
420 int32_t /* ipc_database_id */,
421 IndexedDBDatabaseMetadata)
422 IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksSuccessIndexedDBKey, 342 IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksSuccessIndexedDBKey,
423 int32_t /* ipc_thread_id */, 343 int32_t /* ipc_thread_id */,
424 int32_t /* ipc_callbacks_id */, 344 int32_t /* ipc_callbacks_id */,
425 content::IndexedDBKey /* indexed_db_key */) 345 content::IndexedDBKey /* indexed_db_key */)
426 346
427 IPC_MESSAGE_CONTROL1(IndexedDBMsg_CallbacksSuccessValue, 347 IPC_MESSAGE_CONTROL1(IndexedDBMsg_CallbacksSuccessValue,
428 IndexedDBMsg_CallbacksSuccessValue_Params) 348 IndexedDBMsg_CallbacksSuccessValue_Params)
429 349
430 IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksSuccessInteger, 350 IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksSuccessInteger,
431 int32_t /* ipc_thread_id */, 351 int32_t /* ipc_thread_id */,
432 int32_t /* ipc_callbacks_id */, 352 int32_t /* ipc_callbacks_id */,
433 int64_t /* value */) 353 int64_t /* value */)
434 IPC_MESSAGE_CONTROL2(IndexedDBMsg_CallbacksSuccessUndefined, 354 IPC_MESSAGE_CONTROL2(IndexedDBMsg_CallbacksSuccessUndefined,
435 int32_t /* ipc_thread_id */, 355 int32_t /* ipc_thread_id */,
436 int32_t /* ipc_callbacks_id */) 356 int32_t /* ipc_callbacks_id */)
437 IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksSuccessStringList,
438 int32_t /* ipc_thread_id */,
439 int32_t /* ipc_callbacks_id */,
440 std::vector<base::string16> /* dom_string_list */)
441 IPC_MESSAGE_CONTROL4(IndexedDBMsg_CallbacksError, 357 IPC_MESSAGE_CONTROL4(IndexedDBMsg_CallbacksError,
442 int32_t /* ipc_thread_id */, 358 int32_t /* ipc_thread_id */,
443 int32_t /* ipc_callbacks_id */, 359 int32_t /* ipc_callbacks_id */,
444 int /* code */, 360 int /* code */,
445 base::string16 /* message */) 361 base::string16 /* message */)
446 IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksIntBlocked,
447 int32_t /* ipc_thread_id */,
448 int32_t /* ipc_callbacks_id */,
449 int64_t /* existing_version */)
450 IPC_MESSAGE_CONTROL1(IndexedDBMsg_CallbacksUpgradeNeeded,
451 IndexedDBMsg_CallbacksUpgradeNeeded_Params)
452 362
453 // IDBDatabaseCallback message handlers 363 // IDBDatabaseCallback message handlers
454 IPC_MESSAGE_CONTROL2(IndexedDBMsg_DatabaseCallbacksForcedClose,
455 int32_t, /* ipc_thread_id */
456 int32_t) /* ipc_database_callbacks_id */
457 IPC_MESSAGE_CONTROL4(IndexedDBMsg_DatabaseCallbacksVersionChange,
458 int32_t, /* ipc_thread_id */
459 int32_t, /* ipc_database_callbacks_id */
460 int64_t, /* old_version */
461 int64_t) /* new_version */
462 IPC_MESSAGE_CONTROL5(IndexedDBMsg_DatabaseCallbacksAbort,
463 int32_t, /* ipc_thread_id */
464 int32_t, /* ipc_database_callbacks_id */
465 int64_t, /* transaction_id */
466 int, /* code */
467 base::string16) /* message */
468 IPC_MESSAGE_CONTROL3(IndexedDBMsg_DatabaseCallbacksComplete,
469 int32_t, /* ipc_thread_id */
470 int32_t, /* ipc_database_callbacks_id */
471 int64_t) /* transaction_id */
472 IPC_MESSAGE_CONTROL3(IndexedDBMsg_DatabaseCallbacksChanges, 364 IPC_MESSAGE_CONTROL3(IndexedDBMsg_DatabaseCallbacksChanges,
473 int32_t, /* ipc_thread_id */ 365 int32_t, /* ipc_thread_id */
474 int32_t, /* ipc_database_id */ 366 int32_t, /* ipc_database_id */
475 IndexedDBMsg_ObserverChanges) 367 IndexedDBMsg_ObserverChanges)
476 368
477 // Indexed DB messages sent from the renderer to the browser. 369 // Indexed DB messages sent from the renderer to the browser.
478 370
479 // WebIDBCursor::advance() message. 371 // WebIDBCursor::advance() message.
480 IPC_MESSAGE_CONTROL4(IndexedDBHostMsg_CursorAdvance, 372 IPC_MESSAGE_CONTROL4(IndexedDBHostMsg_CursorAdvance,
481 int32_t, /* ipc_cursor_id */ 373 int32_t, /* ipc_cursor_id */
(...skipping 15 matching lines...) Expand all
497 int32_t, /* ipc_thread_id */ 389 int32_t, /* ipc_thread_id */
498 int32_t, /* ipc_callbacks_id */ 390 int32_t, /* ipc_callbacks_id */
499 int32_t) /* n */ 391 int32_t) /* n */
500 392
501 // WebIDBCursor::prefetchReset() message. 393 // WebIDBCursor::prefetchReset() message.
502 IPC_MESSAGE_CONTROL3(IndexedDBHostMsg_CursorPrefetchReset, 394 IPC_MESSAGE_CONTROL3(IndexedDBHostMsg_CursorPrefetchReset,
503 int32_t, /* ipc_cursor_id */ 395 int32_t, /* ipc_cursor_id */
504 int32_t, /* used_prefetches */ 396 int32_t, /* used_prefetches */
505 int32_t) /* used_prefetches */ 397 int32_t) /* used_prefetches */
506 398
507 // WebIDBFactory::getDatabaseNames() message.
508 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_FactoryGetDatabaseNames,
509 IndexedDBHostMsg_FactoryGetDatabaseNames_Params)
510
511 // WebIDBFactory::open() message.
512 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_FactoryOpen,
513 IndexedDBHostMsg_FactoryOpen_Params)
514
515 // WebIDBFactory::deleteDatabase() message.
516 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_FactoryDeleteDatabase,
517 IndexedDBHostMsg_FactoryDeleteDatabase_Params)
518
519 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_AckReceivedBlobs, 399 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_AckReceivedBlobs,
520 std::vector<std::string>) /* uuids */ 400 std::vector<std::string>) /* uuids */
521 401
522 // WebIDBDatabase::unobserve() message. 402 // WebIDBDatabase::unobserve() message.
523 IPC_MESSAGE_CONTROL2(IndexedDBHostMsg_DatabaseUnobserve, 403 IPC_MESSAGE_CONTROL2(IndexedDBHostMsg_DatabaseUnobserve,
524 int32_t, /* ipc_database_id */ 404 int32_t, /* ipc_database_id */
525 std::vector<int32_t>) /* list of observer_id */ 405 std::vector<int32_t>) /* list of observer_id */
526 406
527 // WebIDBDatabase::createObjectStore() message. 407 // WebIDBDatabase::createObjectStore() message.
528 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseCreateObjectStore, 408 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseCreateObjectStore,
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 int64_t) /* transaction_id */ 509 int64_t) /* transaction_id */
630 510
631 // WebIDBDatabase::commit() message. 511 // WebIDBDatabase::commit() message.
632 IPC_MESSAGE_CONTROL2(IndexedDBHostMsg_DatabaseCommit, 512 IPC_MESSAGE_CONTROL2(IndexedDBHostMsg_DatabaseCommit,
633 int32_t, /* ipc_database_id */ 513 int32_t, /* ipc_database_id */
634 int64_t) /* transaction_id */ 514 int64_t) /* transaction_id */
635 515
636 // WebIDBDatabase::~WebIDBCursor() message. 516 // WebIDBDatabase::~WebIDBCursor() message.
637 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_CursorDestroyed, 517 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_CursorDestroyed,
638 int32_t /* ipc_cursor_id */) 518 int32_t /* ipc_cursor_id */)
OLDNEW
« no previous file with comments | « content/common/indexed_db/indexed_db.typemap ('k') | content/common/indexed_db/indexed_db_metadata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698