Closed Bug 1784482 Opened 2 years ago Closed 2 years ago

Allow loading a Script without recreating the WorkerScriptLoader

Categories

(Core :: DOM: Workers, task)

task

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: yulia, Assigned: yulia)

References

Details

Attachments

(5 files)

Currently, the WorkerScriptLoader is recreated, along with a sync loop, every time a script is loaded. This doesn't really work for modules, which are not synchronous but async, and we need to wait on a promise being resolved, not for execution to be continued.

We don't need to block execution with a syncloop, and in a sense having a sync loop makes it more complicated. Instead we handle the initialization and running of all of the modules in one go -- kind of like a single concatenated script. To reflect that model, we need a way to start loading a script which does not create a new syncloop. We can reuse the root module's sync loop, and then trigger execution of the root module once all of the loading is complete.

Getting there requires that we have a well formed pipeline of initializing single script loading.

Blocks: 1783190
Attachment #9290922 - Attachment description: Bug 1784482 - do not rely on ScriptLoadRequestList in the main thread; r=asuth → Bug 1784482 - Do not rely on ScriptLoadRequestList in the main thread; r=asuth

This relates to 1784482, in that it allows modules to pass through the scriptloader independently.
This was a small bug that I caught in the wpt tests. I didn't have a better segment to put it under
so it is here.

This will be used by child modules. This is currently not used, but it will be in modules. I can
move this over to the other bug, if necessary.

Attachment #9291150 - Attachment description: WIP: Bug 1784482 - Move shutdown operation to be always after ProcessRequests → Bug 1784482 - Move shutdown operation to be always after ProcessRequests; r=asuth
Pushed by ystartsev@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f1f81f81af17
Move creation of ScriptLoadRequests into own functions; r=asuth
https://hg.mozilla.org/integration/autoland/rev/13e623b3779f
Do not rely on ScriptLoadRequestList in the main thread; r=asuth
https://hg.mozilla.org/integration/autoland/rev/25311707288f
Move shutdown operation to be always after ProcessRequests; r=asuth
https://hg.mozilla.org/integration/autoland/rev/a67c04d83558
Implement corrected base URI for module redirection; r=asuth
https://hg.mozilla.org/integration/autoland/rev/3bbb7bedfa0a
Implement method for single script loading; r=asuth
Flags: needinfo?(ystartsev)
Pushed by ystartsev@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/50df272a06b8
Move creation of ScriptLoadRequests into own functions; r=asuth
https://hg.mozilla.org/integration/autoland/rev/e65aaad7cc83
Do not rely on ScriptLoadRequestList in the main thread; r=asuth
https://hg.mozilla.org/integration/autoland/rev/766a229973f9
Move shutdown operation to be always after ProcessRequests; r=asuth
https://hg.mozilla.org/integration/autoland/rev/523bca0061ac
Implement corrected base URI for module redirection; r=asuth
https://hg.mozilla.org/integration/autoland/rev/5a65edaa747b
Implement method for single script loading; r=asuth
Flags: needinfo?(ystartsev)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: