Closed Bug 898315 Opened 11 years ago Closed 10 months ago

Deprecate and get rid of FileUtils.getDir(..., ..., true)

Categories

(Toolkit :: IOUtils and PathUtils, task)

task

Tracking

()

RESOLVED FIXED
116 Branch
Tracking Status
firefox116 --- fixed

People

(Reporter: Yoric, Assigned: marco)

References

Details

(Keywords: main-thread-io, perf, Whiteboard: [Async:ready])

Attachments

(6 files)

FileUtils.getDir(..., ..., true) causes main thread I/O that's hard to spot. We should deprecate the method and eliminate its use.
I've just noticed that FileUtils.getFile is using FileUtils.getDir(..., ..., true) and we have a bunch of consumers of this function!
Product: Firefox → Toolkit
Good catch. Filed as bug 920187.
We could do this as a mentored bug, see how awful the result is, and prioritize based on the results.
Whiteboard: [Async] → [Async:ready]
Depends on: 1651628
Depends on: 1652644

IOUtils and PathUtils offers async alternatives

No longer depends on: 1745361
Severity: normal → --
No longer depends on: 1652644
See Also: → 1652644
Component: General → OS.File
Type: defect → task
No longer depends on: 898314
Component: OS.File → IOUtils and PathUtils
Assignee: nobody → mcastelluccio
Status: NEW → ASSIGNED
Pushed by mcastelluccio@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/660b84a21af5
Remove two instances of FileUtils.getDir(..., ..., true) usage in async functions. r=barret,application-update-reviewers,nalexander
https://hg.mozilla.org/integration/autoland/rev/3ba31405d9d6
Print a deprecation warning for FileUtils.getDir(..., ..., true) even if not starting up or shutting down. r=barret
https://hg.mozilla.org/integration/autoland/rev/d108bd53c60b
Remove usage of FileUtils.getDir(..., ..., true) in production code. r=barret,application-update-reviewers,devtools-reviewers,nalexander,jdescottes
https://hg.mozilla.org/integration/autoland/rev/3999920d4893
Remove main thread IO from Browser Toolbox launcher. r=devtools-reviewers,ochameau
Keywords: leave-open
Pushed by mcastelluccio@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/63ccd00a399a
Update all callers of FileUtils.getDir to remove usage of the shouldCreate parameter. r=Gijs,extension-reviewers,application-update-reviewers,nalexander,robwu

Barret, the last patch depends on removing getFile. Do you think that will be done soon? If not, I can just modify my patch to move the directory creation in getFile for now.

Flags: needinfo?(brennie)

Bug 920187 should land tomorrow

Flags: needinfo?(brennie)

The test is only running on OS X, and I didn't test that in my try push. I'll fix it and reland.

Flags: needinfo?(mcastelluccio)
Pushed by mcastelluccio@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/314d09f09c5e
Update all callers of FileUtils.getDir to remove usage of the shouldCreate parameter. r=Gijs,extension-reviewers,application-update-reviewers,nalexander,robwu
Keywords: leave-open
Pushed by mcastelluccio@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/789349491e2f
Remove 'shouldCreate' parameter from FileUtils.getDir to avoid footguns. r=Gijs
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
Keywords: perf
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: