Add typemaps for MessagePortMessage mojo struct

Desktop / Chromium - Marijn Kruisselbrink [chromium.org] - 13 October 2017 21:34 UTC

This splits the mojom MessagePortMessage struct into CloneableMessage and TransferableMessage structs, and adds typemaps to map these structs to either blink::*Message or blink::Blink*Message, and uses the split out CloneableMessage struct type in the BroadcastChannel mojo interface.

In a follow-up CL CloneableMessage will be expended with Blob handles to keep blobs that are part of the message alive, at which point sharing the same serialization logic will make code a lot simpler.

Other follow-up patches will use the same struct for other postMessage APIs/IPCs/mojo interfaces.

Bug: 740744, 351753 Change-Id: I6cb6849352f7726cb9628b0156a507e08745fabe Reviewed-on: https://chromium-review.googlesource.com/600541

94b81b5 Add typemaps for MessagePortMessage mojo struct.
content/browser/BUILD.gn | 1 +
.../broadcast_channel_provider.cc | 10 +++---
.../broadcast_channel/broadcast_channel_provider.h | 2 +-
.../bindings/chromium_bindings_configuration.gni | 1 +
third_party/WebKit/Source/core/BUILD.gn | 3 ++
third_party/WebKit/Source/core/dom/BUILD.gn | 12 ++++---
...gePortMessage.cpp => BlinkCloneableMessage.cpp} | 6 ++--
...essagePortMessage.h => BlinkCloneableMessage.h} | 19 +++++-----
.../core/dom/BlinkCloneableMessageStructTraits.cpp | 20 +++++++++++
.../core/dom/BlinkCloneableMessageStructTraits.h | 31 +++++++++++++++++
.../core/dom/BlinkMessagePortMessageStructTraits.h | 39 ---------------------
.../core/dom/BlinkTransferableMessage.cpp} | 6 ++--
.../Source/core/dom/BlinkTransferableMessage.h | 28 +++++++++++++++
...pp => BlinkTransferableMessageStructTraits.cpp} | 20 +++++------
.../dom/BlinkTransferableMessageStructTraits.h | 40 ++++++++++++++++++++++
.../Source/core/dom/CloneableMessage.typemap | 15 ++++++++
third_party/WebKit/Source/core/dom/MessagePort.cpp | 12 +++----
third_party/WebKit/Source/core/dom/MessagePort.h | 4 +--
third_party/WebKit/Source/core/dom/OWNERS | 2 ++
.../Source/core/dom/TransferableMessage.typemap | 14 ++++++++
.../modules/broadcastchannel/BroadcastChannel.cpp | 16 +++------
.../modules/broadcastchannel/BroadcastChannel.h | 2 +-
.../Source/platform/bindings/V8GlobalValueMap.h | 2 +-
.../WebKit/Source/platform/mojo/blink_typemaps.gni | 2 ++
third_party/WebKit/common/BUILD.gn | 20 ++++++++---
third_party/WebKit/common/message_port/OWNERS | 2 ++
.../common/message_port/cloneable_message.cc | 20 +++++++++++
.../WebKit/common/message_port/cloneable_message.h | 38 ++++++++++++++++++++
.../common/message_port/cloneable_message.typemap | 14 ++++++++
.../cloneable_message_struct_traits.cc | 28 +++++++++++++++
.../message_port/cloneable_message_struct_traits.h | 26 ++++++++++++++
.../WebKit/common/message_port/message_port.mojom | 22 +++++++++---
.../common/message_port/message_port_channel.cc | 14 ++++----
.../common/message_port/message_port_message.h | 35 -------------------
.../message_port_message_struct_traits.cc | 23 -------------
.../message_port_message_struct_traits.h | 32 -----------------
.../common/message_port/transferable_message.cc | 15 ++++++++
.../common/message_port/transferable_message.h | 31 +++++++++++++++++
.../message_port/transferable_message.typemap | 15 ++++++++
.../transferable_message_struct_traits.cc | 26 ++++++++++++++
.../transferable_message_struct_traits.h | 33 ++++++++++++++++++
third_party/WebKit/common/typemaps.gni | 8 +++++
third_party/WebKit/public/BUILD.gn | 33 +++++++++++++++++-
.../broadcastchannel/broadcast_channel.mojom | 6 ++--
44 files changed, 542 insertions(+), 206 deletions(-)

Upstream: git.chromium.org


  • Share