Stop using FileUtils.getFile

RESOLVED FIXED in Firefox 57

Status

RESOLVED FIXED
2 years ago
8 months ago

People

(Reporter: kmag, Assigned: kmag)

Tracking

(Blocks: 1 bug)

unspecified
mozilla57
Dependency tree / graph

Firefox Tracking Flags

(firefox57 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
This performs main thread IO to make sure that directories exist, which is not something we should be doing on the startup path.
(Assignee)

Updated

2 years ago
Blocks: 1363905
Comment hidden (mozreview-request)
Comment on attachment 8894697 [details]
Bug 1388208: Stop using FileUtils.getFile.

Kris "asked" me to steal the review.
Attachment #8894697 - Flags: review?(mixedpuppy) → review?(tomica)

Comment 3

2 years ago
mozreview-review
Comment on attachment 8894697 [details]
Bug 1388208: Stop using FileUtils.getFile.

https://reviewboard.mozilla.org/r/165858/#review171174

::: toolkit/components/extensions/ExtensionParent.jsm:1414
(Diff revision 1)
>    async _readData() {
>      let result = new Map();
>      try {
>        let data = await promiseFileContents(this.file);
>  
>        result = aomStartup.decodeBlob(data);

Now that we switched to `OS.File.read()` which supports compression directly, can we eliminate this dependency on `aomStartup`?
Attachment #8894697 - Flags: review?(tomica) → review+
(Assignee)

Comment 4

2 years ago
mozreview-review-reply
Comment on attachment 8894697 [details]
Bug 1388208: Stop using FileUtils.getFile.

https://reviewboard.mozilla.org/r/165858/#review171174

> Now that we switched to `OS.File.read()` which supports compression directly, can we eliminate this dependency on `aomStartup`?

This isn't compression. It's structured clone deserialization.

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/903db0ac80c6
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox57: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57

Comment 7

2 years ago
Would it make sense to add an eslint rule to ban further usage of FileUtils.getFile()?

Updated

2 years ago
Blocks: 1391576

Comment 8

2 years ago
(In reply to :Ehsan Akhgari (needinfo please, extremely long backlog, Away 8/18) from comment #7)
> Would it make sense to add an eslint rule to ban further usage of
> FileUtils.getFile()?

We should just migrate the callers and remove the function. Bug 920187 was already on file to do that, but in the meantime I filed bug 1391576 for the low-hanging fruit.

Updated

8 months ago
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.