Bug 1543090 Clean up unused bits of XPIState r=zombie

XPIState.getModTime() was setting a .changed property that nothing ever
looks at.  It also sets lastModifiedTime which is used from about:addons
but built-in addons aren't visible there so there's no point setting it
for them.

Differential Revision: https://phabricator.services.mozilla.com/D39061

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew Swan 2019-07-26 02:45:52 +00:00
parent dedaa02a21
commit 188dd811fb
2 changed files with 8 additions and 46 deletions

View File

@ -470,18 +470,6 @@ const startupPhases = {
condition: MAC,
write: 3,
},
{
// bug 1543090
path: "GreD:omni.ja",
condition: WIN,
stat: 1,
},
{
// bug 1543090
path: "XCurProcD:omni.ja",
condition: WIN,
stat: 2,
},
],
// We are at this phase once we are ready to handle user events.
@ -688,12 +676,6 @@ const startupPhases = {
ignoreIfUnused: true,
stat: 3,
},
{
// bug 1543090
path: "XCurProcD:omni.ja",
condition: WIN,
stat: 7,
},
{
// bug 1003968
path: "XREAppDist:searchplugins",

View File

@ -453,7 +453,6 @@ function migrateAddonLoader(addon) {
* as stored in the addonStartup.json file.
*/
const JSON_FIELDS = Object.freeze([
"changed",
"dependencies",
"enabled",
"file",
@ -498,10 +497,8 @@ class XPIState {
saved.currentModifiedTime != this.lastModifiedTime
) {
this.lastModifiedTime = saved.currentModifiedTime;
this.changed = true;
} else if (saved.currentModifiedTime === null) {
this.missing = true;
this.changed = true;
}
}
@ -590,9 +587,9 @@ class XPIState {
logger.warn("Can't get modified time of ${path}", aFile, e);
}
this.changed = mtime != this.lastModifiedTime;
let changed = mtime != this.lastModifiedTime;
this.lastModifiedTime = mtime;
return this.changed;
return changed;
}
/**
@ -647,29 +644,12 @@ class XPIState {
this.file = aDBAddon._sourceBundle;
this.rootURI = aDBAddon.rootURI;
if (aUpdated || mustGetMod) {
let file = this.file;
// Built-in addons should have jar: rootURIs, use the mod time
// for the containing jar file for those.
if (!file) {
let fileUrl = this.resolvedRootURI;
if (fileUrl instanceof Ci.nsIJARURI) {
fileUrl = fileUrl.JARFile;
}
if (fileUrl instanceof Ci.nsIFileURL) {
file = fileUrl.file;
}
}
if (file) {
this.getModTime(file);
if (this.lastModifiedTime != aDBAddon.updateDate) {
aDBAddon.updateDate = this.lastModifiedTime;
if (XPIDatabase.initialized) {
XPIDatabase.saveChanges();
}
if ((aUpdated || mustGetMod) && this.file) {
this.getModTime(this.file);
if (this.lastModifiedTime != aDBAddon.updateDate) {
aDBAddon.updateDate = this.lastModifiedTime;
if (XPIDatabase.initialized) {
XPIDatabase.saveChanges();
}
}
}