Closed Bug 1696659 Opened 4 years ago Closed 3 years ago

[meta] replace OS.File with the built-in IOUtils in Thunderbird code

Categories

(Thunderbird :: General, enhancement)

enhancement

Tracking

(thunderbird_esr78 wontfix, thunderbird_esr91 wontfix)

RESOLVED FIXED
89 Branch
Tracking Status
thunderbird_esr78 --- wontfix
thunderbird_esr91 --- wontfix

People

(Reporter: mkmelin, Assigned: freaktechnik)

References

Details

(Keywords: leave-open, meta, perf)

Attachments

(1 file)

See Also: → 986145

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)

Depends on: 1663707, 1672431

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: nobody → martin

(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

Depends on: 1702471

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).

Status: NEW → ASSIGNED
Keywords: leave-open
Target Milestone: --- → 89 Branch
See Also: → 1704482
Depends on: 1704610
Depends on: 1704612
Depends on: 1704614

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/650df14d8b1f
Replace uses of OS.* with IOUtils and friends. r=mkmelin

Pushed by geoff@darktrojan.net: https://hg.mozilla.org/comm-central/rev/45f69c96654b follow-up - Fix mail/test/static tests. rs=bustage-fix DONTBUILD
Regressions: 1707178

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).

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
See Also: → 1757963
Regressions: 1708060
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: