gecko-dev/xpcom
Andreas Pehrson 9717c27492 Bug 1695580 - In xpcom, cancel pending DelayedRunnable timers on shutdown. r=KrisWright
Because DelayedRunnables are fire-and-forget, there is no way for a targeted
EventTarget to clean them up on shutdown. Thus if a timer fires after
EventTarget shutdown it will fail to dispatch the timer event, and avoid
releasing the timer callback because it's not on the targeted thread. This
causes a leak as there is a ref-cycle between nsTimerImpl::mCallback and
DelayedRunnable::mTimer.

This patch adds nsIDelayedRunnableObserver for a target to observe which
DelayedRunnables are relying on their timer to run them. This allows the target
to schedule a shutdown task to cancel those timers and release the runnables on
the target thread.

Supported DelayedRunnable targets with this patch are TaskQueues,
eventqueue-based nsThreads and XPCOMThreadWrappers that wrap a supported
nsThread.

An assertion makes sure at runtime that future new uses of DelayedRunnable
target nsIDelayedRunnableObserver-supported event targets.

Differential Revision: https://phabricator.services.mozilla.com/D109781
2021-04-06 20:15:11 +00:00
..
base Bug 1682030 - Remove NPAPI plugin process from GeckoChildProcess r=jld,gsvelto 2021-04-06 19:28:20 +00:00
build Bug 1695580 - In xpcom, cancel pending DelayedRunnable timers on shutdown. r=KrisWright 2021-04-06 20:15:11 +00:00
components Bug 1682030 - Remove NPAPI plugin process from GeckoChildProcess r=jld,gsvelto 2021-04-06 19:28:20 +00:00
docs Bug 1702245 - Expand XPCOM's in-tree documentation, r=xpcom-reviewers,kmag 2021-04-05 15:56:18 +00:00
ds Bug 1682030 - Remove NPAPI overlay from JS Plugin actors r=Gijs 2021-04-06 19:28:18 +00:00
glue Bug 1698388 - Fix static-analysis warnings in NetLinkService.cpp r=necko-reviewers,kershaw 2021-03-15 10:28:32 +00:00
idl-parser Bug 1647259 - Replace unsubscriptable value 'list' with 'attlist' r=nika 2021-02-01 15:57:44 +00:00
io Bug 1682030 - Remove Windows NPAPI plugin proccess sandbox r=bobowen 2021-04-06 19:28:19 +00:00
libxpt/xptcall
reflect Bug 1690152 - on ppc64 properly skip parameter slots if we overflow GPRs while still having FPRs to burn. r=tcampbell 2021-02-02 02:04:20 +00:00
rust Bug 1678330: Ensure nested SpinEventLoopUntil(OrShutdown) calls are traceable to the originating source in case of crash. r=nika,extension-reviewers 2021-03-02 22:11:58 +00:00
string Bug 1696261 - Optimize nsDataHandler and nsSimpleURI::SetSpec to do fewer passes r=necko-reviewers,kershaw 2021-04-06 08:37:40 +00:00
system Bug 1682030 - Remove NPAPI plugin process from GeckoChildProcess r=jld,gsvelto 2021-04-06 19:28:20 +00:00
tests Bug 1695580 - Add gtests. r=xpcom-reviewers,nika 2021-04-06 20:15:09 +00:00
threads Bug 1695580 - In xpcom, cancel pending DelayedRunnable timers on shutdown. r=KrisWright 2021-04-06 20:15:11 +00:00
windbgdlg Bug 1654103: Standardize on Black for Python code in `mozilla-central`. 2020-10-26 18:34:53 +00:00
xpidl Bug 1670357 - Remove `make` targets for cleaning: `clean`, `realclean`, `clobber`, `distclean`, `clobber_all`, `everything` r=firefox-build-system-reviewers,mhentges 2020-10-15 20:37:18 +00:00
moz.build Bug 1695954: Move Gecko Logging MDN Page In-tree r=nika 2021-03-09 16:27:29 +00:00
xpcom-config.h.in