[meta] replace OS.File with the built-in IOUtils in Thunderbird code
Categories
(Thunderbird :: General, enhancement)
Tracking
(thunderbird_esr78 wontfix, thunderbird_esr91 wontfix)
People
(Reporter: mkmelin, Assigned: freaktechnik)
References
Details
(Keywords: leave-open, meta, perf)
Attachments
(1 file)
See http://lists.thunderbird.net/pipermail/maildev_lists.thunderbird.net/2020-August/002065.html - we should replace OS.File usage with the new IOUtils functionality.
Migration guide: https://docs.google.com/document/d/10_3dg0azLREP76esG5yWX4O8z4MJ0VUsplfPaTqhPxc/view#heading=h.378wb6q2kx87
(NOTE! it's not quite up to date)
Up2date documentation: https://searchfox.org/mozilla-central/source/dom/chrome-webidl/IOUtils.webidl
Assignee | ||
Comment 1•4 years ago
|
||
Adding bug 1663707 (append to a file using IOUtils) as dependency, since it is required in mailnews/compose/src/MessageSend.jsm, mailnews/base/src/converterWorker.js and chat/components/src/logger.jsm.
Bug 1672431 is only needed to convert chat/components/src/logger.jsm.
There also doesn't seem to be a replacement for OS.File.writeUnique yet, which generates a unique filename (used in mail/components/extensions/parent/ext-compose.js)
Reporter | ||
Comment 2•4 years ago
|
||
There's not a writeUnique. Did you mean openUnique? https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/OSFile.jsm/OS.File_for_the_main_thread#OS.File.openUnique - seems that name generation could easily be inlined
Assignee | ||
Comment 3•4 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #2)
There's not a writeUnique. Did you mean openUnique? https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/OSFile.jsm/OS.File_for_the_main_thread#OS.File.openUnique - seems that name generation could easily be inlined
Yes. I've since found that PathUtils actually has a simple helper to generate a unique path: https://searchfox.org/mozilla-central/rev/f07a609a76136ef779c65185165ff5ac513cc172/dom/chrome-webidl/PathUtils.webidl#59
Assignee | ||
Comment 4•4 years ago
|
||
Except for chat's logger.jsm (and test), ext-compose.js (no IOUtils in extension API implementations)
and converterWorker (uses OS.File.open to read and write big files).
Reporter | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/650df14d8b1f
Replace uses of OS.* with IOUtils and friends. r=mkmelin
Assignee | ||
Comment 7•3 years ago
|
||
With bug 1704612 landed there are no references to osfile.jsm in TB code anymore, except for an enterprise policy test that we seem to sync with m-c upstream (https://hg.mozilla.org/comm-central/rev/677f5bd4d2af44fa56de3eb68354243cebf53ab6).
Reporter | ||
Updated•3 years ago
|
Description
•