# HG changeset patch # User Frank-Rainer Grahl # Date 1623162001 14400 # Parent 7312ffc2f36bf34f5cd9d191bf6338e83473215b Bug 1474946 - Switch module loading from LazyScriptGetter to LazyModuleLoader. diff --git a/suite/components/downloads/content/downloadmanager.js b/suite/components/downloads/content/downloadmanager.js --- a/suite/components/downloads/content/downloadmanager.js +++ b/suite/components/downloads/content/downloadmanager.js @@ -2,17 +2,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/PluralForm.jsm"); Cu.import("resource://gre/modules/Downloads.jsm"); -XPCOMUtils.defineLazyScriptGetter(this, "DownloadsCommon", +XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon", "resource:///modules/DownloadsCommon.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "FileUtils", "resource://gre/modules/FileUtils.jsm"); var gDownloadTree; var gDownloadTreeView; diff --git a/suite/components/downloads/content/progressDialog.js b/suite/components/downloads/content/progressDialog.js --- a/suite/components/downloads/content/progressDialog.js +++ b/suite/components/downloads/content/progressDialog.js @@ -1,17 +1,17 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/DownloadUtils.jsm"); -XPCOMUtils.defineLazyScriptGetter(this, "DownloadsCommon", +XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon", "resource:///modules/DownloadsCommon.jsm"); var gDownload; var gDownloadBundle; var gTkDlBundle; var gDlList; var gDlStatus; diff --git a/suite/components/downloads/content/treeView.js b/suite/components/downloads/content/treeView.js --- a/suite/components/downloads/content/treeView.js +++ b/suite/components/downloads/content/treeView.js @@ -1,20 +1,20 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/DownloadUtils.jsm"); -XPCOMUtils.defineLazyScriptGetter(this, "DownloadsCommon", +XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon", "resource:///modules/DownloadsCommon.jsm"); -XPCOMUtils.defineLazyScriptGetter(this, "DownloadHistory", +XPCOMUtils.defineLazyModuleGetter(this, "DownloadHistory", "resource://gre/modules/DownloadHistory.jsm"); function DownloadTreeView() { this._dlList = []; this._searchTerms = []; this.dateTimeFormatter = Services.intl.createDateTimeFormat(undefined, {dateStyle: "short", diff --git a/suite/components/nsSuiteGlue.js b/suite/components/nsSuiteGlue.js --- a/suite/components/nsSuiteGlue.js +++ b/suite/components/nsSuiteGlue.js @@ -38,17 +38,18 @@ XPCOMUtils.defineLazyModuleGetter(this, XPCOMUtils.defineLazyModuleGetter(this, "BookmarkHTMLUtils", "resource://gre/modules/BookmarkHTMLUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "BookmarkJSONUtils", "resource://gre/modules/BookmarkJSONUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow", "resource:///modules/RecentWindow.jsm"); -XPCOMUtils.defineLazyScriptGetter(this, "DownloadsCommon", + +XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon", "resource:///modules/DownloadsCommon.jsm"); XPCOMUtils.defineLazyGetter(this, "DebuggerServer", () => { var tmp = {}; Components.utils.import("resource://devtools/shared/Loader.jsm", tmp); return tmp.require("devtools/server/main").DebuggerServer; }); @@ -1223,17 +1224,17 @@ SuiteGlue.prototype = { gDownloadManager = Services.ww.openWindow(null, DOWNLOAD_MANAGER_URL, null, "all,dialog=no", { wrappedJSObject: aDownload }); gDownloadManager.addEventListener("load", function() { gDownloadManager.addEventListener("unload", function() { gDownloadManager = null; }); // Attach the taskbar progress meter to the download manager window. - Components.utils.import("resource:///modules/DownloadsTaskbar.jsm", {}) + Cu.import("resource:///modules/DownloadsTaskbar.jsm", {}) .DownloadsTaskbar.attachIndicator(gDownloadManager); }); } else if (!aDownload || Services.prefs.getBoolPref(PREF_FOCUS_WHEN_STARTING)) { gDownloadManager.focus(); } else { // This preference may not be set, so defaulting to two. var flashCount = 2;