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

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: Post dmurph review 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..15918815a2fbb838de7bb16a0479ab495edb2daf 100644
--- a/content/common/indexed_db/indexed_db_messages.h
+++ b/content/common/indexed_db/indexed_db_messages.h
@@ -10,11 +10,13 @@
#include <utility>
#include <vector>
+#include "base/memory/ptr_util.h"
#include "content/common/indexed_db/indexed_db_key.h"
#include "content/common/indexed_db/indexed_db_key_path.h"
#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 +44,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)
@@ -358,6 +362,21 @@ IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksUpgradeNeeded_Params)
IPC_STRUCT_MEMBER(IndexedDBDatabaseMetadata, idb_metadata)
IPC_STRUCT_END()
+IPC_STRUCT_BEGIN(IndexedDBObservation)
+ 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 ObservationMap = std::map<int32_t, std::vector<int32_t>>;
+
+IPC_STRUCT_BEGIN(IndexedDBObserverChanges)
+ IPC_STRUCT_MEMBER(ObservationMap, observation_index)
+ IPC_STRUCT_MEMBER(std::vector<IndexedDBObservation>, 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 +458,10 @@ IPC_MESSAGE_CONTROL3(IndexedDBMsg_DatabaseCallbacksComplete,
int32_t, /* ipc_thread_id */
int32_t, /* ipc_database_callbacks_id */
int64_t) /* transaction_id */
-
-// Indexed DB messages sent from the renderer to the browser.
+IPC_MESSAGE_CONTROL3(IndexedDBMsg_DatabaseCallbacksChanges,
+ int32_t, /* ipc_thread_id */
+ int32_t, /* ipc_database_callbacks_id */
+ IndexedDBObserverChanges)
// WebIDBCursor::advance() message.
IPC_MESSAGE_CONTROL4(IndexedDBHostMsg_CursorAdvance,

Powered by Google App Engine
This is Rietveld 408576698