Bug 1289283 - Define the lazy service getters at the beginning of the appUpdater function to ensure that they are available to any code that may reference them. r?rstrong
MozReview-Commit-ID: 1YVOCdqkNjd
--- a/browser/base/content/aboutDialog-appUpdater.js
+++ b/browser/base/content/aboutDialog-appUpdater.js
@@ -21,38 +21,38 @@ function onUnload(aEvent) {
// Safe to call even when there isn't a download in progress.
gAppUpdater.removeDownloadListener();
gAppUpdater = null;
}
function appUpdater()
{
+ XPCOMUtils.defineLazyServiceGetter(this, "aus",
+ "@mozilla.org/updates/update-service;1",
+ "nsIApplicationUpdateService");
+ XPCOMUtils.defineLazyServiceGetter(this, "checker",
+ "@mozilla.org/updates/update-checker;1",
+ "nsIUpdateChecker");
+ XPCOMUtils.defineLazyServiceGetter(this, "um",
+ "@mozilla.org/updates/update-manager;1",
+ "nsIUpdateManager");
+
this.updateDeck = document.getElementById("updateDeck");
// Hide the update deck when the update window is already open and it's not
// already applied, to avoid syncing issues between them. Applied updates
// don't have any information to sync between the windows as they both just
// show the "Restart to continue"-type button.
if (Services.wm.getMostRecentWindow("Update:Wizard") &&
!this.isApplied) {
this.updateDeck.hidden = true;
return;
}
- XPCOMUtils.defineLazyServiceGetter(this, "aus",
- "@mozilla.org/updates/update-service;1",
- "nsIApplicationUpdateService");
- XPCOMUtils.defineLazyServiceGetter(this, "checker",
- "@mozilla.org/updates/update-checker;1",
- "nsIUpdateChecker");
- XPCOMUtils.defineLazyServiceGetter(this, "um",
- "@mozilla.org/updates/update-manager;1",
- "nsIUpdateManager");
-
this.bundle = Services.strings.
createBundle("chrome://browser/locale/browser.properties");
let manualURL = Services.urlFormatter.formatURLPref("app.update.url.manual");
let manualLink = document.getElementById("manualLink");
manualLink.value = manualURL;
manualLink.href = manualURL;
document.getElementById("failedLink").href = manualURL;