Rework how WorkerLoadContext is held on the main thread
Categories
(Core :: DOM: Workers, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox108 | --- | fixed |
People
(Reporter: yulia, Assigned: yulia)
References
Details
Attachments
(2 files)
This is a cleanup following up from moving to ScriptLoadRequestList. We can't hold on to requests directly, but we can use WorkerLoadContexts as a handle, and do that in a cleaner way then we currently have it.
Assignee | ||
Comment 1•2 years ago
|
||
In order to use the WorkerLoadContext as a handle for ScriptLoadRequests in the main thread portion
of worker loading, we need to make it thread safe. Which means, it cannot be CC'd, and we need to
manually break cycles. This patch does the first portion of this work, which is inroduce two new
loadContextBase classes, that are either cc'd or not cc'd. For the DOM and mozJSComponent loader, we
continue to use a CC'd LoadContextBase. Workers however now have a non-cc'd variant.
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
As WorkerLoadContexts now inherit from a non-CC'd loadContextBase, we have two outcomes.
- we need to break cycles with ScriptLoadRequests manually, so that ScriptLoadRequests can be collected (ScriptLoadRequests must be CC'd).
- we can now have refptrs to WorkerLoadContexts in the CacheLoadHandler and NetworkLoadHandler classes, and remove any remaining raw pointers to ScriptLoadRequest/WorkerLoadContext. There are cases where the NetworkLoadHandler or CacheLoadHandler might outlive the Worker Loader, so having refpointers here should help us recover in those cases.
Depends on D160333
Comment 4•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7ade701781f5
https://hg.mozilla.org/mozilla-central/rev/5f483f0b842a
Description
•