Bug 1649590 - Convert XPIProvider.jsm to use IOUtils r=emalysz,mixedpuppy

Differential Revision: https://phabricator.services.mozilla.com/D97354
This commit is contained in:
Michael Goossens 2020-11-19 17:37:18 +00:00
Родитель 4afdd0de9f
Коммит 85a266bedb
2 изменённых файлов: 6 добавлений и 10 удалений

Просмотреть файл

@ -267,12 +267,6 @@ const startupPhases = {
read: 22,
close: 11,
},
{
// bug 1541246
path: "ProfD:extensions",
condition: WIN,
stat: 1,
},
{
// bug 1541246
path: "UAppData:",

Просмотреть файл

@ -35,7 +35,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
Extension: "resource://gre/modules/Extension.jsm",
Langpack: "resource://gre/modules/Extension.jsm",
FileUtils: "resource://gre/modules/FileUtils.jsm",
OS: "resource://gre/modules/osfile.jsm",
JSONFile: "resource://gre/modules/JSONFile.jsm",
TelemetrySession: "resource://gre/modules/TelemetrySession.jsm",
@ -694,14 +693,14 @@ class XPIStateLocation extends Map {
// no profile extensions were present at startup, make sure it
// exists now.
if (name === KEY_APP_PROFILE) {
OS.File.makeDir(this.path, { ignoreExisting: true });
awaitPromise(IOUtils.makeDirectory(this.path));
}
if (saved) {
this.restore(saved);
}
this._installler = undefined;
this._installer = undefined;
}
hasPrecedence(otherLocation) {
@ -1626,7 +1625,10 @@ var XPIStates = {
save() {
if (!this._jsonFile) {
this._jsonFile = new JSONFile({
path: OS.Path.join(OS.Constants.Path.profileDir, FILE_XPI_STATES),
path: PathUtils.join(
Services.dirsvc.get("ProfD", Ci.nsIFile).path,
FILE_XPI_STATES
),
finalizeAt: AddonManagerPrivate.finalShutdown,
compression: "lz4",
});