[go: up one dir, main page]

Page MenuHomePhabricator

Bug 2054848 - Part 5: Stop mozJSModuleLoader.h from including ModuleLoaderBase.h. r?#spidermonkey-reviewers!
ClosedPublic

Authored by allstarschh on Jul 14 2026, 7:59 PM.
Referenced Files
F84386619: D312140.1792242249.diff
Fri, Oct 16, 1:04 PM
Unknown Object (File)
Mon, Sep 28, 4:42 PM
Unknown Object (File)
Aug 31 2026, 4:01 AM
Unknown Object (File)
Aug 23 2026, 1:59 PM
Unknown Object (File)
Aug 23 2026, 8:42 AM
Unknown Object (File)
Aug 23 2026, 2:46 AM
Unknown Object (File)
Aug 23 2026, 12:10 AM
Unknown Object (File)
Aug 22 2026, 11:20 PM
Subscribers

Details

Summary

Move NonSharedGlobalSyncModuleLoaderScope into its own header. It is the only
class in mozJSModuleLoader.h that genuinely needs the full ModuleLoaderBase.h
(it holds a Maybe<JS::loader::AutoOverrideModuleLoader> by value), and it is only
used by ChromeUtils.cpp and mozJSModuleLoader.cpp. With it gone, mozJSModuleLoader.h
can forward-declare mozilla::loader::SyncModuleLoader instead of including
SyncModuleLoader.h, so the component-registration translation units that only need
mozJSModuleLoader (nsAppRunner, XPCOMInit, StaticComponents, JSActorManager) no
longer pull in ModuleLoaderBase.h.

Include nsTHashMap.h directly in mozJSModuleLoader.h, which it uses for
mImportStacks but was previously getting transitively through the removed include.

Translation Units recompiled:
$ rg -l --no-ignore --hidden --glob '*.o.pp' 'ModuleLoaderBase\.h' obj-x86_64-pc-linux-gnu | wc -l

Before this patch: 20
After this patch : 15

Diff Detail

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.

Code analysis found 1 defect in diff 1324396:

  • 1 defect found by clang-format (Mozlint)
WARNING: Found 1 defect (warning level) that can be dismissed.

You can run this analysis locally with:

  • ./mach lint --warnings --outgoing

If you see a problem in this automated review, please report it here.

You can view these defects in the Diff Detail section of Phabricator diff 1324396.

change reviewer to arai sinec arai added the NonSharedGlobalSyncModuleLoaderScope before

This revision is now accepted and ready to land.Jul 18 2026, 11:09 PM
This revision is now accepted and ready to land.Jul 19 2026, 2:12 AM