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

Issue 725321 link

Starred by 4 users

Issue metadata

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



Sign in to add a comment

Implement deferred serialization in Mojo

Project Member Reported by roc...@chromium.org, May 23 2017

Issue description

The primary motivation is improved performance for intra-process pipes, but this should also simplify the layered serialization logic inside the EDK and make support for binary version skew more tractable.
 
Project Member

Comment 1 by bugdroid1@chromium.org, May 31 2017

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

commit 77c59a87000dc29ebe28488b9302590081463f6e
Author: Ken Rockot <rockot@chromium.org>
Date: Wed May 31 01:49:20 2017

Mojo EDK: Refactor layered message serialization

Consolidates and simplifies user message serialization within the EDK.
Namely:

  * The ports layer no longer operates under the assumption that all
  events exist exclusively in serialized form. This eliminates the
  complexity of layered message allocation at the cost of a small amount
  of extra copying in some cases.

  * ports::Message is now more aptly named ports::Event, and different
  event types are subclasses.

  * Introduces a ports::UserMessage base class for ports embedder
  message types. These can be attached to ports::UserMessageEvent
  objects.

  * The MessageForTransit and PortsMessage types have been flattened
  into a single UserMessageImpl type, a subclass of ports::UserMessage.

  * Nearly all user message serialization and deserialization logic has
  been consolidated into UserMessageImpl. A few small pieces remain
  isolated in node_controller.cc and will eventually move elsewhere
  after additional refactoring.

All of this work is a precursor to supporting lazy serialization.

BUG= 725321 

Change-Id: Ib9e66cd0d5b88ac0e6dc898f248c958039078023
Reviewed-on: https://chromium-review.googlesource.com/516402
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#475731}
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/BUILD.gn
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/core.cc
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/core.h
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/core_test_base.cc
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/data_pipe_consumer_dispatcher.cc
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/data_pipe_control_message.cc
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/data_pipe_producer_dispatcher.cc
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/dispatcher.cc
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/dispatcher.h
[delete] https://crrev.com/da2bfbbb47cacfdf9487c9e14f4afef0945729b7/mojo/edk/system/message_for_transit.cc
[delete] https://crrev.com/da2bfbbb47cacfdf9487c9e14f4afef0945729b7/mojo/edk/system/message_for_transit.h
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/message_pipe_dispatcher.cc
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/message_pipe_dispatcher.h
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/node_channel.cc
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/node_channel.h
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/node_controller.cc
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/node_controller.h
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/ports/BUILD.gn
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/ports/event.cc
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/ports/event.h
[delete] https://crrev.com/da2bfbbb47cacfdf9487c9e14f4afef0945729b7/mojo/edk/system/ports/message.cc
[delete] https://crrev.com/da2bfbbb47cacfdf9487c9e14f4afef0945729b7/mojo/edk/system/ports/message.h
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/ports/message_filter.h
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/ports/message_queue.cc
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/ports/message_queue.h
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/ports/node.cc
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/ports/node.h
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/ports/node_delegate.h
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/ports/port.h
[modify] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/ports/ports_unittest.cc
[add] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/ports/user_message.h
[delete] https://crrev.com/da2bfbbb47cacfdf9487c9e14f4afef0945729b7/mojo/edk/system/ports_message.cc
[delete] https://crrev.com/da2bfbbb47cacfdf9487c9e14f4afef0945729b7/mojo/edk/system/ports_message.h
[add] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/user_message_impl.cc
[add] https://crrev.com/77c59a87000dc29ebe28488b9302590081463f6e/mojo/edk/system/user_message_impl.h

Project Member

Comment 2 by bugdroid1@chromium.org, May 31 2017

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

commit 9a9457b324f2f57511d6a1cd9a00a86b7f96837c
Author: Takeshi Yoshino <tyoshino@chromium.org>
Date: Wed May 31 04:45:25 2017

Revert "Mojo EDK: Refactor layered message serialization"

This reverts commit 77c59a87000dc29ebe28488b9302590081463f6e.

Reason for revert: Broke build. See the comment on the original review.

Original change's description:
> Mojo EDK: Refactor layered message serialization
> 
> Consolidates and simplifies user message serialization within the EDK.
> Namely:
> 
>   * The ports layer no longer operates under the assumption that all
>   events exist exclusively in serialized form. This eliminates the
>   complexity of layered message allocation at the cost of a small amount
>   of extra copying in some cases.
> 
>   * ports::Message is now more aptly named ports::Event, and different
>   event types are subclasses.
> 
>   * Introduces a ports::UserMessage base class for ports embedder
>   message types. These can be attached to ports::UserMessageEvent
>   objects.
> 
>   * The MessageForTransit and PortsMessage types have been flattened
>   into a single UserMessageImpl type, a subclass of ports::UserMessage.
> 
>   * Nearly all user message serialization and deserialization logic has
>   been consolidated into UserMessageImpl. A few small pieces remain
>   isolated in node_controller.cc and will eventually move elsewhere
>   after additional refactoring.
> 
> All of this work is a precursor to supporting lazy serialization.
> 
> BUG= 725321 
> 
> Change-Id: Ib9e66cd0d5b88ac0e6dc898f248c958039078023
> Reviewed-on: https://chromium-review.googlesource.com/516402
> Commit-Queue: Ken Rockot <rockot@chromium.org>
> Reviewed-by: Jay Civelli <jcivelli@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#475731}

TBR=jcivelli@chromium.org,rockot@chromium.org
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
BUG= 725321 

Change-Id: I84f950290e6c45dc830f2bc3177af09ae955f432
Reviewed-on: https://chromium-review.googlesource.com/518742
Reviewed-by: Takeshi Yoshino <tyoshino@chromium.org>
Commit-Queue: Takeshi Yoshino <tyoshino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#475805}
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/BUILD.gn
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/core.cc
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/core.h
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/core_test_base.cc
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/data_pipe_consumer_dispatcher.cc
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/data_pipe_control_message.cc
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/data_pipe_producer_dispatcher.cc
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/dispatcher.cc
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/dispatcher.h
[add] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/message_for_transit.cc
[add] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/message_for_transit.h
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/message_pipe_dispatcher.cc
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/message_pipe_dispatcher.h
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/node_channel.cc
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/node_channel.h
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/node_controller.cc
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/node_controller.h
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/ports/BUILD.gn
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/ports/event.cc
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/ports/event.h
[add] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/ports/message.cc
[add] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/ports/message.h
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/ports/message_filter.h
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/ports/message_queue.cc
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/ports/message_queue.h
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/ports/node.cc
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/ports/node.h
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/ports/node_delegate.h
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/ports/port.h
[modify] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/ports/ports_unittest.cc
[delete] https://crrev.com/47cd98bbaa7eb5ffffee7469182446f5e2548b12/mojo/edk/system/ports/user_message.h
[add] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/ports_message.cc
[add] https://crrev.com/9a9457b324f2f57511d6a1cd9a00a86b7f96837c/mojo/edk/system/ports_message.h
[delete] https://crrev.com/47cd98bbaa7eb5ffffee7469182446f5e2548b12/mojo/edk/system/user_message_impl.cc
[delete] https://crrev.com/47cd98bbaa7eb5ffffee7469182446f5e2548b12/mojo/edk/system/user_message_impl.h

Project Member

Comment 3 by bugdroid1@chromium.org, May 31 2017

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

commit 5d983728fda05c6669287d858c82562e1090e9b2
Author: Ken Rockot <rockot@chromium.org>
Date: Wed May 31 06:14:44 2017

Revert "Revert "Mojo EDK: Refactor layered message serialization""

This reverts commit 9a9457b324f2f57511d6a1cd9a00a86b7f96837c.

Reason for revert: Relanding this change as the broken test was invalid anyway and has since been removed. Sorry for the churn!

Original change's description:
> Revert "Mojo EDK: Refactor layered message serialization"
> 
> This reverts commit 77c59a87000dc29ebe28488b9302590081463f6e.
> 
> Reason for revert: Broke build. See the comment on the original review.
> 
> Original change's description:
> > Mojo EDK: Refactor layered message serialization
> > 
> > Consolidates and simplifies user message serialization within the EDK.
> > Namely:
> > 
> >   * The ports layer no longer operates under the assumption that all
> >   events exist exclusively in serialized form. This eliminates the
> >   complexity of layered message allocation at the cost of a small amount
> >   of extra copying in some cases.
> > 
> >   * ports::Message is now more aptly named ports::Event, and different
> >   event types are subclasses.
> > 
> >   * Introduces a ports::UserMessage base class for ports embedder
> >   message types. These can be attached to ports::UserMessageEvent
> >   objects.
> > 
> >   * The MessageForTransit and PortsMessage types have been flattened
> >   into a single UserMessageImpl type, a subclass of ports::UserMessage.
> > 
> >   * Nearly all user message serialization and deserialization logic has
> >   been consolidated into UserMessageImpl. A few small pieces remain
> >   isolated in node_controller.cc and will eventually move elsewhere
> >   after additional refactoring.
> > 
> > All of this work is a precursor to supporting lazy serialization.
> > 
> > BUG= 725321 
> > 
> > Change-Id: Ib9e66cd0d5b88ac0e6dc898f248c958039078023
> > Reviewed-on: https://chromium-review.googlesource.com/516402
> > Commit-Queue: Ken Rockot <rockot@chromium.org>
> > Reviewed-by: Jay Civelli <jcivelli@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#475731}
> 
> TBR=jcivelli@chromium.org,rockot@chromium.org
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> BUG= 725321 
> 
> Change-Id: I84f950290e6c45dc830f2bc3177af09ae955f432
> Reviewed-on: https://chromium-review.googlesource.com/518742
> Reviewed-by: Takeshi Yoshino <tyoshino@chromium.org>
> Commit-Queue: Takeshi Yoshino <tyoshino@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#475805}

TBR=abarth@chromium.org,jcivelli@chromium.org,aa@chromium.org,rockot@chromium.org,tyoshino@chromium.org,darin@chromium.org,chromium-reviews@chromium.org,findit-for-me@appspot.gserviceaccount.com
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
BUG= 725321 

Change-Id: I5a2dbe4abf2e1f576bcf3f7f651f3557583d9033
Reviewed-on: https://chromium-review.googlesource.com/518427
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#475825}
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/BUILD.gn
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/core.cc
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/core.h
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/core_test_base.cc
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/data_pipe_consumer_dispatcher.cc
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/data_pipe_control_message.cc
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/data_pipe_producer_dispatcher.cc
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/dispatcher.cc
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/dispatcher.h
[delete] https://crrev.com/fa78f83615f6278ffe657bb6119d1b8339920b36/mojo/edk/system/message_for_transit.cc
[delete] https://crrev.com/fa78f83615f6278ffe657bb6119d1b8339920b36/mojo/edk/system/message_for_transit.h
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/message_pipe_dispatcher.cc
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/message_pipe_dispatcher.h
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/node_channel.cc
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/node_channel.h
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/node_controller.cc
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/node_controller.h
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/ports/BUILD.gn
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/ports/event.cc
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/ports/event.h
[delete] https://crrev.com/fa78f83615f6278ffe657bb6119d1b8339920b36/mojo/edk/system/ports/message.cc
[delete] https://crrev.com/fa78f83615f6278ffe657bb6119d1b8339920b36/mojo/edk/system/ports/message.h
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/ports/message_filter.h
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/ports/message_queue.cc
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/ports/message_queue.h
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/ports/node.cc
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/ports/node.h
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/ports/node_delegate.h
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/ports/port.h
[modify] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/ports/ports_unittest.cc
[add] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/ports/user_message.h
[delete] https://crrev.com/fa78f83615f6278ffe657bb6119d1b8339920b36/mojo/edk/system/ports_message.cc
[delete] https://crrev.com/fa78f83615f6278ffe657bb6119d1b8339920b36/mojo/edk/system/ports_message.h
[add] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/user_message_impl.cc
[add] https://crrev.com/5d983728fda05c6669287d858c82562e1090e9b2/mojo/edk/system/user_message_impl.h

Project Member

Comment 4 by bugdroid1@chromium.org, May 31 2017

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

commit 092ac05d47389f995f1a111072622e5ac69a024f
Author: Ken Rockot <rockot@chromium.org>
Date: Wed May 31 11:15:36 2017

Mojo EDK: Avoid redundant local proxies

Previously any time a UserMessageEvent incurred a hop, any ports it
carried would be duplicated to new ports and set up as proxies to the
new duplicates. While this step is necessary to facilitate cross-node
port transfer, it is completely redundant (and substantial computational
overhead) for messages that are only hopping from one local port to
another.

This introduces a simple optimization whereby messages forwarded from
one local port to another do not setup proxies for carried ports.

A quick test shows that this reduces the total number of ports events
processed on browser startup -- roughly up until the NTP is fully
rendered -- by a factor of ~4.5x. Prior to the patch there are
consistently about 1250 events processed in the browser process alone,
between launch and NTP render. After the patch it's about 280.

BUG= 725321 ,726489

Change-Id: Iddb1503c51137eae8e3a67312f59f9e1a5264d50
Reviewed-on: https://chromium-review.googlesource.com/516469
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#475875}
[modify] https://crrev.com/092ac05d47389f995f1a111072622e5ac69a024f/mojo/edk/system/ports/node.cc
[modify] https://crrev.com/092ac05d47389f995f1a111072622e5ac69a024f/mojo/edk/system/ports/ports_unittest.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Jun 7 2017

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

commit e4b53eb762d71e7dc9ea44fd635635a83dad7b90
Author: Ken Rockot <rockot@chromium.org>
Date: Wed Jun 07 02:09:25 2017

Mojo EDK: Refactor Ports synchronization

Every Port in the EDK has its own thread-safe state guarded by its own
base::Lock. There are a few occasions where it becomes necessary to lock
multiple arbitrary Ports' locks simultaneously.

In order to safeguard such overlapping locks in the past, we've treated
the (effectively global) |ports_lock_| -- which also guards access to
the global Port map -- as a necessary precursor for multi-Port lock
acquisition. While this is sufficient, it needlessly complicates several
common codepaths and imposes quite a bit of unnecessary mutual
exclusion across the system.

This CL eliminates such treatment of |ports_lock_|, leaving the relevant
locking constraints as follows:

  - |ports_lock_| still may not be acquired while holding any individual
    Port's lock.
  - Port locks may be acquired while |ports_lock_| is held; it is
    allowed but not necessary to acquire |ports_lock_| first.
  - Individual Port locks must be acquired in a globally consistent
    order.

In order to make the third constraint feasible, Port locks must be
acquired exclusively using a new PortLocker helper. PortLocker takes
care of locking multiple ports simultaneously in a globally consistent
order and ensures that only one PortLocker exists concurrently on any
single thread.

The more granular locking here enables a few interesting possibilities,
including reentrant event forwarding (and thus further simplification of
EDK code) and safe lazy serialization of user message objects.

BUG=726489, 725321 

Change-Id: Iba1e4cecb3e54f617c54cf070bc4b68fcbb12290
Reviewed-on: https://chromium-review.googlesource.com/526299
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#477513}
[modify] https://crrev.com/e4b53eb762d71e7dc9ea44fd635635a83dad7b90/mojo/edk/system/ports/BUILD.gn
[modify] https://crrev.com/e4b53eb762d71e7dc9ea44fd635635a83dad7b90/mojo/edk/system/ports/message_queue.cc
[modify] https://crrev.com/e4b53eb762d71e7dc9ea44fd635635a83dad7b90/mojo/edk/system/ports/message_queue.h
[modify] https://crrev.com/e4b53eb762d71e7dc9ea44fd635635a83dad7b90/mojo/edk/system/ports/node.cc
[modify] https://crrev.com/e4b53eb762d71e7dc9ea44fd635635a83dad7b90/mojo/edk/system/ports/node.h
[modify] https://crrev.com/e4b53eb762d71e7dc9ea44fd635635a83dad7b90/mojo/edk/system/ports/port.h
[add] https://crrev.com/e4b53eb762d71e7dc9ea44fd635635a83dad7b90/mojo/edk/system/ports/port_locker.cc
[add] https://crrev.com/e4b53eb762d71e7dc9ea44fd635635a83dad7b90/mojo/edk/system/ports/port_locker.h
[modify] https://crrev.com/e4b53eb762d71e7dc9ea44fd635635a83dad7b90/mojo/edk/system/ports/port_ref.cc
[modify] https://crrev.com/e4b53eb762d71e7dc9ea44fd635635a83dad7b90/mojo/edk/system/ports/port_ref.h

Project Member

Comment 6 by bugdroid1@chromium.org, Jun 12 2017

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

commit 15b2b0b0e96b31574fd1a975a9acef92a71a7842
Author: Ken Rockot <rockot@chromium.org>
Date: Mon Jun 12 22:24:27 2017

Mojo: Support lazy serialization.

Implements two new public C API calls: MojoCreateMessage and
MojoGetMessageContext. This constitutes the bulk of what's needed to
support basic lazy message serialization as described in the proposal[1].

Follow-up CLs will introduce additional API surface - namely
MojoSerializeMessage and MojoGetSerializedMessageContents -- and
rename or rework existing APIs to match the details of the proposal.

[1] https://groups.google.com/a/chromium.org/forum/#!topic/chromium-mojo/4CA0Ip56lgA

BUG= 725321 

Change-Id: Ifdd0ee9ed69ab49c6324ea3f02e1efab74ea5175
Reviewed-on: https://chromium-review.googlesource.com/527556
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#478791}
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/embedder/entrypoints.cc
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/system/BUILD.gn
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/system/core.cc
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/system/core.h
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/system/handle_table.cc
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/system/handle_table.h
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/system/message_pipe_dispatcher.cc
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/system/message_pipe_unittest.cc
[add] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/system/message_unittest.cc
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/system/node_controller.cc
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/system/ports/BUILD.gn
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/system/ports/event.cc
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/system/ports/event.h
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/system/ports/node.cc
[add] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/system/ports/user_message.cc
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/system/ports/user_message.h
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/system/user_message_impl.cc
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/edk/system/user_message_impl.h
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/public/c/system/message_pipe.h
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/public/c/system/thunks.cc
[modify] https://crrev.com/15b2b0b0e96b31574fd1a975a9acef92a71a7842/mojo/public/c/system/thunks.h

Project Member

Comment 7 by bugdroid1@chromium.org, Jun 14 2017

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

commit fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66
Author: Ken Rockot <rockot@chromium.org>
Date: Wed Jun 14 00:26:20 2017

Mojo: Introduce more new message APIs

Per the lazy serialization proposal[1].

Adds MojoSerializeMessage and MojoGetSerializedMessageContents.
Reworks MojoReadMessageNew to match the new spec of what will eventually
replace MojoReadMessage. Deletes MojoGetMessageBuffer.

Adapts bindings serialization and message code to new API behavior.

BUG= 725321 

Change-Id: I0c5302e018b63e47e4c89a3f4783ac0dc802172d
Reviewed-on: https://chromium-review.googlesource.com/528556
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#479224}
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/embedder/entrypoints.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/core.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/core.h
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/core_test_base.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/dispatcher.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/dispatcher.h
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/handle_table.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/message_pipe_dispatcher.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/message_pipe_dispatcher.h
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/message_pipe_unittest.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/message_unittest.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/multiprocess_message_pipe_unittest.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/node_controller.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/ports/event.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/ports/message_queue.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/ports/message_queue.h
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/ports/node.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/ports/node.h
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/ports/user_message.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/ports/user_message.h
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/user_message_impl.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/edk/system/user_message_impl.h
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/public/c/system/message_pipe.h
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/public/c/system/thunks.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/public/c/system/thunks.h
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/public/cpp/bindings/lib/handle_interface_serialization.h
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/public/cpp/bindings/lib/message.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/public/cpp/bindings/lib/serialization_context.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/public/cpp/bindings/lib/serialization_context.h
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/public/cpp/bindings/message.h
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/public/cpp/bindings/tests/connector_unittest.cc
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/public/cpp/system/message.h
[modify] https://crrev.com/fdf158da5c172ccd7e4f9ae0b2cf9b4b78a9ba66/mojo/public/cpp/system/message_pipe.h

Project Member

Comment 8 by bugdroid1@chromium.org, Jun 14 2017

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

commit fada7d283d7d604fa1abbd689ba9ac944476530c
Author: Ken Rockot <rockot@chromium.org>
Date: Wed Jun 14 22:49:57 2017

Adapt Mojo system API consumers to new messaging APIs

Eliminates all but a few uses of the deprecated MojoReadMessage and
MojoWriteMessage APIs in preparation for their removal.

Part of a series of CLs to implement lazy serialization support, as
proposed in https://goo.gl/W7cHjY

BUG= 725321 
TBR=jam@chromium.org
TBR=eugenebut@chromium.org

Change-Id: If8eba94183d61f24ee9960fb8d8192b93a8df4f2
Reviewed-on: https://chromium-review.googlesource.com/530139
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#479533}
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/content/common/message_port.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/ios/web/webui/mojo_facade.mm
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/ipc/ipc_channel_mojo_unittest.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/edk/js/core.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/edk/js/tests/js_to_cpp_tests.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/edk/system/core_test_base.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/edk/system/core_unittest.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/edk/system/data_pipe_unittest.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/edk/system/message_pipe_perftest.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/edk/system/message_pipe_unittest.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/edk/system/message_unittest.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/edk/system/multiprocess_message_pipe_unittest.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/edk/test/mojo_test_base.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/public/c/system/tests/core_perftest.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/public/c/system/tests/core_unittest.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/public/c/system/tests/core_unittest_pure_c.c
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/public/cpp/bindings/tests/struct_traits_unittest.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/public/cpp/system/BUILD.gn
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/public/cpp/system/message.h
[add] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/public/cpp/system/message_pipe.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/public/cpp/system/message_pipe.h
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/public/cpp/system/tests/core_unittest.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/public/cpp/system/tests/wait_set_unittest.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/public/cpp/system/tests/wait_unittest.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/mojo/public/cpp/test_support/lib/test_utils.cc
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/third_party/WebKit/LayoutTests/mojo/message-pipe.html
[modify] https://crrev.com/fada7d283d7d604fa1abbd689ba9ac944476530c/third_party/WebKit/Source/core/mojo/MojoHandle.cpp

Project Member

Comment 9 by bugdroid1@chromium.org, Jun 16 2017

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

commit 3332d11f67f71c76cc8af6506d66167b96d0ef47
Author: Ken Rockot <rockot@chromium.org>
Date: Fri Jun 16 16:39:59 2017

Mojo: Rework Java system API impl to use message objects

Migrates the native impl of the Java system API away from
MojoReadMessage and MojoWriteMessage, instead using message objects
internally.

The native Core.readMessage API now returns a native-allocated byte[]
and int[] for payload and handles, rather than expecting Java-supplied
ByteBuffers of sufficient size to receive this data. This allows message
reads to be completed in a single native JNI call.

BUG= 725321 

Change-Id: I0b7eab4cd34d74d373ad292542a74d771ef6cfd9
Reviewed-on: https://chromium-review.googlesource.com/531662
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#480070}
[modify] https://crrev.com/3332d11f67f71c76cc8af6506d66167b96d0ef47/mojo/android/javatests/src/org/chromium/mojo/HandleMock.java
[modify] https://crrev.com/3332d11f67f71c76cc8af6506d66167b96d0ef47/mojo/android/javatests/src/org/chromium/mojo/bindings/ConnectorTest.java
[modify] https://crrev.com/3332d11f67f71c76cc8af6506d66167b96d0ef47/mojo/android/javatests/src/org/chromium/mojo/bindings/RouterTest.java
[modify] https://crrev.com/3332d11f67f71c76cc8af6506d66167b96d0ef47/mojo/android/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java
[modify] https://crrev.com/3332d11f67f71c76cc8af6506d66167b96d0ef47/mojo/android/javatests/src/org/chromium/mojo/system/impl/WatcherImplTest.java
[modify] https://crrev.com/3332d11f67f71c76cc8af6506d66167b96d0ef47/mojo/android/javatests/validation_test_util.cc
[modify] https://crrev.com/3332d11f67f71c76cc8af6506d66167b96d0ef47/mojo/android/system/core_impl.cc
[modify] https://crrev.com/3332d11f67f71c76cc8af6506d66167b96d0ef47/mojo/android/system/src/org/chromium/mojo/system/impl/CoreImpl.java
[modify] https://crrev.com/3332d11f67f71c76cc8af6506d66167b96d0ef47/mojo/android/system/src/org/chromium/mojo/system/impl/MessagePipeHandleImpl.java
[modify] https://crrev.com/3332d11f67f71c76cc8af6506d66167b96d0ef47/mojo/public/java/BUILD.gn
[modify] https://crrev.com/3332d11f67f71c76cc8af6506d66167b96d0ef47/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Connector.java
[modify] https://crrev.com/3332d11f67f71c76cc8af6506d66167b96d0ef47/mojo/public/java/bindings/src/org/chromium/mojo/bindings/ExecutorFactory.java
[modify] https://crrev.com/3332d11f67f71c76cc8af6506d66167b96d0ef47/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Message.java
[modify] https://crrev.com/3332d11f67f71c76cc8af6506d66167b96d0ef47/mojo/public/java/system/src/org/chromium/mojo/system/InvalidHandle.java
[modify] https://crrev.com/3332d11f67f71c76cc8af6506d66167b96d0ef47/mojo/public/java/system/src/org/chromium/mojo/system/MessagePipeHandle.java

Project Member

Comment 10 by bugdroid1@chromium.org, Jun 16 2017

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

commit 5b9839ca209cd11c4d899fa92202a280a5c9d222
Author: Ken Rockot <rockot@chromium.org>
Date: Fri Jun 16 23:14:24 2017

Mojo: Adapt C++ bindings to new message APIs

Replaces use of MojoAllocMessage with MojoCreateMessage et al in
preparation for supporting lazy serialzation in the C++ bindings.

This eliminates the last remaining usage of deprecated system APIs
(MojoAllocMessage, MojoGetMessageBuffer, MojoReadMessage, and
MojoWriteMessage.)

Message serialization logic such as header encoding is merged into
the Message implementation.

BUG= 725321 

Change-Id: I323ec330ed58f271a6769e7068a28be842688567
Reviewed-on: https://chromium-review.googlesource.com/536415
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#480214}
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/edk/system/message_unittest.cc
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/cpp/bindings/BUILD.gn
[add] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/cpp/bindings/lib/buffer.cc
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/cpp/bindings/lib/buffer.h
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/cpp/bindings/lib/control_message_handler.cc
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/cpp/bindings/lib/control_message_proxy.cc
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/cpp/bindings/lib/fixed_buffer.cc
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/cpp/bindings/lib/fixed_buffer.h
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/cpp/bindings/lib/message.cc
[delete] https://crrev.com/da35aa504aca2599ff4e8fc9ac400f4e8303a193/mojo/public/cpp/bindings/lib/message_buffer.cc
[delete] https://crrev.com/da35aa504aca2599ff4e8fc9ac400f4e8303a193/mojo/public/cpp/bindings/lib/message_buffer.h
[delete] https://crrev.com/da35aa504aca2599ff4e8fc9ac400f4e8303a193/mojo/public/cpp/bindings/lib/message_builder.cc
[delete] https://crrev.com/da35aa504aca2599ff4e8fc9ac400f4e8303a193/mojo/public/cpp/bindings/lib/message_builder.h
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/cpp/bindings/lib/pipe_control_message_handler.cc
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/cpp/bindings/lib/pipe_control_message_proxy.cc
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/cpp/bindings/lib/serialization.h
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/cpp/bindings/message.h
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/cpp/bindings/tests/bindings_perftest.cc
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/cpp/bindings/tests/connector_unittest.cc
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/cpp/bindings/tests/router_test_util.cc
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/cpp/bindings/tests/validation_unittest.cc
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
[modify] https://crrev.com/5b9839ca209cd11c4d899fa92202a280a5c9d222/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl

Project Member

Comment 11 by bugdroid1@chromium.org, Jun 16 2017

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

commit ef0848879420e9da7ebe1e24c1fc5ad2e913f684
Author: Ken Rockot <rockot@chromium.org>
Date: Fri Jun 16 23:39:28 2017

Remove deprecated Mojo system APIs

Renames MojoReadMessageNew and MojoWriteMessageNew to MojoReadMessage
and MojoWriteMessage, respectively. The old versions of the latter named
APIs are removed.

Also removes MojoAllocMessage, and the short-lived
MOJO_GET_SERIALIZED_MESSAGE_CONTENTS_FLAG_IGNORE_HANDLES flag which is
no longer necessary.

BUG= 725321 

Change-Id: I53771248b9edc0e5d66abe49a772b3c98e0fced9
Reviewed-on: https://chromium-review.googlesource.com/537959
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#480222}
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/edk/embedder/entrypoints.cc
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/edk/js/core.cc
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/edk/system/core.cc
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/edk/system/core.h
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/edk/system/core_test_base.cc
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/edk/system/core_unittest.cc
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/edk/system/dispatcher.cc
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/edk/system/dispatcher.h
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/edk/system/message_pipe_dispatcher.cc
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/edk/system/message_pipe_dispatcher.h
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/edk/system/message_pipe_unittest.cc
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/edk/system/message_unittest.cc
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/edk/system/multiprocess_message_pipe_unittest.cc
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/edk/system/user_message_impl.cc
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/edk/system/user_message_impl.h
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/public/c/system/message_pipe.h
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/public/c/system/tests/core_perftest.cc
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/public/c/system/tests/core_unittest.cc
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/public/c/system/tests/core_unittest_pure_c.c
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/public/c/system/thunks.cc
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/public/c/system/thunks.h
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/public/cpp/system/message.h
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/public/cpp/system/message_pipe.cc
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/public/cpp/system/message_pipe.h
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/public/cpp/test_support/lib/test_utils.cc
[modify] https://crrev.com/ef0848879420e9da7ebe1e24c1fc5ad2e913f684/mojo/public/js/core.js

Project Member

Comment 12 by bugdroid1@chromium.org, Jun 17 2017

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

commit 4c722e7117672f3da5666734c43270ba6e184a19
Author: Ken Rockot <rockot@chromium.org>
Date: Sat Jun 17 00:40:01 2017

Revert "Remove deprecated Mojo system APIs"

This reverts commit ef0848879420e9da7ebe1e24c1fc5ad2e913f684.

Reason for revert: depends on a cl which needs to be reverted

Original change's description:
> Remove deprecated Mojo system APIs
> 
> Renames MojoReadMessageNew and MojoWriteMessageNew to MojoReadMessage
> and MojoWriteMessage, respectively. The old versions of the latter named
> APIs are removed.
> 
> Also removes MojoAllocMessage, and the short-lived
> MOJO_GET_SERIALIZED_MESSAGE_CONTENTS_FLAG_IGNORE_HANDLES flag which is
> no longer necessary.
> 
> BUG= 725321 
> 
> Change-Id: I53771248b9edc0e5d66abe49a772b3c98e0fced9
> Reviewed-on: https://chromium-review.googlesource.com/537959
> Commit-Queue: Ken Rockot <rockot@chromium.org>
> Reviewed-by: Jay Civelli <jcivelli@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#480222}

TBR=jcivelli@chromium.org,rockot@chromium.org

Change-Id: I53054e87ff3743c3c18167dd08d2d82ac7f57150
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  725321 
Reviewed-on: https://chromium-review.googlesource.com/539093
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#480244}
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/edk/embedder/entrypoints.cc
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/edk/js/core.cc
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/edk/system/core.cc
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/edk/system/core.h
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/edk/system/core_test_base.cc
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/edk/system/core_unittest.cc
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/edk/system/dispatcher.cc
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/edk/system/dispatcher.h
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/edk/system/message_pipe_dispatcher.cc
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/edk/system/message_pipe_dispatcher.h
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/edk/system/message_pipe_unittest.cc
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/edk/system/message_unittest.cc
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/edk/system/multiprocess_message_pipe_unittest.cc
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/edk/system/user_message_impl.cc
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/edk/system/user_message_impl.h
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/public/c/system/message_pipe.h
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/public/c/system/tests/core_perftest.cc
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/public/c/system/tests/core_unittest.cc
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/public/c/system/tests/core_unittest_pure_c.c
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/public/c/system/thunks.cc
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/public/c/system/thunks.h
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/public/cpp/system/message.h
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/public/cpp/system/message_pipe.cc
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/public/cpp/system/message_pipe.h
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/public/cpp/test_support/lib/test_utils.cc
[modify] https://crrev.com/4c722e7117672f3da5666734c43270ba6e184a19/mojo/public/js/core.js

Project Member

Comment 13 by bugdroid1@chromium.org, Jun 17 2017

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

commit ece06fd86a0338d4d79364a494f58ff2810bdec7
Author: Ken Rockot <rockot@chromium.org>
Date: Sat Jun 17 00:45:19 2017

Revert "Mojo: Adapt C++ bindings to new message APIs"

This reverts commit 5b9839ca209cd11c4d899fa92202a280a5c9d222.

Reason for revert: broken test

Original change's description:
> Mojo: Adapt C++ bindings to new message APIs
> 
> Replaces use of MojoAllocMessage with MojoCreateMessage et al in
> preparation for supporting lazy serialzation in the C++ bindings.
> 
> This eliminates the last remaining usage of deprecated system APIs
> (MojoAllocMessage, MojoGetMessageBuffer, MojoReadMessage, and
> MojoWriteMessage.)
> 
> Message serialization logic such as header encoding is merged into
> the Message implementation.
> 
> BUG= 725321 
> 
> Change-Id: I323ec330ed58f271a6769e7068a28be842688567
> Reviewed-on: https://chromium-review.googlesource.com/536415
> Commit-Queue: Ken Rockot <rockot@chromium.org>
> Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#480214}

TBR=rockot@chromium.org,yzshen@chromium.org

Change-Id: I7ac1d6e7b2adf00d15eaf41ee2e6192efdc671f9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  725321 
Reviewed-on: https://chromium-review.googlesource.com/539094
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#480248}
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/edk/system/message_unittest.cc
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/BUILD.gn
[delete] https://crrev.com/eb4cebe4373f7aa511310ec9c39887a0fd3dc6ea/mojo/public/cpp/bindings/lib/buffer.cc
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/lib/buffer.h
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/lib/control_message_handler.cc
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/lib/control_message_proxy.cc
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/lib/fixed_buffer.cc
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/lib/fixed_buffer.h
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/lib/message.cc
[add] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/lib/message_buffer.cc
[add] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/lib/message_buffer.h
[add] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/lib/message_builder.cc
[add] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/lib/message_builder.h
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/lib/pipe_control_message_handler.cc
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/lib/pipe_control_message_proxy.cc
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/lib/serialization.h
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/message.h
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/tests/bindings_perftest.cc
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/tests/connector_unittest.cc
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/tests/router_test_util.cc
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/cpp/bindings/tests/validation_unittest.cc
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
[modify] https://crrev.com/ece06fd86a0338d4d79364a494f58ff2810bdec7/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl

Project Member

Comment 14 by bugdroid1@chromium.org, Jun 17 2017

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

commit a5a7c9557dd997c7d9520006e31db82b22373b9d
Author: Ken Rockot <rockot@chromium.org>
Date: Sat Jun 17 15:44:41 2017

Reland "Mojo: Adapt C++ bindings to new message APIs"

This is a reland of 5b9839ca209cd11c4d899fa92202a280a5c9d222

Some minor behavioral changes made to match expectations in certain
testing environments. No practical impact on production code vs the
original CL.

Original change's description:
> Mojo: Adapt C++ bindings to new message APIs
> 
> Replaces use of MojoAllocMessage with MojoCreateMessage et al in
> preparation for supporting lazy serialzation in the C++ bindings.
> 
> This eliminates the last remaining usage of deprecated system APIs
> (MojoAllocMessage, MojoGetMessageBuffer, MojoReadMessage, and
> MojoWriteMessage.)
> 
> Message serialization logic such as header encoding is merged into
> the Message implementation.
> 
> BUG= 725321 
> 
> Change-Id: I323ec330ed58f271a6769e7068a28be842688567
> Reviewed-on: https://chromium-review.googlesource.com/536415
> Commit-Queue: Ken Rockot <rockot@chromium.org>
> Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#480214}

TBR=yzshen@chromium.org

Bug:  725321 
Change-Id: Ifa30ed0f14336a233412527a1ac2d9b52b16c927
Reviewed-on: https://chromium-review.googlesource.com/539097
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#480303}
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/edk/system/core.cc
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/edk/system/message_unittest.cc
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/cpp/bindings/BUILD.gn
[add] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/cpp/bindings/lib/buffer.cc
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/cpp/bindings/lib/buffer.h
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/cpp/bindings/lib/control_message_handler.cc
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/cpp/bindings/lib/control_message_proxy.cc
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/cpp/bindings/lib/fixed_buffer.cc
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/cpp/bindings/lib/fixed_buffer.h
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/cpp/bindings/lib/message.cc
[delete] https://crrev.com/de5f24293bb231a3d770b731b0aadf549cab86ae/mojo/public/cpp/bindings/lib/message_buffer.cc
[delete] https://crrev.com/de5f24293bb231a3d770b731b0aadf549cab86ae/mojo/public/cpp/bindings/lib/message_buffer.h
[delete] https://crrev.com/de5f24293bb231a3d770b731b0aadf549cab86ae/mojo/public/cpp/bindings/lib/message_builder.cc
[delete] https://crrev.com/de5f24293bb231a3d770b731b0aadf549cab86ae/mojo/public/cpp/bindings/lib/message_builder.h
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/cpp/bindings/lib/pipe_control_message_handler.cc
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/cpp/bindings/lib/pipe_control_message_proxy.cc
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/cpp/bindings/lib/serialization.h
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/cpp/bindings/message.h
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/cpp/bindings/tests/bindings_perftest.cc
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/cpp/bindings/tests/connector_unittest.cc
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/cpp/bindings/tests/router_test_util.cc
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/cpp/bindings/tests/validation_unittest.cc
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
[modify] https://crrev.com/a5a7c9557dd997c7d9520006e31db82b22373b9d/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl

Project Member

Comment 15 by bugdroid1@chromium.org, Jun 18 2017

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

commit 349df72b01325e75fbcc25db9ee4766b13fdc433
Author: Ken Rockot <rockot@chromium.org>
Date: Sun Jun 18 02:05:31 2017

Reland "Remove deprecated Mojo system APIs"

This is a reland of ef0848879420e9da7ebe1e24c1fc5ad2e913f684

No changes from original landing. A CL on which this was based was
reverted, but has been fixed and relanded now.

Original change's description:
> Remove deprecated Mojo system APIs
> 
> Renames MojoReadMessageNew and MojoWriteMessageNew to MojoReadMessage
> and MojoWriteMessage, respectively. The old versions of the latter named
> APIs are removed.
> 
> Also removes MojoAllocMessage, and the short-lived
> MOJO_GET_SERIALIZED_MESSAGE_CONTENTS_FLAG_IGNORE_HANDLES flag which is
> no longer necessary.
> 
> BUG= 725321 
> 
> Change-Id: I53771248b9edc0e5d66abe49a772b3c98e0fced9
> Reviewed-on: https://chromium-review.googlesource.com/537959
> Commit-Queue: Ken Rockot <rockot@chromium.org>
> Reviewed-by: Jay Civelli <jcivelli@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#480222}

TBR=jcivelli@chromium.org

Bug:  725321 
Change-Id: I7d20f1a6476e18d81b178be5ac50f45023dcca00
Reviewed-on: https://chromium-review.googlesource.com/539098
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#480309}
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/edk/embedder/entrypoints.cc
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/edk/js/core.cc
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/edk/system/core.cc
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/edk/system/core.h
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/edk/system/core_test_base.cc
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/edk/system/core_unittest.cc
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/edk/system/dispatcher.cc
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/edk/system/dispatcher.h
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/edk/system/message_pipe_dispatcher.cc
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/edk/system/message_pipe_dispatcher.h
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/edk/system/message_pipe_unittest.cc
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/edk/system/message_unittest.cc
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/edk/system/multiprocess_message_pipe_unittest.cc
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/edk/system/user_message_impl.cc
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/edk/system/user_message_impl.h
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/public/c/system/message_pipe.h
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/public/c/system/tests/core_perftest.cc
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/public/c/system/tests/core_unittest.cc
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/public/c/system/tests/core_unittest_pure_c.c
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/public/c/system/thunks.cc
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/public/c/system/thunks.h
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/public/cpp/system/message.h
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/public/cpp/system/message_pipe.cc
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/public/cpp/system/message_pipe.h
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/public/cpp/test_support/lib/test_utils.cc
[modify] https://crrev.com/349df72b01325e75fbcc25db9ee4766b13fdc433/mojo/public/js/core.js

Project Member

Comment 16 by bugdroid1@chromium.org, Jun 18 2017

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

commit a2af2b23b832546af96b349a65dffe3a330f9a93
Author: Ken Rockot <rockot@chromium.org>
Date: Sun Jun 18 23:26:53 2017

Rename MojoFreeMessage -> MojoDestroyMessage

Made more sense when it was "Alloc" and "Free". But "Alloc" was
decidedly weird and the more appropriate "Create" goes better with a
"Destroy" counterpart.

So that's what this.

BUG= 725321 
TBR=jcivelli@chromium.org

Change-Id: Ib842fcefe1f4cccdbe8969aca1343d2b94206eaa
Reviewed-on: https://chromium-review.googlesource.com/538113
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#480318}
[modify] https://crrev.com/a2af2b23b832546af96b349a65dffe3a330f9a93/mojo/edk/embedder/entrypoints.cc
[modify] https://crrev.com/a2af2b23b832546af96b349a65dffe3a330f9a93/mojo/edk/js/core.cc
[modify] https://crrev.com/a2af2b23b832546af96b349a65dffe3a330f9a93/mojo/edk/system/core.cc
[modify] https://crrev.com/a2af2b23b832546af96b349a65dffe3a330f9a93/mojo/edk/system/core.h
[modify] https://crrev.com/a2af2b23b832546af96b349a65dffe3a330f9a93/mojo/edk/system/core_unittest.cc
[modify] https://crrev.com/a2af2b23b832546af96b349a65dffe3a330f9a93/mojo/edk/system/message_pipe_unittest.cc
[modify] https://crrev.com/a2af2b23b832546af96b349a65dffe3a330f9a93/mojo/edk/system/message_unittest.cc
[modify] https://crrev.com/a2af2b23b832546af96b349a65dffe3a330f9a93/mojo/edk/system/multiprocess_message_pipe_unittest.cc
[modify] https://crrev.com/a2af2b23b832546af96b349a65dffe3a330f9a93/mojo/public/c/system/message_pipe.h
[modify] https://crrev.com/a2af2b23b832546af96b349a65dffe3a330f9a93/mojo/public/c/system/tests/core_unittest.cc
[modify] https://crrev.com/a2af2b23b832546af96b349a65dffe3a330f9a93/mojo/public/c/system/thunks.cc
[modify] https://crrev.com/a2af2b23b832546af96b349a65dffe3a330f9a93/mojo/public/c/system/thunks.h
[modify] https://crrev.com/a2af2b23b832546af96b349a65dffe3a330f9a93/mojo/public/cpp/system/message.h
[modify] https://crrev.com/a2af2b23b832546af96b349a65dffe3a330f9a93/mojo/public/cpp/test_support/lib/test_utils.cc

Project Member

Comment 17 by bugdroid1@chromium.org, Jun 23 2017

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

commit 6386175109881f2bed64853e534b20f9282b1a9f
Author: Ken Rockot <rockot@chromium.org>
Date: Fri Jun 23 18:55:08 2017

Mojo: Introduce MOJO_HANDLE_SIGNAL_PEER_REMOTE

This signal indicates that a handle's peer is known to exist within a
remote execution context, e.g. in another process.

The intent of this addition is primarily to expose the state through
MojoQueryHandleSignalsState so that system API consumers (e.g. the
bindings) can make informed decisions about how to use a pipe when
needed. It is also possible to watch for the signal to be raised rather
than polling for it on-demand.

BUG= 725321 

Change-Id: Idc188d584e7b67b348ba28458d5393e01f77bf7b
Reviewed-on: https://chromium-review.googlesource.com/543538
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#481974}
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/edk/js/core.cc
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/edk/system/core_unittest.cc
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/edk/system/data_pipe_consumer_dispatcher.cc
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/edk/system/data_pipe_consumer_dispatcher.h
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/edk/system/data_pipe_producer_dispatcher.cc
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/edk/system/data_pipe_producer_dispatcher.h
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/edk/system/data_pipe_unittest.cc
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/edk/system/message_pipe_dispatcher.cc
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/edk/system/message_pipe_unittest.cc
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/edk/system/multiprocess_message_pipe_unittest.cc
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/edk/system/ports/node.cc
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/edk/system/ports/node.h
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/edk/system/ports/ports_unittest.cc
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/edk/system/signals_unittest.cc
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/public/c/system/tests/core_unittest.cc
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/public/c/system/types.h
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/public/cpp/system/handle_signals_state.h
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/public/cpp/system/tests/core_unittest.cc
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/public/cpp/system/tests/handle_signals_state_unittest.cc
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/public/cpp/system/tests/wait_unittest.cc
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/public/js/core.js
[modify] https://crrev.com/6386175109881f2bed64853e534b20f9282b1a9f/mojo/public/js/tests/core_unittest.js

Project Member

Comment 18 by bugdroid1@chromium.org, Jun 23 2017

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

commit 8aa76996bceb1380be8ae86f69633e776e552fb7
Author: Ken Rockot <rockot@chromium.org>
Date: Fri Jun 23 23:25:44 2017

Mojo: Let watchers watch for signals being cleared

The MojoWatch system API lets callers observe selected handle signals and
trigger notifications when said signals become satisfied.

This CL adds a parameter to MojoWatch so that callers can choose to
instead observe signals becoming not-satisfied. The new parameter is
an enumeration dubbed MojoWatchCondition and can take on strictly one of
two values: MOJO_WATCH_CONDITION_SIGNALED or
MOJO_WATCH_CONDITION_NOT_SIGNALED.

While not very interesting for most signal types, this ability is
particularly useful for monitoring MOJO_HANDLE_SIGNAL_PEER_REMOTE to
efficiently keep track of whether a handle and its peer are in the same
process.

BUG= 725321 
TBR=jam@chromium.org

Change-Id: Iedad6782e076d799d0ac39be6666c5b8c5e135be
Reviewed-on: https://chromium-review.googlesource.com/544044
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482068}
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/content/common/message_port.cc
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/edk/embedder/entrypoints.cc
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/edk/system/core.cc
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/edk/system/core.h
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/edk/system/dispatcher.cc
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/edk/system/dispatcher.h
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/edk/system/signals_unittest.cc
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/edk/system/watch.cc
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/edk/system/watch.h
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/edk/system/watcher_dispatcher.cc
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/edk/system/watcher_dispatcher.h
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/edk/system/watcher_unittest.cc
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/edk/test/mojo_test_base.cc
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/edk/test/mojo_test_base.h
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/public/c/system/thunks.cc
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/public/c/system/thunks.h
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/public/c/system/types.h
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/public/c/system/watcher.h
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/public/cpp/system/handle_signals_state.h
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/public/cpp/system/simple_watcher.cc
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/public/cpp/system/simple_watcher.h
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/public/cpp/system/wait.cc
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/public/cpp/system/wait.h
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/mojo/public/cpp/system/wait_set.cc
[modify] https://crrev.com/8aa76996bceb1380be8ae86f69633e776e552fb7/third_party/WebKit/Source/core/mojo/MojoWatcher.cpp

Project Member

Comment 19 by bugdroid1@chromium.org, Jun 24 2017

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

commit 8555f372bec6701b15e143866d4c9a88970df336
Author: Ken Rockot <rockot@chromium.org>
Date: Sat Jun 24 22:47:58 2017

Mojo EDK: Add missing RequestContexts

It's possible for MojoSerializeMessage and
MojoGetSerializedMessageContents to elicit handle watcher notifications.

This ensures that they have a valid RequestContext in TLS in case that
happens. 

BUG= 725321 
TBR=jcivelli@chromium.org

Change-Id: Id5960cbff0cf7ee12a578f0b066291f11e95bc51
Reviewed-on: https://chromium-review.googlesource.com/547521
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482163}
[modify] https://crrev.com/8555f372bec6701b15e143866d4c9a88970df336/mojo/edk/system/core.cc

Project Member

Comment 20 by bugdroid1@chromium.org, Jun 27 2017

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

commit ecf30db27d06ac0c6c61e24e811acfba32e34977
Author: Ken Rockot <rockot@chromium.org>
Date: Tue Jun 27 22:51:37 2017

Mojo C++ bindings: Serialize handles during message allocation

This changes C++ bindings to collect handles during the message sizing
phase of serialization so that a single Message object can be allocated
prior to full serialization.

This reduces the cost of sending messages with attached handles. It also
fulfills a necessary precondition for C++ bindings supporting lazy
serialization, as it would not be possible to re-allocate a message
object (as we do now) once a deferred serialization operation has been
coerced by Mojo internals.

In order to support this a few changes to serialization semantics are
applied here:

  - Handle and interface accessors on StructTraits must return lvalue
    references as they will be called twice: once during sizing and
    once during serialization.
  - SetUpContext and TearDownContext are always called even for nullable
    custom types which report themselves as null
  - IsNull supports being called with context so that e.g. traits can
    move or otherwise store handle and interface types in the context
    object at context creation, and these objects may in turn need to be
    used for nullability testing.

BUG= 725321 
R=yzshen@chromium.org

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I7056651222641220301e9adfce5028dc3501884f
Reviewed-on: https://chromium-review.googlesource.com/546957
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482773}
[modify] https://crrev.com/ecf30db27d06ac0c6c61e24e811acfba32e34977/mojo/public/cpp/bindings/lib/array_serialization.h
[modify] https://crrev.com/ecf30db27d06ac0c6c61e24e811acfba32e34977/mojo/public/cpp/bindings/lib/handle_interface_serialization.h
[modify] https://crrev.com/ecf30db27d06ac0c6c61e24e811acfba32e34977/mojo/public/cpp/bindings/lib/map_serialization.h
[modify] https://crrev.com/ecf30db27d06ac0c6c61e24e811acfba32e34977/mojo/public/cpp/bindings/lib/message.cc
[modify] https://crrev.com/ecf30db27d06ac0c6c61e24e811acfba32e34977/mojo/public/cpp/bindings/lib/serialization_context.cc
[modify] https://crrev.com/ecf30db27d06ac0c6c61e24e811acfba32e34977/mojo/public/cpp/bindings/lib/serialization_context.h
[modify] https://crrev.com/ecf30db27d06ac0c6c61e24e811acfba32e34977/mojo/public/cpp/bindings/lib/string_serialization.h
[modify] https://crrev.com/ecf30db27d06ac0c6c61e24e811acfba32e34977/mojo/public/cpp/bindings/message.h
[modify] https://crrev.com/ecf30db27d06ac0c6c61e24e811acfba32e34977/mojo/public/cpp/bindings/tests/connector_unittest.cc
[modify] https://crrev.com/ecf30db27d06ac0c6c61e24e811acfba32e34977/mojo/public/cpp/bindings/tests/struct_unittest.cc
[modify] https://crrev.com/ecf30db27d06ac0c6c61e24e811acfba32e34977/mojo/public/cpp/bindings/tests/union_unittest.cc
[modify] https://crrev.com/ecf30db27d06ac0c6c61e24e811acfba32e34977/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
[modify] https://crrev.com/ecf30db27d06ac0c6c61e24e811acfba32e34977/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
[modify] https://crrev.com/ecf30db27d06ac0c6c61e24e811acfba32e34977/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_declaration.tmpl
[modify] https://crrev.com/ecf30db27d06ac0c6c61e24e811acfba32e34977/mojo/public/tools/bindings/generators/cpp_templates/union_serialization_declaration.tmpl

Project Member

Comment 21 by bugdroid1@chromium.org, Jun 28 2017

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

commit 18de1d92de6f624d8f6cb3bcf67694706490d490
Author: Ken Rockot <rockot@chromium.org>
Date: Wed Jun 28 11:50:48 2017

Revert "Mojo C++ bindings: Serialize handles during message allocation"

This reverts commit ecf30db27d06ac0c6c61e24e811acfba32e34977.

Reason for revert:  https://crbug.com/737542 

Original change's description:
> Mojo C++ bindings: Serialize handles during message allocation
> 
> This changes C++ bindings to collect handles during the message sizing
> phase of serialization so that a single Message object can be allocated
> prior to full serialization.
> 
> This reduces the cost of sending messages with attached handles. It also
> fulfills a necessary precondition for C++ bindings supporting lazy
> serialization, as it would not be possible to re-allocate a message
> object (as we do now) once a deferred serialization operation has been
> coerced by Mojo internals.
> 
> In order to support this a few changes to serialization semantics are
> applied here:
> 
>   - Handle and interface accessors on StructTraits must return lvalue
>     references as they will be called twice: once during sizing and
>     once during serialization.
>   - SetUpContext and TearDownContext are always called even for nullable
>     custom types which report themselves as null
>   - IsNull supports being called with context so that e.g. traits can
>     move or otherwise store handle and interface types in the context
>     object at context creation, and these objects may in turn need to be
>     used for nullability testing.
> 
> BUG= 725321 
> R=​yzshen@chromium.org
> 
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
> Change-Id: I7056651222641220301e9adfce5028dc3501884f
> Reviewed-on: https://chromium-review.googlesource.com/546957
> Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
> Commit-Queue: Ken Rockot <rockot@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#482773}

TBR=rockot@chromium.org,yzshen@chromium.org

Change-Id: I56998d19c683533f9baf0dad2d3d141375b743d3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  725321 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://chromium-review.googlesource.com/552377
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482948}
[modify] https://crrev.com/18de1d92de6f624d8f6cb3bcf67694706490d490/mojo/public/cpp/bindings/lib/array_serialization.h
[modify] https://crrev.com/18de1d92de6f624d8f6cb3bcf67694706490d490/mojo/public/cpp/bindings/lib/handle_interface_serialization.h
[modify] https://crrev.com/18de1d92de6f624d8f6cb3bcf67694706490d490/mojo/public/cpp/bindings/lib/map_serialization.h
[modify] https://crrev.com/18de1d92de6f624d8f6cb3bcf67694706490d490/mojo/public/cpp/bindings/lib/message.cc
[modify] https://crrev.com/18de1d92de6f624d8f6cb3bcf67694706490d490/mojo/public/cpp/bindings/lib/serialization_context.cc
[modify] https://crrev.com/18de1d92de6f624d8f6cb3bcf67694706490d490/mojo/public/cpp/bindings/lib/serialization_context.h
[modify] https://crrev.com/18de1d92de6f624d8f6cb3bcf67694706490d490/mojo/public/cpp/bindings/lib/string_serialization.h
[modify] https://crrev.com/18de1d92de6f624d8f6cb3bcf67694706490d490/mojo/public/cpp/bindings/message.h
[modify] https://crrev.com/18de1d92de6f624d8f6cb3bcf67694706490d490/mojo/public/cpp/bindings/tests/connector_unittest.cc
[modify] https://crrev.com/18de1d92de6f624d8f6cb3bcf67694706490d490/mojo/public/cpp/bindings/tests/struct_unittest.cc
[modify] https://crrev.com/18de1d92de6f624d8f6cb3bcf67694706490d490/mojo/public/cpp/bindings/tests/union_unittest.cc
[modify] https://crrev.com/18de1d92de6f624d8f6cb3bcf67694706490d490/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
[modify] https://crrev.com/18de1d92de6f624d8f6cb3bcf67694706490d490/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
[modify] https://crrev.com/18de1d92de6f624d8f6cb3bcf67694706490d490/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_declaration.tmpl
[modify] https://crrev.com/18de1d92de6f624d8f6cb3bcf67694706490d490/mojo/public/tools/bindings/generators/cpp_templates/union_serialization_declaration.tmpl

Project Member

Comment 22 by bugdroid1@chromium.org, Jun 28 2017

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

commit 11be895df47331de2498478f18079696ae43529d
Author: Ken Rockot <rockot@chromium.org>
Date: Wed Jun 28 19:32:02 2017

Reland "Mojo C++ bindings: Serialize handles during message allocation"

This is a reland of ecf30db27d06ac0c6c61e24e811acfba32e34977

This reland changes the StructTraits for gfx::NativePixmapHandle to
behave properly. Previously the traits relied on the |fds| accessor
being called twice, returning an empty vector for sizing the first time,
and the real vector for serialization the second time. The correct thing
to do is return a reference to the vector both times, so that's what we
do now. This allows the traits to play nicely with the earlier handle
serialization behavior introduced here.

Original change's description:
> Mojo C++ bindings: Serialize handles during message allocation
> 
> This changes C++ bindings to collect handles during the message sizing
> phase of serialization so that a single Message object can be allocated
> prior to full serialization.
> 
> This reduces the cost of sending messages with attached handles. It also
> fulfills a necessary precondition for C++ bindings supporting lazy
> serialization, as it would not be possible to re-allocate a message
> object (as we do now) once a deferred serialization operation has been
> coerced by Mojo internals.
> 
> In order to support this a few changes to serialization semantics are
> applied here:
> 
>   - Handle and interface accessors on StructTraits must return lvalue
>     references as they will be called twice: once during sizing and
>     once during serialization.
>   - SetUpContext and TearDownContext are always called even for nullable
>     custom types which report themselves as null
>   - IsNull supports being called with context so that e.g. traits can
>     move or otherwise store handle and interface types in the context
>     object at context creation, and these objects may in turn need to be
>     used for nullability testing.
> 
> BUG= 725321 
> R=yzshen@chromium.org
> 
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
> Change-Id: I7056651222641220301e9adfce5028dc3501884f
> Reviewed-on: https://chromium-review.googlesource.com/546957
> Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
> Commit-Queue: Ken Rockot <rockot@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#482773}

Bug:  725321 
Change-Id: I8eb077324450ba6b42ac64acdd8f9d8f3c9fab38
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel

TBR=yzshen@chromium.org

Change-Id: I8eb077324450ba6b42ac64acdd8f9d8f3c9fab38
Reviewed-on: https://chromium-review.googlesource.com/552741
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#483098}
[modify] https://crrev.com/11be895df47331de2498478f18079696ae43529d/mojo/public/cpp/bindings/lib/array_serialization.h
[modify] https://crrev.com/11be895df47331de2498478f18079696ae43529d/mojo/public/cpp/bindings/lib/handle_interface_serialization.h
[modify] https://crrev.com/11be895df47331de2498478f18079696ae43529d/mojo/public/cpp/bindings/lib/map_serialization.h
[modify] https://crrev.com/11be895df47331de2498478f18079696ae43529d/mojo/public/cpp/bindings/lib/message.cc
[modify] https://crrev.com/11be895df47331de2498478f18079696ae43529d/mojo/public/cpp/bindings/lib/serialization_context.cc
[modify] https://crrev.com/11be895df47331de2498478f18079696ae43529d/mojo/public/cpp/bindings/lib/serialization_context.h
[modify] https://crrev.com/11be895df47331de2498478f18079696ae43529d/mojo/public/cpp/bindings/lib/string_serialization.h
[modify] https://crrev.com/11be895df47331de2498478f18079696ae43529d/mojo/public/cpp/bindings/message.h
[modify] https://crrev.com/11be895df47331de2498478f18079696ae43529d/mojo/public/cpp/bindings/tests/connector_unittest.cc
[modify] https://crrev.com/11be895df47331de2498478f18079696ae43529d/mojo/public/cpp/bindings/tests/struct_unittest.cc
[modify] https://crrev.com/11be895df47331de2498478f18079696ae43529d/mojo/public/cpp/bindings/tests/union_unittest.cc
[modify] https://crrev.com/11be895df47331de2498478f18079696ae43529d/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
[modify] https://crrev.com/11be895df47331de2498478f18079696ae43529d/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
[modify] https://crrev.com/11be895df47331de2498478f18079696ae43529d/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_declaration.tmpl
[modify] https://crrev.com/11be895df47331de2498478f18079696ae43529d/mojo/public/tools/bindings/generators/cpp_templates/union_serialization_declaration.tmpl
[modify] https://crrev.com/11be895df47331de2498478f18079696ae43529d/ui/gfx/mojo/buffer_types_struct_traits.cc
[modify] https://crrev.com/11be895df47331de2498478f18079696ae43529d/ui/gfx/mojo/buffer_types_struct_traits.h

Project Member

Comment 23 by bugdroid1@chromium.org, Jun 30 2017

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

commit 65a6f7ed1619c1499ff114642de7266857271125
Author: Ken Rockot <rockot@chromium.org>
Date: Fri Jun 30 21:59:03 2017

MojoReleaseMessageContext -> MojoGetMessageContext

Allows system API consumers to extract a message's context without
forcing the context to be released. Adds
MOJO_GET_MESSAGE_CONTEXT_FLAG_RELEASE as a flag to capture the behavior
of the replaced MojoReleaseMessageContext.

BUG= 725321 

Change-Id: I44c4bc5c6ddc6820765110b43c3e3efa78bd2ddc
Reviewed-on: https://chromium-review.googlesource.com/557992
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#483838}
[modify] https://crrev.com/65a6f7ed1619c1499ff114642de7266857271125/mojo/edk/embedder/entrypoints.cc
[modify] https://crrev.com/65a6f7ed1619c1499ff114642de7266857271125/mojo/edk/system/core.cc
[modify] https://crrev.com/65a6f7ed1619c1499ff114642de7266857271125/mojo/edk/system/core.h
[modify] https://crrev.com/65a6f7ed1619c1499ff114642de7266857271125/mojo/edk/system/core_unittest.cc
[modify] https://crrev.com/65a6f7ed1619c1499ff114642de7266857271125/mojo/edk/system/message_unittest.cc
[modify] https://crrev.com/65a6f7ed1619c1499ff114642de7266857271125/mojo/public/c/system/message_pipe.h
[modify] https://crrev.com/65a6f7ed1619c1499ff114642de7266857271125/mojo/public/c/system/tests/core_unittest.cc
[modify] https://crrev.com/65a6f7ed1619c1499ff114642de7266857271125/mojo/public/c/system/tests/core_unittest_pure_c.c
[modify] https://crrev.com/65a6f7ed1619c1499ff114642de7266857271125/mojo/public/c/system/thunks.cc
[modify] https://crrev.com/65a6f7ed1619c1499ff114642de7266857271125/mojo/public/c/system/thunks.h

Project Member

Comment 24 by bugdroid1@chromium.org, Jul 12 2017

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

commit 474df01407e5d38c85364ae4d1709b8d9af16f16
Author: Ken Rockot <rockot@chromium.org>
Date: Wed Jul 12 13:28:56 2017

Mojo C++ Bindings: Lazy Serialization

Implements lazy serialization in the C++ bindings. This means a few
things:

- Every bindings endpoint monitors the remoteness of its peer endpoint
- Bindings endpoints prefer serialized messages only when their peer
  appears to be remote
- Generated C++ bindings will use an unserialized message context to
  capture and carry message parameters when sending on an endpoint that
  does not prefer serialized messages
- Unserialized message contexts will serialize a bindings message if
  coerced to do so, either by an explicit call to
  Message::SerializeIfNecessary or by Mojo internals when the message
  needs to be routed out-of-process

Because support for lazy serialization incurs a significant code
size cost, individual mojom GN targets must opt into support by
setting |support_lazy_serialization| to true. This is turned on for
ipc_perftests test interfaces as well as
mojo_public_bindings_unittests test interfaces, and is used to
ensure sufficient test coverage for all message construction and
dispatching code paths.

BUG= 725321 
TBR=yhirano@chromium.orf

Change-Id: I85197b74a87bcf9fc9ff14b4c787c7eabc897829
Reviewed-on: https://chromium-review.googlesource.com/562180
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485935}
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/ipc/BUILD.gn
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/ipc/ipc_mojo_bootstrap.cc
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/ipc/ipc_mojo_perftest.cc
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/BUILD.gn
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/associated_group_controller.h
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/connector.h
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/interface_endpoint_client.h
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/lib/connector.cc
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/lib/message.cc
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/lib/message_header_validator.cc
[add] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/lib/message_internal.cc
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/lib/message_internal.h
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/lib/multiplex_router.cc
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/lib/multiplex_router.h
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/lib/serialization_context.h
[add] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/lib/unserialized_message_context.cc
[add] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/lib/unserialized_message_context.h
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/message.h
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/tests/BUILD.gn
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/tests/binding_set_unittest.cc
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/tests/binding_unittest.cc
[add] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/tests/bindings_test_base.cc
[add] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/tests/bindings_test_base.h
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc
[add] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/tests/lazy_serialization_unittest.cc
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/tests/pickle_unittest.cc
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/tests/report_bad_message_unittest.cc
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/tests/request_response_unittest.cc
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/tests/sample_service_unittest.cc
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/tests/struct_with_traits.typemap
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/tests/struct_with_traits_impl.h
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/tests/sync_method_unittest.cc
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/bindings/thread_safe_interface_ptr.h
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/system/BUILD.gn
[add] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/system/handle_signal_tracker.cc
[add] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/system/handle_signal_tracker.h
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/system/simple_watcher.cc
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/system/simple_watcher.h
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/system/tests/BUILD.gn
[add] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/cpp/system/tests/handle_signal_tracker_unittest.cc
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/interfaces/bindings/tests/BUILD.gn
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/interfaces/bindings/tests/struct_with_traits.mojom
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/tools/bindings/generators/cpp_templates/interface_macros.tmpl
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/tools/bindings/mojom.gni
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/tools/bindings/mojom_bindings_generator.py
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/tools/bindings/pylib/mojom/generate/generator.py
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/mojo/public/tools/bindings/pylib/mojom/generate/module.py
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/third_party/WebKit/Source/platform/loader/fetch/BufferingDataPipeWriter.cpp
[modify] https://crrev.com/474df01407e5d38c85364ae4d1709b8d9af16f16/third_party/WebKit/Source/platform/loader/fetch/BufferingDataPipeWriter.h

Status: Fixed (was: Assigned)
Calling this done!
Project Member

Comment 26 by bugdroid1@chromium.org, Jul 12 2017

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

commit 791be93fb88e23d166a292147c8b13db2e4d18f4
Author: Ken Rockot <rockot@chromium.org>
Date: Wed Jul 12 19:31:11 2017

Mojo C++ Bindings: Fix missing dispatch context

r485935 shuffled some code around and one of the MessageDispatchContext
instances (for dispatching a reply) was incorrectly left out of bindings
which don't support lazy serialization (i.e. most bindings). This fixes
that.

BUG= 725321 
R=yzshen@chromium.org

Change-Id: I9bd20083f4ca4eeba743797ef191eaa562508b94
Reviewed-on: https://chromium-review.googlesource.com/568529
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486059}
[modify] https://crrev.com/791be93fb88e23d166a292147c8b13db2e4d18f4/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl

Sign in to add a comment