New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 752631 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
please use my google.com address
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Mojo: Eliminate handle-collection phase from serialization

Project Member Reported by roc...@chromium.org, Aug 4 2017

Issue description

We can reduce code size and complexity by completely eliminating the prepare-to-serialize step of bindings serialization, which is currently used to collect handles.

This step imposes complexity on typemapping code as well as requiring SerializationContext to maintain a dynamic "null state" vector to which the serialization phase can then refer. For one example of extra subtelty here, typemaps which map a field that's an array of handles still cannot actually make the guarantee that their accessor is called only once.

We can support augmenting message objects with additional handles in a way that only incurs a single extra allocation during serialization regardless of the number of handle attachment API calls.

 
Description: Show this description
Project Member

Comment 2 by bugdroid1@chromium.org, Aug 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/766e76688799b31cca595984c31d30f03da1c625

commit 766e76688799b31cca595984c31d30f03da1c625
Author: Ken Rockot <rockot@chromium.org>
Date: Thu Aug 10 05:37:15 2017

Mojo: More flexible message serialization

Augments MojoExtendSerializedMessagePayload to allow for the
attachment of additional handles to the target message.

Introduces MojoCommitSerializedMessageContents() API as an
explicit means to finalize the dimensions (payload size and
to aggregate and defer the work of extended handle attachment
serialization into a single operation.

BUG= 752631 

Change-Id: Iaa7e6d02e57764ec92cb794f5e970faff9166b2d
Reviewed-on: https://chromium-review.googlesource.com/602930
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493286}
[modify] https://crrev.com/766e76688799b31cca595984c31d30f03da1c625/mojo/edk/embedder/entrypoints.cc
[modify] https://crrev.com/766e76688799b31cca595984c31d30f03da1c625/mojo/edk/system/core.cc
[modify] https://crrev.com/766e76688799b31cca595984c31d30f03da1c625/mojo/edk/system/core.h
[modify] https://crrev.com/766e76688799b31cca595984c31d30f03da1c625/mojo/edk/system/handle_table.cc
[modify] https://crrev.com/766e76688799b31cca595984c31d30f03da1c625/mojo/edk/system/message_unittest.cc
[modify] https://crrev.com/766e76688799b31cca595984c31d30f03da1c625/mojo/edk/system/node_controller.cc
[modify] https://crrev.com/766e76688799b31cca595984c31d30f03da1c625/mojo/edk/system/user_message_impl.cc
[modify] https://crrev.com/766e76688799b31cca595984c31d30f03da1c625/mojo/edk/system/user_message_impl.h
[modify] https://crrev.com/766e76688799b31cca595984c31d30f03da1c625/mojo/public/c/system/message_pipe.h
[modify] https://crrev.com/766e76688799b31cca595984c31d30f03da1c625/mojo/public/c/system/thunks.cc
[modify] https://crrev.com/766e76688799b31cca595984c31d30f03da1c625/mojo/public/c/system/thunks.h
[modify] https://crrev.com/766e76688799b31cca595984c31d30f03da1c625/mojo/public/cpp/bindings/lib/buffer.cc
[modify] https://crrev.com/766e76688799b31cca595984c31d30f03da1c625/mojo/public/cpp/bindings/tests/validation_unittest.cc
[modify] https://crrev.com/766e76688799b31cca595984c31d30f03da1c625/mojo/public/cpp/system/message_pipe.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Aug 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fda282af5fded17df0f15b61c0907aba81609ea4

commit fda282af5fded17df0f15b61c0907aba81609ea4
Author: Ken Rockot <rockot@chromium.org>
Date: Thu Aug 10 16:29:12 2017

Mojo Bindings: Single-phase serialization

Eliminates the handle-collection phase of serialization in C++ bindings.

BUG= 752631 

Change-Id: I4c18a26259b02ac0d6defb741042b22393486381
Reviewed-on: https://chromium-review.googlesource.com/606732
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493420}
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/lib/array_serialization.h
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/lib/buffer.cc
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/lib/buffer.h
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/lib/handle_interface_serialization.h
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/lib/map_serialization.h
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/lib/message.cc
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/lib/native_struct_serialization.cc
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/lib/native_struct_serialization.h
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/lib/serialization.h
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/lib/serialization_context.cc
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/lib/serialization_context.h
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/lib/serialization_forward.h
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/lib/serialization_util.h
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/lib/string_serialization.h
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/lib/unserialized_message_context.cc
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/lib/unserialized_message_context.h
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/message.h
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/tests/data_view_unittest.cc
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/tests/struct_unittest.cc
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/tests/union_unittest.cc
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/tools/bindings/generators/cpp_templates/interface_macros.tmpl
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_declaration.tmpl
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/tools/bindings/generators/cpp_templates/union_serialization_declaration.tmpl
[modify] https://crrev.com/fda282af5fded17df0f15b61c0907aba81609ea4/mojo/public/tools/bindings/generators/mojom_cpp_generator.py

Comment 4 by roc...@chromium.org, Aug 10 2017

Status: Fixed (was: Started)

Sign in to add a comment