Skip to content

Commit

Permalink
Bug 1745356 - Remove osfile.jsm from browser/components/attribution r…
Browse files Browse the repository at this point in the history
…=nalexander

Differential Revision: https://phabricator.services.mozilla.com/D133840
  • Loading branch information
Barret Rennie committed Dec 25, 2021
1 parent 2605c53 commit c7594bb
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
12 changes: 1 addition & 11 deletions browser/components/attribution/AttributionCode.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,7 @@ var AttributionCode = {
*/
async writeAttributionFile(code) {
let file = AttributionCode.attributionFile;
let dir = file.parent;
try {
// This is a simple way to create the entire directory tree.
// `OS.File.makeDir` has an awkward API for our situation.
dir.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755);
} catch (ex) {
if (ex.result != Cr.NS_ERROR_FILE_ALREADY_EXISTS) {
throw ex;
}
// Ignore the exception due to a directory that already exists.
}
await IOUtils.makeDirectory(file.parent.path);
let bytes = new TextEncoder().encode(code);
await AttributionIOUtils.write(file.path, bytes);
},
Expand Down
1 change: 0 additions & 1 deletion browser/components/attribution/test/browser/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
const { AttributionCode } = ChromeUtils.import(
"resource:///modules/AttributionCode.jsm"
);
ChromeUtils.defineModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");

// Keep in sync with `BROWSER_ATTRIBUTION_ERRORS` in Histograms.json.
const INDEX_READ_ERROR = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);
const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm");
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");

add_task(async () => {
Expand Down

0 comments on commit c7594bb

Please sign in to comment.