Closed Bug 1768476 Opened 7 months ago Closed 7 months ago

Consistently pass around IPC::Message behind a UniquePtr

Categories

(Core :: IPC, task)

task

Tracking

()

RESOLVED FIXED
102 Branch
Tracking Status
firefox102 --- fixed

People

(Reporter: nika, Assigned: nika)

References

Details

Attachments

(3 files)

IPC::Message currently is passed differently in many places, either being directly moved or stored behind a UniquePtr (or raw pointer). This inconsistency requires things such as IPC::Message having a manually-implemented move constructor and assignment operator (https://searchfox.org/mozilla-central/rev/c7183440fe8ad391e2ab2e990229dd85fac318d3/ipc/chromium/src/chrome/common/ipc_message.cc#56-71,87-99), and generally makes some code trickier to follow.

This bug tracks a patch to remove these move constructors, and instead always pass IPC::Message around behind a UniquePtr to simplify things and make adding e.g. members to IPC::Message less error prone.

This makes passing around the type more consistent, and hopefully will make
changes to IPC::Message easier to work with in the future.

In addition, this should save us a few copies as we move the message type into
and out of UniquePtr, however I expect this won't make much of a difference.

All accesses except those through the xpcom interfaces were already
guarded, and given it can be mutated, this seemed easier than adding
thread assertions or similar.

Depends on D145885

Pushed by nlayzell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6732ef394d0e
Part 1: Consistently pass IPC::Message around by UniquePtr, r=ipc-reviewers,mccr8
https://hg.mozilla.org/integration/autoland/rev/c9cb03579c09
Part 2: Mark MessageTask::mMessage as guarded by the monitor, r=ipc-reviewers,mccr8
Pushed by nlayzell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5933da5f8e3d
Part 1: Consistently pass IPC::Message around by UniquePtr, r=ipc-reviewers,mccr8
https://hg.mozilla.org/integration/autoland/rev/5a1aef360088
Part 2: Mark MessageTask::mMessage as guarded by the monitor, r=ipc-reviewers,mccr8
Flags: needinfo?(nika)
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/41c3bedf3d95
Correct merge conflict resolution. CLOSED TREE
Pushed by nerli@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/20902b19a0ef
Part 3: Fix nyx-fuzz only bustage on a CLOSED TREE
Regressions: 1768775
You need to log in before you can comment on or make changes to this bug.