Make IPC MozPromise exclusive

RESOLVED FIXED in Firefox 66

Status

()

enhancement
RESOLVED FIXED
9 months ago
8 months ago

People

(Reporter: jya, Assigned: jya)

Tracking

unspecified
mozilla66
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox66 fixed)

Details

Attachments

(1 attachment)

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: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.