Changes to IPC ParamTraits Serialization

40 views
Skip to first unread message

Nika Layzell

unread,
Mar 8, 2022, 6:07:15 AM3/8/22
to dev-platform
Earlier today bug 1754037 was pushed to autoland. This patch makes some changes to how custom ParamTraits serializations are implemented in gecko.

Two new types, IPC::MessageWriter and IPC::MessageReader, have been added which replace the IPC::Message* parameter for Write methods, and both the const IPC::Message* and PickleIterator* parameters for Read methods. They should expose largely the same interface as IPC::Message for serialization.

In addition to the usual reading & writing methods, these types also optionally expose the actor the message is being serialized for using the `GetActor()` method. This new method should be preferred over using IPDLParamTraits and its' IProtocol* argument for new serializers.

Due to that change, the IPDLParamTraits trait has been deprecated. All serialization use-cases should now be supported using IPC::ParamTraits and IPC::{Read,Write}Param. The type will continue to exist until the remaining consumers are migrated to IPC::ParamTraits.

If you have any questions about the changes, please reach out in #ipc:mozilla.org on matrix.

-nika
Reply all
Reply to author
Forward
0 new messages