Closed Bug 1738103 Opened 10 months ago Closed 5 months ago

Support running tasks on nsISerialEventTarget shutdown


(Core :: XPCOM, enhancement)




100 Branch
Tracking Status
firefox100 --- fixed


(Reporter: nika, Assigned: nika)




(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.

Blocks: 1738104

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
Part 1: Remove the unused TailDispatchingTarget type, r=xpcom-reviewers,KrisWright
Part 2: Accept messages for TaskQueue until queue is exhausted during shutdown, r=xpcom-reviewers,KrisWright
Part 3: DelayedRunnable should only be used with nsISerialEventTarget, r=necko-reviewers,valentin
Part 4: Add XPCOM support for shutdown tasks, r=necko-reviewers,KrisWright
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.