Files
Dimi a3a4a9698d Bug 2052772 - Part 1: Port module initialization in _schedulePerWindowIdleTasks to use category-manager invocation r=Gijs,frontend-codestyle-reviewers,mossop
Move the per-window idle inits in gBrowserInit._schedulePerWindowIdleTasks to a
new browser-window-idle-tasks category, continuing Bug 2036714, Bug 2039199 and
Bug 2045665. The category is invoked with idleDispatch: true.

callModulesFromCategory now drops a consumer when its jsGlobal is a window that
has closed by the time the idle task runs. Without this, a window that closes
before its idle inits run gets re-initialized after its unload teardown and
leaks (browser_windowclose.js / browser_tabdetach.js).

Teardown moves to the browser-window-unload categories, and the download init
moves into DownloadsCommon.initializeForWindow.

Differential Revision: https://phabricator.services.mozilla.com/D310625
2026-09-10 10:34:16 +00:00
..