Modules are loaded many times and many loader are instantiated when debugging system principals
Categories
(DevTools :: Framework, defect)
Tracking
(firefox103 fixed)
Tracking | Status | |
---|---|---|
firefox103 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
The following code is instantiating one Loader per DevToolsFrameChild instance:
https://searchfox.org/mozilla-central/rev/9902932742fcdce2c956eeb81fd38350f5394ab2/devtools/server/connectors/js-window-actor/DevToolsFrameChild.jsm#319-323
this.useCustomLoader = this.document.nodePrincipal.isSystemPrincipal;
this.loader = this.useCustomLoader
? new Loader.DevToolsLoader({
invisibleToDebugger: true,
})
: Loader;
This only happens when debugging system principal documents.
This typically happens when opening the Browser Toolbox, where we will load actors once per WindowGlobal.
Assignee | ||
Comment 1•2 years ago
|
||
We were instantiating one new Loader per DevToolsFrameChild instance.
This patch tries to share this loader with all the instances as well as share it
with the one used to load DevToolsServer when we are running in the parent process.
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
This rule was matching any function prefixed with use
, even in modules
that weren't React components.
In addition to that, DevTools aren't using React hooks, so this rule is uncessary.
Assignee | ||
Comment 3•2 years ago
|
||
This helps simplify DevToolsFrameChild and avoid registering and not leaking a connectionchange listener.
This also help always nullify this.loader in DevToolsFrameChild.
For some reason, the first time didDestroy is called, there is still another connection registered in the server.
Assignee | ||
Updated•2 years ago
|
Comment 5•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7d217a3bec55
https://hg.mozilla.org/mozilla-central/rev/713a550b2bf1
https://hg.mozilla.org/mozilla-central/rev/6f3b3d8024c3
Description
•