[go: up one dir, main page]

Page MenuHomePhabricator

Bug 2054848 - Part 2: Stop WorkerPrivate.h and WorkerScope.h from including ModuleLoaderBase.h. r?#dom-worker-reviewers!
ClosedPublic

Authored by allstarschh on Jul 14 2026, 7:55 AM.
Referenced Files
Unknown Object (File)
Tue, Oct 13, 1:47 AM
Unknown Object (File)
Wed, Sep 30, 12:31 AM
Unknown Object (File)
Sep 5 2026, 8:33 AM
Unknown Object (File)
Aug 26 2026, 7:05 AM
Unknown Object (File)
Aug 23 2026, 1:48 PM
Unknown Object (File)
Aug 22 2026, 8:52 PM
Unknown Object (File)
Aug 17 2026, 12:38 AM
Unknown Object (File)
Aug 3 2026, 7:20 AM

Details

Summary

ModuleLoaderBase.h is heavyweight and was pulled in transitively by ~50 headers
through WorkerPrivate.h, so editing it triggered a near-full rebuild.

  • WorkerPrivate.h: drop the unused #include "ScriptLoader.h".
  • WorkerScope.h: forward-declare JS::loader::ModuleLoaderBase and out-line InitModuleLoader into WorkerScope.cpp.
  • Add direct includes to files that were relying on the removed transitive include (some only exposed by non-unified builds).

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

Before this patch : 163
After this patch  : 49

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.
edenchuang added a subscriber: edenchuang.

r+ed for the worker part. Thank you.

allstarschh edited the summary of this revision. (Show Details)
padenot added a subscriber: padenot.

r+ for dom/media

testing-exception-other: build only, no impact at run time.

mccr8 added inline comments.
dom/workers/WorkerScope.cpp
292

Would it be worth adding a comment that this is done out-of-line to prevent ModuleLoaderBase.h from being included everywhere? One of my gripes about this sort of include improvement work is that it is fragile.

allstarschh added inline comments.
dom/workers/WorkerScope.cpp
292

This is covered in D312254

dom/workers/WorkerScope.cpp
292

Excellent!

allstarschh marked an inline comment as done.
This revision is now accepted and ready to land.Jul 17 2026, 11:56 AM
This revision is now accepted and ready to land.Jul 19 2026, 2:12 AM