Closed Bug 1512456 Opened Last year Closed 11 months ago

Make GenericPromise exclusive

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: jya, Assigned: jya)

Details

Attachments

(10 files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
GenericPromise was made to be non-exclusive.

This leads to issues when people just copy the code as template, when under most circumstances you need it to be exclusive.
Assignee: nobody → jyavenard
Summary: Make GenericPromise non-exclusive → Make GenericPromise exclusive
The VideoSink shares the AudioSink's own EndedPromise to notify its user that it has ended. As such, the MozPromise used must be non-exclusive.
Using the GenericPromise for such purpose only hid that requirement.

We also remove the MediaSink from the media namespace, and clarify the naming of some arguments and class members to accurately describe what they do.
We introduce GenericNonExclusivePromise	that can be used to explicitly state than non-exclusive use is needed

Depends on D14024
Depends on D14027
Make consistent use of MozPromise chaining where possible and remove unnecessary refcount.

Depends on D14028
The missing return would have caused an assertion if OpenWindow had failed as you can't reject a promise twice.

Depends on D14029
Those MozPromises are shared and must be made non-exclusive

Depends on D14031
Attachment #9030131 - Attachment description: Bug 1512456 - P7. Add missing return. r?baku → Bug 1512456 - P10. Add missing return. r?baku
Attachment #9030132 - Attachment description: Bug 1512456 - P8. Chain promises so they can be exclusive. r?gerald → Bug 1512456 - P7. Chain promises so they can be exclusive. r?gerald
Attachment #9030133 - Attachment description: Bug 1512456 - P9. Use GenericNonExclusivePromise where needed. r?gerald!,alwu! → Bug 1512456 - P8. Use GenericNonExclusivePromise where needed. r?gerald!,alwu!
Depends on D14032
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2109be597625
P1. Don't use GenericPromise with MediaSink. r=alwu
https://hg.mozilla.org/integration/autoland/rev/15c81f3a8bd8
P2. Make GenericPromise exclusive. r=gerald
https://hg.mozilla.org/integration/autoland/rev/710519e214f0
P3. Minor cleanup usage of GenericPromise. r=gerald
https://hg.mozilla.org/integration/autoland/rev/167783db9804
P4. Replace assert with MOZ_ASSERT. r=alwu
https://hg.mozilla.org/integration/autoland/rev/7dfc6f04799c
P5. Refactor WaitForBgParent. r=gerald
https://hg.mozilla.org/integration/autoland/rev/aac0ba07ae63
P6. Tidy up some MozPromise usage. r=gerald
https://hg.mozilla.org/integration/autoland/rev/ef791bbb33b9
P7. Chain promises so they can be exclusive. r=gerald
https://hg.mozilla.org/integration/autoland/rev/d5c767dcf1bb
P8. Use GenericNonExclusivePromise where needed. r=gerald,alwu
https://hg.mozilla.org/integration/autoland/rev/6a3dbb1faf04
P9. Re-enable assertion. r=gerald
https://hg.mozilla.org/integration/autoland/rev/87b1cf3284da
P10. Add missing return. r=baku
You need to log in before you can comment on or make changes to this bug.