Add IPDLParamTraits<Tuple<Ts...>>
Categories
(Core :: IPC, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: farre, Assigned: farre)
References
Details
Attachments
(1 file)
With a IPDLParamTraitgits<Tuple<Ts...>> you can write serialization/deserialization code that uses tuples as intermediaries:
template <typename>
struct IPDLParamTraits<Foo> {
static void Write(IPC::Message* aMsg, IProtocol* aActor, const Foo& aFoo) {
WriteIPDLParam(aMsg, aActor, MakeTuple(aFoo->Tuple()));
}
static bool Read(const IPC::Message* aMessage, PickleIterator* aIterator,
IProtocol* aActor, Foo* aFoo) {
Foo* foo = new Foo;
auto result = foo->Tie();
return ReadIPDLParam(aMessage, aIterator, aActor, &result);
}
}
which is very useful if Foo is somehow generated, and Foo::Tuple and Foo::Tie returning a tuple and a tie of a tuple. That way Foo can change, but it's IPDLParamTraits can stay the same.
Assignee | ||
Comment 1•5 years ago
|
||
Add support for serializing/deserializing tuples.
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
Pushed by afarre@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f830ab8c7d66 Add IPDLParamTraits<Tuple<Ts...>>. r=froydnj
Updated•5 years ago
|
Comment 4•5 years ago
|
||
bugherder |
Description
•