Closed Bug 1864128 Opened 2 years ago Closed 2 years ago

Allow loading JSProcess Actors in the module loader dedicated to DevTools

Categories

(Core :: DOM: Content Processes, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

Attachments

(1 file)

Bug 1790383 introduced a new Module Loader instance which is dedicated to DevTools. See mozJSModuleLoader::GetDevToolsLoader().

This is only used by the Browser Content/Toolbox when debugging privileged scope.
This dedicated module loader allows us to have a distinct global for DevTools modules.
This is required when debugging the "shared JSM global" so that debuggee and debugger modules are loaded from distinct compartments.
The spidermonkey Debugger API has this strong requirement where debuggee and debugger should run in distinct compartment so that it can easily distinguish the two when instrumenting the debuggee.
https://searchfox.org/mozilla-central/rev/27ddf0064aa821af8238a99621df79fb1b301c7b/js/src/debugger/Debugger.cpp#4752-4757

Bug 1790383 started using this new module loader, but not for JSWindow/JSProcess Actors.
Because of that we are not able to debug them from the browser toolbox without re-entrancy issues where the browser toolbox would debug itself.

In bug 1648499, I'm trying to migrate DevTools from content process message managers to JS Process Actor and this becomes a stronger requirement to load the JS Process Actor in the DevTools module loader.

Passing loadInDevToolsLoader to JSProcess actor options will force loading
both parent and content modules in the distinct module loader used by DevTools.

This distinct module loader is maintained by mozJSModuleLoader and is used
by the DevTools Browser Console/Toolbox to debug privileged JS code
typically using the "shared JSM Global" from DevTools modules
loaded in a distinct and specific DevTools module loader.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9e350a723b7a Allow loading JSProcess Actors in the DevTools specific module loader. r=arai
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: