Move the tabbrowser's module getters off the instance onto the module's lazy object
Categories
(Firefox :: Tabbed Browser, task, P3)
Tracking
()
People
(Reporter: dao, Unassigned)
References
(Blocks 1 open bug)
Details
Tabbrowser.sys.mjs defines 15 module getters on the instance, via ChromeUtils.defineESModuleGetters(this, {...}) in init(). For process-wide singletons that is per-instance work in a shared module, and mozilla/lazy-getter-object-name rejects the pattern -- bug 2049770 keeps it behind an eslint-disable rather than widening that patch's scope. Moving them to the module-level lazy object lets the disable go.
Twelve have no consumers outside the module and can move as they are: ASRouter, AsyncTabSwitcher, PictureInPicture, SmartTabGroupingManager, SponsorProtection, TaskbarTabsUtils, TaskbarTabs, UrlbarUtils, UrlbarProviderOpenTabs, FaviconUtils, KeyboardLockUtils, TabCrashHandler.
Three are reached through gBrowser from outside and need their consumers updated first:
gBrowser.TabMetrics-- 95 referencesgBrowser.OpenInTabsUtils-- 1gBrowser.TabStateFlusher-- 1
About 50 internal this.X uses become lazy.X. Splitting the twelve from the three is the obvious way to stage it.
Updated•2 days ago
|
Description
•