diff options
author | Ken Rockot <rockot@chromium.org> | 2017-09-14 13:23:41 +0900 |
---|---|---|
committer | Qijiang Fan <fqj@google.com> | 2020-06-05 07:14:24 +0900 |
commit | b3a77c976ab1d70bbca127b5fa808eea15b998d7 (patch) | |
tree | 1a390ed38ea71b09382fb1a0281c88ac1b01b64c /mojo/public/tools/bindings/pylib/mojom/generate/translate.py | |
parent | 14b3d6e9e1265327a8261bea4c53959ec8a7f411 (diff) | |
download | libchrome-b3a77c976ab1d70bbca127b5fa808eea15b998d7.tar.gz |
Mojo Bindings: Support handles in native structs
Changes [Native] struct serialization to use an IPC::Message instead of
a base::Pickle, allowing ParamTraits for [Native]-mapped types to be
parameterized over IPC::Message once again. In order to support this,
IPC::Message and related attachment support code has been moved into a
separate leaf target in //ipc, avoiding circular dependencies with Mojo
bindings.
Also changes the wire representation of native structs to allow for
typed Mojo handle attachments, and wires up native struct
serialization to automatically convert between IPC::MessageAttachments
and these typed mojom handles.
The net result here is that [Native] mojom structs can be mapped to
native types whose ParamTraits use message attachments.
BUG=762025
Change-Id: Ib058eff2f32e0e7abfff9619da9f142113ad28ed
Reviewed-on: https://chromium-review.googlesource.com/650219
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501866}
CrOS-Libchrome-Original-Commit: fd907634b5ea956b34bd1672c084089aad2150cd
Diffstat (limited to 'mojo/public/tools/bindings/pylib/mojom/generate/translate.py')
-rw-r--r-- | mojo/public/tools/bindings/pylib/mojom/generate/translate.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mojo/public/tools/bindings/pylib/mojom/generate/translate.py b/mojo/public/tools/bindings/pylib/mojom/generate/translate.py index f1d8f4264e..4153e7456c 100644 --- a/mojo/public/tools/bindings/pylib/mojom/generate/translate.py +++ b/mojo/public/tools/bindings/pylib/mojom/generate/translate.py @@ -273,6 +273,9 @@ def _Struct(module, parsed_struct): raise Exception("Native-only struct declarations must include a " + "Native attribute.") + if struct.attributes and struct.attributes.get('CustomSerializer', False): + struct.custom_serializer = True + return struct def _Union(module, parsed_union): |