Worker script loader should use original URI for internal scheme
Categories
(Core :: DOM: Workers, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox124 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(1 file)
worker loader uses nsIChannel::GetURI
for request's base URL:
channel->GetURI(getter_AddRefs(loadContext->mRequest->mBaseURL));
main thread loader uses nsIChannel::GetOriginalURI
for internal scheme, to avoid using file:
.
nsCOMPtr<nsIURI> uri;
rv = channel->GetOriginalURI(getter_AddRefs(uri));
NS_ENSURE_SUCCESS(rv, rv);
// Fixup moz-extension: and resource: URIs, because the channel URI will
// point to file:, which won't be allowed to load.
if (uri && IsInternalURIScheme(uri)) {
aRequest->mBaseURL = uri;
} else {
channel->GetURI(getter_AddRefs(aRequest->mBaseURL));
}
This blocks bug 1803810, because the module URI doesn't match between sync and async loaders, due to resource:
vs file:
, and results in loading module twice.
worker loader should do the same as main thread loader
Assignee | ||
Comment 1•1 year ago
|
||
Updated•1 year ago
|
Comment 4•1 year ago
|
||
arai, should this get backported somewhere if it fixes bug 1876047? I don't know how common of an issue that is. Thanks.
Assignee | ||
Comment 5•1 year ago
|
||
I doubt this fixes bug 1876047's issue.
The change for the worker URI can lead to different behavior for internal resources if relative/absolute path is used against those URLs which goes beyond the mapping of each directory (so, the file pointed by resolved path results in different file than file:// URI, for example the case in dom/quota),
but this doesn't directly affect hang or GC.
Possibilities are:
- The fix for dom/quota/test/modules/system/worker/Utils.js changed something
- There's some other place that resulted in different behavior due to the relative/absolute path, possibly in in-tree code, or extensions, or something injected via AutoConfig etc (for example, if the hang is caused by some script and the script stops working with this change, that can explain the behavior)
anyway, I'm hesitant to ask for uplift without understanding the issue and reasoning behind the fix.
Forwarding to janv to see if the fix for dom/quota can be related to the issue.
Comment 6•1 year ago
|
||
(In reply to Tooru Fujisawa [:arai] from comment #5)
Possibilities are:
- The fix for dom/quota/test/modules/system/worker/Utils.js changed something
Utils.js is only used in our tests
Description
•