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}
CrOS-Libchrome-Original-Commit: 18de1d92de6f624d8f6cb3bcf67694706490d490
15 files changed