Closed Bug 1525866 Opened 8 months ago Closed 8 months ago

Add IPDLParamTraits<Tuple<Ts...>>

Categories

(Core :: IPC, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla67
Fission Milestone M1
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.

Add support for serializing/deserializing tuples.

Assignee: nobody → afarre
Status: NEW → ASSIGNED
Priority: -- → P3
Blocks: 1523645
Summary: Add IPDLParamTraitgits<Tuple<Ts...>> → Add IPDLParamTraits<Tuple<Ts...>>
Pushed by afarre@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f830ab8c7d66
Add IPDLParamTraits<Tuple<Ts...>>. r=froydnj
Fission Milestone: --- → M1
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.