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..f96a08f8ab936c03d66ad6a8b2a736fa5fcd93f9 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,22 @@ IPC_STRUCT_BEGIN(IndexedDBMsg_CallbacksUpgradeNeeded_Params) |
IPC_STRUCT_MEMBER(IndexedDBDatabaseMetadata, idb_metadata) |
IPC_STRUCT_END() |
+IPC_STRUCT_BEGIN(IndexedDBMsg_Observation) |
+ IPC_STRUCT_MEMBER(int32_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 |
jsbell
2016/07/11 18:25:33
Interesting; I thought std::map just wasn't suppor
palakj1
2016/07/11 22:25:40
None that I could find.
|
+// a type to avoid that. |
+// map observer_id to corresponding set of indices in observations. |
jsbell
2016/07/11 18:25:33
Nit: "Map ..."
palakj1
2016/07/11 22:25:40
Done.
|
+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 +459,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_id */ |
+ IndexedDBMsg_ObserverChanges) |
// WebIDBCursor::advance() message. |
IPC_MESSAGE_CONTROL4(IndexedDBHostMsg_CursorAdvance, |