Enable lazy mojo serialization for MessagePort messages |
|||
Issue descriptionIn-process messages should skip serialization, to enable passing SharedArrayBuffers over message ports. (split of from 750468)
,
Jan 2 2018
Yes. They'll still be serialized to SerializedScriptValue, but that SSV is then passed directly to the receiving MessagePort, skipping any further mojo specific serialization.
,
Jan 2 2018
,
Jan 2 2018
Actually doing the lazy mojo serialization is pretty straight forward, but that's not enough to be fully spec compliant, because if a message is sent from one agent cluster to another agent in a different agent cluster we do still need to make sure to not share SAB and WASM modules, even if they happen to be in the same renderer process (the easiest way would of course be to explicitly serialize in those cases). But not sure if blink already has some way of checking if two ExecutionContexts are in the same agent cluster.
,
Jan 2 2018
And the same-agent-cluster check should probably be in SerializedScriptValue (de)serialization, so I'll for now work around it in MessagePort by mojo-serializing a little more than necessarily until SSV is updated to have the proper same-agent-cluster checks (and I'll file a separate bug for that).
,
Jan 2 2018
Filed issue 798572 for the SSV agent cluster check.
,
Jan 3 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9022043fbc593f52e0694f08de0a53368d994064 commit 9022043fbc593f52e0694f08de0a53368d994064 Author: Marijn Kruisselbrink <mek@chromium.org> Date: Wed Jan 03 22:00:15 2018 Skip mojo serialization for MessagePort messages that stay in process. This will help enable SharedArrayBuffer to be posted to other agents in the same agent cluster. Bug: 798557 Change-Id: I2fe3baa11e7aa910ecff75fb11bb5f521810c84f Reviewed-on: https://chromium-review.googlesource.com/840606 Commit-Queue: Marijn Kruisselbrink <mek@chromium.org> Reviewed-by: Ken Rockot <rockot@chromium.org> Cr-Commit-Position: refs/heads/master@{#526832} [modify] https://crrev.com/9022043fbc593f52e0694f08de0a53368d994064/mojo/public/tools/bindings/BUILD.gn [modify] https://crrev.com/9022043fbc593f52e0694f08de0a53368d994064/mojo/public/tools/bindings/generators/cpp_templates/module-shared-internal.h.tmpl [add] https://crrev.com/9022043fbc593f52e0694f08de0a53368d994064/mojo/public/tools/bindings/generators/cpp_templates/struct_unserialized_message_context.tmpl [modify] https://crrev.com/9022043fbc593f52e0694f08de0a53368d994064/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_declaration.tmpl [modify] https://crrev.com/9022043fbc593f52e0694f08de0a53368d994064/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/9022043fbc593f52e0694f08de0a53368d994064/third_party/WebKit/Source/core/messaging/MessagePort.cpp
,
Jan 3 2018
|
|||
►
Sign in to add a comment |
|||
Comment 1 by jbroman@chromium.org
, Jan 2 2018