Closed Bug 1573589 Opened Last month Closed Last month

Be more explicit about propagating the "current runnable's global" through nested event loops

Categories

(Core :: DOM: Workers, task)

task
Not set

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

Right now when a worker spins a nested event loop (e.g. due to a syncloop), we rely on AutoNoJSAPI not changing the global of the JSContext to pick up the right global for the runnables that run off the nested event loop. This primarily affects worker debugger runnables that run against a sandbox global, because all other runnables handle things via WorkerRunnable::DefaultGlobalObject.

I'd like to make the propagation of "use this global for this runnable" more explicit. Threading it through the runnables themselves is a bit of a pain, so we can just stash it on the WorkerPrivate.

Some worker debugger runnables (the ones that want to evaluate script against a
debugger sandbox) depend on the JSContext being in a particular Realm before
they run, but don't really store which Realm that should be. Instead of
propagating that state via the current Realm of the JSContext across nested
event loops, we want to propagate it explicitly.

Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/04f03c56a77f
Be more explicit about propagating the "current runnable's global" through nested event loops in workers.  r=baku
Status: NEW → RESOLVED
Closed: Last month
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.