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

Unified Diff: content/common/indexed_db/indexed_db_messages.h

Issue 2125213002: [IndexedDB] Propogating changes to observers : Renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lifetime
Patch Set: Minor bugs fixed Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/common/indexed_db/indexed_db_messages.h
diff --git a/content/common/indexed_db/indexed_db_messages.h b/content/common/indexed_db/indexed_db_messages.h
index 977bb65887bed4e87d38a66457d6a647a17af03d..6ae517bd88d19bd476947e8415c66c4d6340fba4 100644
--- a/content/common/indexed_db/indexed_db_messages.h
+++ b/content/common/indexed_db/indexed_db_messages.h
@@ -15,6 +15,7 @@
#include "content/common/indexed_db/indexed_db_key_range.h"
#include "content/common/indexed_db/indexed_db_param_traits.h"
#include "ipc/ipc_message_macros.h"
+#include "ipc/ipc_message_utils.h"
#include "ipc/ipc_param_traits.h"
#include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h"
#include "url/origin.h"
@@ -42,6 +43,8 @@ IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBTransactionMode,
blink::WebIDBTransactionModeLast)
IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBDataLoss, blink::WebIDBDataLossTotal)
+IPC_ENUM_TRAITS_MAX_VALUE(blink::WebIDBOperationType,
+ blink::WebIDBOperationTypeLast)
// Used to enumerate indexed databases.
IPC_STRUCT_BEGIN(IndexedDBHostMsg_FactoryGetDatabaseNames_Params)
@@ -173,6 +176,18 @@ IPC_STRUCT_BEGIN_WITH_PARENT(IndexedDBMsg_ReturnValue, IndexedDBMsg_Value)
IPC_STRUCT_MEMBER(content::IndexedDBKeyPath, key_path)
IPC_STRUCT_END()
+// WebIDBDatabase::observe() message.
+IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseObserve_Params)
+ // The database the observer observers on.
+ IPC_STRUCT_MEMBER(int32_t, ipc_database_id)
+ // The transaction it's associated with.
+ IPC_STRUCT_MEMBER(int32_t, transaction_id)
+ IPC_STRUCT_MEMBER(int32_t, observer_id)
+ IPC_STRUCT_MEMBER(bool, include_transaction)
+ IPC_STRUCT_MEMBER(bool, no_records)
+ IPC_STRUCT_MEMBER(bool, values)
+IPC_STRUCT_END()
+
// Used to set a value in an object store.
IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabasePut_Params)
// The id any response should contain.
@@ -358,6 +373,22 @@ IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksUpgradeNeeded_Params)
IPC_STRUCT_MEMBER(IndexedDBDatabaseMetadata, idb_metadata)
IPC_STRUCT_END()
+IPC_STRUCT_BEGIN(IndexedDBMsg_Observation)
+ IPC_STRUCT_MEMBER(int64_t, object_store_id)
+ IPC_STRUCT_MEMBER(blink::WebIDBOperationType, type)
+ IPC_STRUCT_MEMBER(content::IndexedDBKeyRange, key_range)
+IPC_STRUCT_END()
+
+// IPC_MESSAGE macros fail on the std::map, when expanding. We need to define
+// a type to avoid that.
+// Map observer_id to corresponding set of indices in observations.
+using ObservationIndex = std::map<int32_t, std::vector<int32_t>>;
+
+IPC_STRUCT_BEGIN(IndexedDBMsg_ObserverChanges)
+ IPC_STRUCT_MEMBER(ObservationIndex, observation_index)
+ IPC_STRUCT_MEMBER(std::vector<IndexedDBMsg_Observation>, observations)
+IPC_STRUCT_END()
+
// Indexed DB messages sent from the browser to the renderer.
// The thread_id needs to be the first parameter in these messages. In the IO
@@ -439,8 +470,12 @@ IPC_MESSAGE_CONTROL3(IndexedDBMsg_DatabaseCallbacksComplete,
int32_t, /* ipc_thread_id */
int32_t, /* ipc_database_callbacks_id */
int64_t) /* transaction_id */
+IPC_MESSAGE_CONTROL3(IndexedDBMsg_DatabaseCallbacksChanges,
+ int32_t, /* ipc_thread_id */
+ int32_t, /* ipc_database_id */
+ IndexedDBMsg_ObserverChanges)
-// Indexed DB messages sent from the renderer to the browser.
+// Indexed DB messages sent from the render to the browser.
jsbell 2016/07/14 20:08:13 This should be "renderer"
palakj1 2016/07/15 20:16:04 Done.
// WebIDBCursor::advance() message.
IPC_MESSAGE_CONTROL4(IndexedDBHostMsg_CursorAdvance,
@@ -485,12 +520,6 @@ IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_FactoryDeleteDatabase,
IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_AckReceivedBlobs,
std::vector<std::string>) /* uuids */
-// WebIDBDatabase::observe() message.
-IPC_MESSAGE_CONTROL3(IndexedDBHostMsg_DatabaseObserve,
- int32_t, /* ipc_database_id */
- int64_t, /* transaction_id */
- int32_t) /* observer_id */
-
// WebIDBDatabase::unobserve() message.
IPC_MESSAGE_CONTROL2(IndexedDBHostMsg_DatabaseUnobserve,
int32_t, /* ipc_database_id */
@@ -530,6 +559,10 @@ IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseGet,
IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseGetAll,
IndexedDBHostMsg_DatabaseGetAll_Params)
+// WebIDBDatabase::observe() message.
+IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseObserve,
+ IndexedDBHostMsg_DatabaseObserve_Params)
+
// WebIDBDatabase::put() message.
IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabasePut,
IndexedDBHostMsg_DatabasePut_Params)

Powered by Google App Engine
This is Rietveld 408576698