Make the MessageChannel Send and Call methods take a UniquePtr argument
Categories
(Core :: IPC, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox79 | --- | fixed |
People
(Reporter: mccr8, Assigned: mccr8)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1642738, part 2 - Make the message arg to two more MessageChannel send methods into a UniquePtr.
47 bytes,
text/x-phabricator-request
|
Details | Review |
There are a few messages on MessageChannel that could take UniquePtr<Message> arguments.
Note that the ones with replies still take a Message* argument for that, because they work by getting a stack-allocated Message passed in, which is move-assigned into. Honestly it feels like passing in a UniquePtr& would be better, because we're heap allocating the reply message anyways, but changing that would require work at the code gen layer, and I expect the move constructor for Message isn't very expensive.
Assignee | ||
Comment 1•4 years ago
|
||
I have patches for this. I'm just waiting for a try run to make sure it builds on Windows and in Fuzzing, though I think it shouldn't be an issue.
Assignee | ||
Comment 2•4 years ago
|
||
This fixes the leak of a ShmemCreated in the case where ShareHandle fails.
Assignee | ||
Comment 3•4 years ago
|
||
The reply argument that gets passed in is a stack reference which is move
assigned into, so it doesn't make sense as a unique pointer, although the
code could be restructured to return a freshly allocated object instead.
This mostly just eliminates a spurious round trip from UniquePtr to *
and back. The bulk of the patch is renaming uses of |msg| to |aMsg|.
Comment 5•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d9e450307863
https://hg.mozilla.org/mozilla-central/rev/6b7a59f43f9b
Description
•