Make getURLSpecFromFile [noscript] and improve idl comments to indicate why you should use one or the other
Categories
(Core :: Networking: File, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox92 | --- | fixed |
People
(Reporter: Gijs, Assigned: Gijs)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged])
Attachments
(1 file)
From Florian's feedback:
While reviewing, I wondered "so what happens if the wrong function is called, or if the user messed with a preference in about:config and we are no longer pointing to a folder, ..." and I found the comments at https://searchfox.org/mozilla-central/rev/4f05a46731c1f7f111ec7a41ce38a34594aa0d37/netwerk/protocol/file/nsIFileProtocolHandler.idl#32-58 quite unhelpful.
I don't think this needs to be part of this patch, but I think it would be nice to rephrase the comments to explain that it's fine to call
getURLSpecFromActualFileon any file, and that the only difference withgetURLSpecFromDiris that it will ensure the url ends with a trailing/.Comments like "NOTE: Callers should use getURLSpecFromActualFile or getURLSpecFromDirFile if possible, for performance reasons." and "identical to getURLSpecFromFile, but is usually more efficient." don't make much sense to me. Is it just slightly more efficient? When reading such a comment I would never guess that we can block the main thread for 5s.
getURLSpecFromFileshould probably be made[noscript], but if we want to do it we should give our Thunderbird friends a heads up, as there are 8 uses (+6 in tests) inmail/.
Updated•4 years ago
|
| Assignee | ||
Comment 1•4 years ago
|
||
Comment 3•4 years ago
|
||
| bugherder | ||
Description
•