Closed Bug 1738103 Opened 3 years ago Closed 2 years ago

Support running tasks on nsISerialEventTarget shutdown

Categories

(Core :: XPCOM, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- fixed

People

(Reporter: nika, Assigned: nika)

References

Details

Attachments

(5 files)

This can be used to simplify the logic around DelayedRunnable as we can shut down the delayed task nsITimer instances using a shutdown task, and can also be used for IPC to ensure that IPDL actors are torn down before the thread or event target they're hosted on is shut down.

This should help simplify background tasks using IPDL actors as well as hopefully avoid shutdown hang issues.

This makes the behaviour of TaskQueue more in-line with nsThread, which may be
useful when converting code to using taskqueue instead of threads.

Depends on D129837

The existing behaviour of the code is not fully compatible with nsIEventTarget.

Depends on D129838

Tasks registered with shutdown tasks are called when the target
nsISerialEventTarget is about to be destroyed.

Depends on D129839

Pushed by nlayzell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4b29a3fdfb02
Part 1: Remove the unused TailDispatchingTarget type, r=xpcom-reviewers,KrisWright
https://hg.mozilla.org/integration/autoland/rev/0bf347bacee2
Part 2: Accept messages for TaskQueue until queue is exhausted during shutdown, r=xpcom-reviewers,KrisWright
https://hg.mozilla.org/integration/autoland/rev/ba728a4ee829
Part 3: DelayedRunnable should only be used with nsISerialEventTarget, r=necko-reviewers,valentin
https://hg.mozilla.org/integration/autoland/rev/ad682061ae5c
Part 4: Add XPCOM support for shutdown tasks, r=necko-reviewers,KrisWright
https://hg.mozilla.org/integration/autoland/rev/3ae0fe8f2824
Part 5: Basic TargetShutdownTask tests, r=KrisWright
Regressions: 1762299
No longer regressions: 1762299
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: