Closed Bug 1512298 Opened 2 years ago Closed 2 years ago

Make IPC MozPromise exclusive

Categories

(Core :: IPC, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: jya, Assigned: jya)

References

Details

Attachments

(1 file)

IPDL async message generates non-exclusive MozPromise.

The prevents the use of move semantics, and often leads to poor coding practice as people keep replicating the code in multiple places.
Summary: Don't make IPC MozPromise non-exclusive → Make IPC MozPromise exclusive
Assignee: nobody → jyavenard
MozPromise most common use is to have an single or exclusive listener. By making the MozPromise generated by IPDL exclusive we can also use move semantics.

While at it, we also use move semantics for the ResponseRejectReason and via the callback's reject method so that the lambda used with the MozPromise::Then can be identical to the one used by the IPDL callback.
As it currently is, it provides no advantage over a copy as it's just an enum; however, this will facilitate future changes where it may not be.
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4e7923ac0159
Make IPDL MozPromise exclusive. r=gerald,froydnj
https://hg.mozilla.org/mozilla-central/rev/4e7923ac0159
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.