Closed Bug 1735166 Opened 2 months ago Closed 2 months ago

Replace OS.File/osfile.jsm with IOUtils/PathUtils in BrowserGlue.jsm

Categories

(Firefox :: General, task, P3)

task

Tracking

()

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: standard8, Assigned: claubatista, Mentored)

References

(Blocks 1 open bug)

Details

(Whiteboard: [lang=js][good-next-bug])

Attachments

(1 file)

Using OS.File for file access is now obsolete and can be replaced by code using IOUtils. Working towards this,BrowserGlue.jsm is loaded on startup and accesses OS.File. Fixing this should help a little towards startup performance.

The code in question can be found here.

There is background information here about how to migrate from OS.File to IOUtils.

For OS.Path, there is PathUtils available which is more or less a drop-in replacement. The API for PathUtils can be found here.

For OS.Constants.Path.profileDir this should be replaced by Services.dirsvc.get("ProfD", Ci.nsIFile).path but please combine instances in one function into an intermediate variable.

If you have questions, please ask.

To run the tests after you've built, you can run the following:

  • xpcshell-tests ./mach xpcshell-test browser/components/tests/.
  • mochitests: ./mach mochitest browser/components/tests/
  • You should also check ESLint before commiting: ./mach xpcshell-test browser/components/tests/.

I'm happy to mentor this. Note this bug will be auto-assigned when the first patch is attached.

The Bugbug bot thinks this bug should belong to the 'Toolkit::OS.File' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: General → OS.File
Product: Firefox → Toolkit
Component: OS.File → General
Product: Toolkit → Firefox

Hey, I'll start to work on this. :)

Assignee: nobody → contatodaclau
Status: NEW → ASSIGNED
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8856f824fa23
Replace OS.File/osfile.jsm with IOUtils/PathUtils in BrowserGlue.jsm r=Standard8
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch
You need to log in before you can comment on or make changes to this bug.