mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 1388215: Part 3 - Use JIT-friendly defineLazy*Getters methods when defining many lazy imports. r=florian
MozReview-Commit-ID: APoFwUhDFdj --HG-- extra : rebase_source : 15761873b91efaf1d338b6361bf7168ab4348e0d
This commit is contained in:
parent
c79c7e27c2
commit
0ecfcbc93e
@ -21,80 +21,56 @@ XPCOMUtils.defineLazyGetter(this, "extensionNameFromURI", () => {
|
||||
|
||||
// lazy module getters
|
||||
|
||||
/* global AboutHome:false,
|
||||
BrowserUITelemetry:false, BrowserUsageTelemetry:false, BrowserUtils:false,
|
||||
CastingApps:false, CharsetMenu:false, Color:false, ContentSearch:false,
|
||||
CustomizableUI: false, DownloadsCommon: false,
|
||||
Deprecated:false, E10SUtils:false, ExtensionsUI: false, FormValidationHandler:false,
|
||||
GMPInstallManager:false, LightweightThemeManager:false, Log:false,
|
||||
LoginManagerParent:false, NewTabUtils:false, PageThumbs:false,
|
||||
PluralForm:false, PrivateBrowsingUtils:false,
|
||||
ProcessHangMonitor:false, PromiseUtils:false, ReaderMode:false,
|
||||
ReaderParent:false, RecentWindow:false, SafeBrowsing: false,
|
||||
SessionStore:false,
|
||||
ShortcutUtils:false, SimpleServiceDiscovery:false, SitePermissions:false,
|
||||
Social:false, TabCrashHandler:false, TelemetryStopwatch:false,
|
||||
Translation:false, UITour:false, Utils:false, UpdateUtils:false,
|
||||
Weave:false,
|
||||
WebNavigationFrames: false, fxAccounts:false, gDevTools:false,
|
||||
gDevToolsBrowser:false, webrtcUI:false, ZoomUI:false,
|
||||
Marionette:false, PageActions:false,
|
||||
*/
|
||||
|
||||
/**
|
||||
* IF YOU ADD OR REMOVE FROM THIS LIST, PLEASE UPDATE THE LIST ABOVE AS WELL.
|
||||
* XXX Bug 1325373 is for making eslint detect these automatically.
|
||||
*/
|
||||
[
|
||||
["AboutHome", "resource:///modules/AboutHome.jsm"],
|
||||
["BrowserUITelemetry", "resource:///modules/BrowserUITelemetry.jsm"],
|
||||
["BrowserUsageTelemetry", "resource:///modules/BrowserUsageTelemetry.jsm"],
|
||||
["BrowserUtils", "resource://gre/modules/BrowserUtils.jsm"],
|
||||
["CastingApps", "resource:///modules/CastingApps.jsm"],
|
||||
["CharsetMenu", "resource://gre/modules/CharsetMenu.jsm"],
|
||||
["Color", "resource://gre/modules/Color.jsm"],
|
||||
["ContentSearch", "resource:///modules/ContentSearch.jsm"],
|
||||
["ContextualIdentityService", "resource://gre/modules/ContextualIdentityService.jsm"],
|
||||
["CustomizableUI", "resource:///modules/CustomizableUI.jsm"],
|
||||
["Deprecated", "resource://gre/modules/Deprecated.jsm"],
|
||||
["DownloadsCommon", "resource:///modules/DownloadsCommon.jsm"],
|
||||
["E10SUtils", "resource:///modules/E10SUtils.jsm"],
|
||||
["ExtensionsUI", "resource:///modules/ExtensionsUI.jsm"],
|
||||
["FormValidationHandler", "resource:///modules/FormValidationHandler.jsm"],
|
||||
["GMPInstallManager", "resource://gre/modules/GMPInstallManager.jsm"],
|
||||
["LightweightThemeManager", "resource://gre/modules/LightweightThemeManager.jsm"],
|
||||
["Log", "resource://gre/modules/Log.jsm"],
|
||||
["LoginManagerParent", "resource://gre/modules/LoginManagerParent.jsm"],
|
||||
["NewTabUtils", "resource://gre/modules/NewTabUtils.jsm"],
|
||||
["PageActions", "resource:///modules/PageActions.jsm"],
|
||||
["PageThumbs", "resource://gre/modules/PageThumbs.jsm"],
|
||||
["PluralForm", "resource://gre/modules/PluralForm.jsm"],
|
||||
["PrivateBrowsingUtils", "resource://gre/modules/PrivateBrowsingUtils.jsm"],
|
||||
["ProcessHangMonitor", "resource:///modules/ProcessHangMonitor.jsm"],
|
||||
["PromiseUtils", "resource://gre/modules/PromiseUtils.jsm"],
|
||||
["ReaderMode", "resource://gre/modules/ReaderMode.jsm"],
|
||||
["ReaderParent", "resource:///modules/ReaderParent.jsm"],
|
||||
["RecentWindow", "resource:///modules/RecentWindow.jsm"],
|
||||
["SafeBrowsing", "resource://gre/modules/SafeBrowsing.jsm"],
|
||||
["SessionStore", "resource:///modules/sessionstore/SessionStore.jsm"],
|
||||
["ShortcutUtils", "resource://gre/modules/ShortcutUtils.jsm"],
|
||||
["SimpleServiceDiscovery", "resource://gre/modules/SimpleServiceDiscovery.jsm"],
|
||||
["SitePermissions", "resource:///modules/SitePermissions.jsm"],
|
||||
["Social", "resource:///modules/Social.jsm"],
|
||||
["TabCrashHandler", "resource:///modules/ContentCrashHandlers.jsm"],
|
||||
["TelemetryStopwatch", "resource://gre/modules/TelemetryStopwatch.jsm"],
|
||||
["Translation", "resource:///modules/translation/Translation.jsm"],
|
||||
["UITour", "resource:///modules/UITour.jsm"],
|
||||
["UpdateUtils", "resource://gre/modules/UpdateUtils.jsm"],
|
||||
["Utils", "resource://gre/modules/sessionstore/Utils.jsm"],
|
||||
["Weave", "resource://services-sync/main.js"],
|
||||
["WebNavigationFrames", "resource://gre/modules/WebNavigationFrames.jsm"],
|
||||
["fxAccounts", "resource://gre/modules/FxAccounts.jsm"],
|
||||
["gDevTools", "resource://devtools/client/framework/gDevTools.jsm"],
|
||||
["gDevToolsBrowser", "resource://devtools/client/framework/gDevTools.jsm"],
|
||||
["webrtcUI", "resource:///modules/webrtcUI.jsm"],
|
||||
["ZoomUI", "resource:///modules/ZoomUI.jsm"],
|
||||
].forEach(([name, resource]) => XPCOMUtils.defineLazyModuleGetter(this, name, resource));
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AboutHome: "resource:///modules/AboutHome.jsm",
|
||||
BrowserUITelemetry: "resource:///modules/BrowserUITelemetry.jsm",
|
||||
BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.jsm",
|
||||
BrowserUtils: "resource://gre/modules/BrowserUtils.jsm",
|
||||
CastingApps: "resource:///modules/CastingApps.jsm",
|
||||
CharsetMenu: "resource://gre/modules/CharsetMenu.jsm",
|
||||
Color: "resource://gre/modules/Color.jsm",
|
||||
ContentSearch: "resource:///modules/ContentSearch.jsm",
|
||||
ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.jsm",
|
||||
CustomizableUI: "resource:///modules/CustomizableUI.jsm",
|
||||
Deprecated: "resource://gre/modules/Deprecated.jsm",
|
||||
DownloadsCommon: "resource:///modules/DownloadsCommon.jsm",
|
||||
E10SUtils: "resource:///modules/E10SUtils.jsm",
|
||||
ExtensionsUI: "resource:///modules/ExtensionsUI.jsm",
|
||||
FormValidationHandler: "resource:///modules/FormValidationHandler.jsm",
|
||||
GMPInstallManager: "resource://gre/modules/GMPInstallManager.jsm",
|
||||
LightweightThemeManager: "resource://gre/modules/LightweightThemeManager.jsm",
|
||||
Log: "resource://gre/modules/Log.jsm",
|
||||
LoginManagerParent: "resource://gre/modules/LoginManagerParent.jsm",
|
||||
NewTabUtils: "resource://gre/modules/NewTabUtils.jsm",
|
||||
PageActions: "resource:///modules/PageActions.jsm",
|
||||
PageThumbs: "resource://gre/modules/PageThumbs.jsm",
|
||||
PluralForm: "resource://gre/modules/PluralForm.jsm",
|
||||
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
|
||||
ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.jsm",
|
||||
PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
|
||||
ReaderMode: "resource://gre/modules/ReaderMode.jsm",
|
||||
ReaderParent: "resource:///modules/ReaderParent.jsm",
|
||||
RecentWindow: "resource:///modules/RecentWindow.jsm",
|
||||
SafeBrowsing: "resource://gre/modules/SafeBrowsing.jsm",
|
||||
SessionStore: "resource:///modules/sessionstore/SessionStore.jsm",
|
||||
ShortcutUtils: "resource://gre/modules/ShortcutUtils.jsm",
|
||||
SimpleServiceDiscovery: "resource://gre/modules/SimpleServiceDiscovery.jsm",
|
||||
SitePermissions: "resource:///modules/SitePermissions.jsm",
|
||||
Social: "resource:///modules/Social.jsm",
|
||||
TabCrashHandler: "resource:///modules/ContentCrashHandlers.jsm",
|
||||
TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
|
||||
Translation: "resource:///modules/translation/Translation.jsm",
|
||||
UITour: "resource:///modules/UITour.jsm",
|
||||
UpdateUtils: "resource://gre/modules/UpdateUtils.jsm",
|
||||
Utils: "resource://gre/modules/sessionstore/Utils.jsm",
|
||||
Weave: "resource://services-sync/main.js",
|
||||
WebNavigationFrames: "resource://gre/modules/WebNavigationFrames.jsm",
|
||||
fxAccounts: "resource://gre/modules/FxAccounts.jsm",
|
||||
gDevTools: "resource://devtools/client/framework/gDevTools.jsm",
|
||||
gDevToolsBrowser: "resource://devtools/client/framework/gDevTools.jsm",
|
||||
webrtcUI: "resource:///modules/webrtcUI.jsm",
|
||||
ZoomUI: "resource:///modules/ZoomUI.jsm",
|
||||
});
|
||||
|
||||
if (AppConstants.MOZ_CRASHREPORTER) {
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PluginCrashReporter",
|
||||
@ -152,20 +128,14 @@ XPCOMUtils.defineLazyScriptGetter(this, "gEditItemOverlay",
|
||||
|
||||
// lazy service getters
|
||||
|
||||
/* global Favicons:false, WindowsUIUtils:false, gAboutNewTabService:false,
|
||||
gDNSService:false
|
||||
*/
|
||||
/**
|
||||
* IF YOU ADD OR REMOVE FROM THIS LIST, PLEASE UPDATE THE LIST ABOVE AS WELL.
|
||||
* XXX Bug 1325373 is for making eslint detect these automatically.
|
||||
*/
|
||||
[
|
||||
["Favicons", "@mozilla.org/browser/favicon-service;1", "mozIAsyncFavicons"],
|
||||
["gAboutNewTabService", "@mozilla.org/browser/aboutnewtab-service;1", "nsIAboutNewTabService"],
|
||||
["gDNSService", "@mozilla.org/network/dns-service;1", "nsIDNSService"],
|
||||
["Marionette", "@mozilla.org/remote/marionette;1", "nsIMarionette"],
|
||||
["WindowsUIUtils", "@mozilla.org/windows-ui-utils;1", "nsIWindowsUIUtils"],
|
||||
].forEach(([name, cc, ci]) => XPCOMUtils.defineLazyServiceGetter(this, name, cc, ci));
|
||||
XPCOMUtils.defineLazyServiceGetters(this, {
|
||||
Favicons: ["@mozilla.org/browser/favicon-service;1", "mozIAsyncFavicons"],
|
||||
gAboutNewTabService: ["@mozilla.org/browser/aboutnewtab-service;1", "nsIAboutNewTabService"],
|
||||
gDNSService: ["@mozilla.org/network/dns-service;1", "nsIDNSService"],
|
||||
gSerializationHelper: ["@mozilla.org/network/serialization-helper;1", "nsISerializationHelper"],
|
||||
Marionette: ["@mozilla.org/remote/marionette;1", "nsIMarionette"],
|
||||
WindowsUIUtils: ["@mozilla.org/windows-ui-utils;1", "nsIWindowsUIUtils"],
|
||||
});
|
||||
|
||||
if (AppConstants.MOZ_CRASHREPORTER) {
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gCrashReporter",
|
||||
@ -173,10 +143,6 @@ if (AppConstants.MOZ_CRASHREPORTER) {
|
||||
"nsICrashReporter");
|
||||
}
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gSerializationHelper",
|
||||
"@mozilla.org/network/serialization-helper;1",
|
||||
"nsISerializationHelper");
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "BrowserToolboxProcess", function() {
|
||||
let tmp = {};
|
||||
Cu.import("resource://devtools/client/framework/ToolboxProcess.jsm", tmp);
|
||||
|
@ -13,47 +13,32 @@ var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "E10SUtils",
|
||||
"resource:///modules/E10SUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
|
||||
"resource://gre/modules/BrowserUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ContentLinkHandler",
|
||||
"resource:///modules/ContentLinkHandler.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ContentWebRTC",
|
||||
"resource:///modules/ContentWebRTC.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "SpellCheckHelper",
|
||||
"resource://gre/modules/InlineSpellChecker.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "InlineSpellCheckerContent",
|
||||
"resource://gre/modules/InlineSpellCheckerContent.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "LoginManagerContent",
|
||||
"resource://gre/modules/LoginManagerContent.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "LoginFormFactory",
|
||||
"resource://gre/modules/LoginManagerContent.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "InsecurePasswordUtils",
|
||||
"resource://gre/modules/InsecurePasswordUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PluginContent",
|
||||
"resource:///modules/PluginContent.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
|
||||
"resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FormSubmitObserver",
|
||||
"resource:///modules/FormSubmitObserver.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PageMetadata",
|
||||
"resource://gre/modules/PageMetadata.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUIUtils",
|
||||
"resource:///modules/PlacesUIUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Utils",
|
||||
"resource://gre/modules/sessionstore/Utils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
E10SUtils: "resource:///modules/E10SUtils.jsm",
|
||||
BrowserUtils: "resource://gre/modules/BrowserUtils.jsm",
|
||||
ContentLinkHandler: "resource:///modules/ContentLinkHandler.jsm",
|
||||
ContentWebRTC: "resource:///modules/ContentWebRTC.jsm",
|
||||
SpellCheckHelper: "resource://gre/modules/InlineSpellChecker.jsm",
|
||||
InlineSpellCheckerContent: "resource://gre/modules/InlineSpellCheckerContent.jsm",
|
||||
LoginManagerContent: "resource://gre/modules/LoginManagerContent.jsm",
|
||||
LoginFormFactory: "resource://gre/modules/LoginManagerContent.jsm",
|
||||
InsecurePasswordUtils: "resource://gre/modules/InsecurePasswordUtils.jsm",
|
||||
PluginContent: "resource:///modules/PluginContent.jsm",
|
||||
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
|
||||
FormSubmitObserver: "resource:///modules/FormSubmitObserver.jsm",
|
||||
PageMetadata: "resource://gre/modules/PageMetadata.jsm",
|
||||
PlacesUIUtils: "resource:///modules/PlacesUIUtils.jsm",
|
||||
Utils: "resource://gre/modules/sessionstore/Utils.jsm",
|
||||
WebNavigationFrames: "resource://gre/modules/WebNavigationFrames.jsm",
|
||||
Feeds: "resource:///modules/Feeds.jsm",
|
||||
findCssSelector: "resource://gre/modules/css-selector.js",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "PageMenuChild", function() {
|
||||
let tmp = {};
|
||||
Cu.import("resource://gre/modules/PageMenu.jsm", tmp);
|
||||
return new tmp.PageMenuChild();
|
||||
});
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "WebNavigationFrames",
|
||||
"resource://gre/modules/WebNavigationFrames.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Feeds",
|
||||
"resource:///modules/Feeds.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "findCssSelector",
|
||||
"resource://gre/modules/css-selector.js");
|
||||
|
||||
Cu.importGlobalProperties(["URL"]);
|
||||
|
||||
|
@ -9,19 +9,14 @@ Components.utils.import("resource://gre/modules/BrowserUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "SpellCheckHelper",
|
||||
"resource://gre/modules/InlineSpellChecker.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
|
||||
"resource://gre/modules/LoginHelper.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "LoginManagerContextMenu",
|
||||
"resource://gre/modules/LoginManagerContextMenu.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "WebNavigationFrames",
|
||||
"resource://gre/modules/WebNavigationFrames.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
|
||||
"resource://gre/modules/ContextualIdentityService.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DevToolsShim",
|
||||
"chrome://devtools-shim/content/DevToolsShim.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
SpellCheckHelper: "resource://gre/modules/InlineSpellChecker.jsm",
|
||||
LoginHelper: "resource://gre/modules/LoginHelper.jsm",
|
||||
LoginManagerContextMenu: "resource://gre/modules/LoginManagerContextMenu.jsm",
|
||||
WebNavigationFrames: "resource://gre/modules/WebNavigationFrames.jsm",
|
||||
ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.jsm",
|
||||
DevToolsShim: "chrome://devtools-shim/content/DevToolsShim.jsm",
|
||||
});
|
||||
|
||||
var gContextMenuContentData = null;
|
||||
|
||||
|
@ -7,22 +7,17 @@
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
|
||||
"resource://gre/modules/PlacesUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FormHistory",
|
||||
"resource://gre/modules/FormHistory.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
|
||||
"resource://gre/modules/Downloads.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon",
|
||||
"resource:///modules/DownloadsCommon.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
|
||||
"resource://gre/modules/TelemetryStopwatch.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "console",
|
||||
"resource://gre/modules/Console.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
|
||||
"resource://gre/modules/Timer.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AppConstants: "resource://gre/modules/AppConstants.jsm",
|
||||
PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
|
||||
FormHistory: "resource://gre/modules/FormHistory.jsm",
|
||||
Downloads: "resource://gre/modules/Downloads.jsm",
|
||||
DownloadsCommon: "resource:///modules/DownloadsCommon.jsm",
|
||||
TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
|
||||
console: "resource://gre/modules/Console.jsm",
|
||||
setTimeout: "resource://gre/modules/Timer.jsm",
|
||||
});
|
||||
|
||||
var {classes: Cc, interfaces: Ci} = Components;
|
||||
|
||||
|
@ -11,26 +11,24 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/AppConstants.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PanelWideWidgetTracker",
|
||||
"resource:///modules/PanelWideWidgetTracker.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "SearchWidgetTracker",
|
||||
"resource:///modules/SearchWidgetTracker.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "CustomizableWidgets",
|
||||
"resource:///modules/CustomizableWidgets.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask",
|
||||
"resource://gre/modules/DeferredTask.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
|
||||
"resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
PanelWideWidgetTracker: "resource:///modules/PanelWideWidgetTracker.jsm",
|
||||
SearchWidgetTracker: "resource:///modules/SearchWidgetTracker.jsm",
|
||||
CustomizableWidgets: "resource:///modules/CustomizableWidgets.jsm",
|
||||
DeferredTask: "resource://gre/modules/DeferredTask.jsm",
|
||||
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
|
||||
ShortcutUtils: "resource://gre/modules/ShortcutUtils.jsm",
|
||||
LightweightThemeManager: "resource://gre/modules/LightweightThemeManager.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "gWidgetsBundle", function() {
|
||||
const kUrl = "chrome://browser/locale/customizableui/customizableWidgets.properties";
|
||||
return Services.strings.createBundle(kUrl);
|
||||
});
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ShortcutUtils",
|
||||
"resource://gre/modules/ShortcutUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gELS",
|
||||
"@mozilla.org/eventlistenerservice;1", "nsIEventListenerService");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
|
||||
"resource://gre/modules/LightweightThemeManager.jsm");
|
||||
|
||||
const kNSXUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
|
||||
|
@ -11,24 +11,18 @@ Cu.import("resource:///modules/CustomizableUI.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/AppConstants.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "BrowserUITelemetry",
|
||||
"resource:///modules/BrowserUITelemetry.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
|
||||
"resource://gre/modules/PlacesUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUIUtils",
|
||||
"resource:///modules/PlacesUIUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "RecentlyClosedTabsAndWindowsMenuUtils",
|
||||
"resource:///modules/sessionstore/RecentlyClosedTabsAndWindowsMenuUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ShortcutUtils",
|
||||
"resource://gre/modules/ShortcutUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "CharsetMenu",
|
||||
"resource://gre/modules/CharsetMenu.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
|
||||
"resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "SyncedTabs",
|
||||
"resource://services-sync/SyncedTabs.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
|
||||
"resource://gre/modules/ContextualIdentityService.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
BrowserUITelemetry: "resource:///modules/BrowserUITelemetry.jsm",
|
||||
PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
|
||||
PlacesUIUtils: "resource:///modules/PlacesUIUtils.jsm",
|
||||
RecentlyClosedTabsAndWindowsMenuUtils: "resource:///modules/sessionstore/RecentlyClosedTabsAndWindowsMenuUtils.jsm",
|
||||
ShortcutUtils: "resource://gre/modules/ShortcutUtils.jsm",
|
||||
CharsetMenu: "resource://gre/modules/CharsetMenu.jsm",
|
||||
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
|
||||
SyncedTabs: "resource://services-sync/SyncedTabs.jsm",
|
||||
ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "CharsetBundle", function() {
|
||||
const kCharsetBundle = "chrome://global/locale/charsetMenu.properties";
|
||||
|
@ -37,32 +37,21 @@ const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
|
||||
"resource://gre/modules/PluralForm.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AppMenuNotifications",
|
||||
"resource://gre/modules/AppMenuNotifications.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
|
||||
"resource:///modules/CustomizableUI.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DownloadHistory",
|
||||
"resource://gre/modules/DownloadHistory.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
|
||||
"resource://gre/modules/Downloads.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DownloadUIHelper",
|
||||
"resource://gre/modules/DownloadUIHelper.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DownloadUtils",
|
||||
"resource://gre/modules/DownloadUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
|
||||
"resource://gre/modules/FileUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "OS",
|
||||
"resource://gre/modules/osfile.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
|
||||
"resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
|
||||
"resource:///modules/RecentWindow.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
PluralForm: "resource://gre/modules/PluralForm.jsm",
|
||||
AppConstants: "resource://gre/modules/AppConstants.jsm",
|
||||
AppMenuNotifications: "resource://gre/modules/AppMenuNotifications.jsm",
|
||||
CustomizableUI: "resource:///modules/CustomizableUI.jsm",
|
||||
DownloadHistory: "resource://gre/modules/DownloadHistory.jsm",
|
||||
Downloads: "resource://gre/modules/Downloads.jsm",
|
||||
DownloadUIHelper: "resource://gre/modules/DownloadUIHelper.jsm",
|
||||
DownloadUtils: "resource://gre/modules/DownloadUtils.jsm",
|
||||
FileUtils: "resource://gre/modules/FileUtils.jsm",
|
||||
OS: "resource://gre/modules/osfile.jsm",
|
||||
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
|
||||
RecentWindow: "resource:///modules/RecentWindow.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "DownloadsLogger", () => {
|
||||
let { ConsoleAPI } = Cu.import("resource://gre/modules/Console.jsm", {});
|
||||
|
@ -17,33 +17,59 @@ XPCOMUtils.defineLazyServiceGetter(this, "WindowsUIUtils", "@mozilla.org/windows
|
||||
XPCOMUtils.defineLazyGetter(this, "WeaveService", () =>
|
||||
Cc["@mozilla.org/weave/service;1"].getService().wrappedJSObject
|
||||
);
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
|
||||
"resource://gre/modules/ContextualIdentityService.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "SafeBrowsing",
|
||||
"resource://gre/modules/SafeBrowsing.jsm");
|
||||
|
||||
// lazy module getters
|
||||
|
||||
/* global AboutHome:false, AddonManager:false, AppMenuNotifications:false,
|
||||
AsyncPrefs: false, AsyncShutdown:false, AutoCompletePopup:false, BookmarkHTMLUtils:false,
|
||||
BookmarkJSONUtils:false, BrowserUITelemetry:false, BrowserUsageTelemetry:false,
|
||||
ContentClick:false, ContentPrefServiceParent:false, ContentSearch:false,
|
||||
DateTimePickerHelper:false, DirectoryLinksProvider:false,
|
||||
ExtensionsUI:false, Feeds:false,
|
||||
FileUtils:false, FormValidationHandler:false, Integration:false,
|
||||
LightweightThemeManager:false, LoginHelper:false, LoginManagerParent:false,
|
||||
NetUtil:false, NewTabUtils:false, OS:false,
|
||||
PageActions:false,
|
||||
PageThumbs:false, PdfJs:false, PermissionUI:false, PlacesBackups:false,
|
||||
PlacesUtils:false, PluralForm:false, PrivateBrowsingUtils:false,
|
||||
ProcessHangMonitor:false, ReaderParent:false, RecentWindow:false,
|
||||
RemotePrompt:false, SessionStore:false,
|
||||
ShellService:false, SimpleServiceDiscovery:false, TabCrashHandler:false,
|
||||
UITour:false, UIState:false, UpdateListener:false, WebChannel:false,
|
||||
WindowsRegistry:false, webrtcUI:false */
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.jsm",
|
||||
AppMenuNotifications: "resource://gre/modules/AppMenuNotifications.jsm",
|
||||
AsyncPrefs: "resource://gre/modules/AsyncPrefs.jsm",
|
||||
AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
|
||||
AutoCompletePopup: "resource://gre/modules/AutoCompletePopup.jsm",
|
||||
BookmarkHTMLUtils: "resource://gre/modules/BookmarkHTMLUtils.jsm",
|
||||
BookmarkJSONUtils: "resource://gre/modules/BookmarkJSONUtils.jsm",
|
||||
BrowserUITelemetry: "resource:///modules/BrowserUITelemetry.jsm",
|
||||
BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.jsm",
|
||||
ContentClick: "resource:///modules/ContentClick.jsm",
|
||||
ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.jsm",
|
||||
DateTimePickerHelper: "resource://gre/modules/DateTimePickerHelper.jsm",
|
||||
DirectoryLinksProvider: "resource:///modules/DirectoryLinksProvider.jsm",
|
||||
ExtensionsUI: "resource:///modules/ExtensionsUI.jsm",
|
||||
Feeds: "resource:///modules/Feeds.jsm",
|
||||
FileUtils: "resource://gre/modules/FileUtils.jsm",
|
||||
FormValidationHandler: "resource:///modules/FormValidationHandler.jsm",
|
||||
Integration: "resource://gre/modules/Integration.jsm",
|
||||
LightweightThemeManager: "resource://gre/modules/LightweightThemeManager.jsm",
|
||||
LoginHelper: "resource://gre/modules/LoginHelper.jsm",
|
||||
LoginManagerParent: "resource://gre/modules/LoginManagerParent.jsm",
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
NewTabUtils: "resource://gre/modules/NewTabUtils.jsm",
|
||||
OS: "resource://gre/modules/osfile.jsm",
|
||||
PageActions: "resource:///modules/PageActions.jsm",
|
||||
PageThumbs: "resource://gre/modules/PageThumbs.jsm",
|
||||
PdfJs: "resource://pdf.js/PdfJs.jsm",
|
||||
PermissionUI: "resource:///modules/PermissionUI.jsm",
|
||||
PlacesBackups: "resource://gre/modules/PlacesBackups.jsm",
|
||||
PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
|
||||
PluralForm: "resource://gre/modules/PluralForm.jsm",
|
||||
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
|
||||
ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.jsm",
|
||||
ReaderParent: "resource:///modules/ReaderParent.jsm",
|
||||
RecentWindow: "resource:///modules/RecentWindow.jsm",
|
||||
RemotePrompt: "resource:///modules/RemotePrompt.jsm",
|
||||
SafeBrowsing: "resource://gre/modules/SafeBrowsing.jsm",
|
||||
SessionStore: "resource:///modules/sessionstore/SessionStore.jsm",
|
||||
ShellService: "resource:///modules/ShellService.jsm",
|
||||
SimpleServiceDiscovery: "resource://gre/modules/SimpleServiceDiscovery.jsm",
|
||||
TabCrashHandler: "resource:///modules/ContentCrashHandlers.jsm",
|
||||
UIState: "resource://services-sync/UIState.jsm",
|
||||
UITour: "resource:///modules/UITour.jsm",
|
||||
WebChannel: "resource://gre/modules/WebChannel.jsm",
|
||||
WindowsRegistry: "resource://gre/modules/WindowsRegistry.jsm",
|
||||
});
|
||||
|
||||
/* global AboutHome:false, ContentPrefServiceParent:false, ContentSearch:false,
|
||||
UpdateListener:false, webrtcUI:false */
|
||||
|
||||
/**
|
||||
* IF YOU ADD OR REMOVE FROM THIS LIST, PLEASE UPDATE THE LIST ABOVE AS WELL.
|
||||
@ -54,72 +80,24 @@ let initializedModules = {};
|
||||
|
||||
[
|
||||
["AboutHome", "resource:///modules/AboutHome.jsm", "init"],
|
||||
["AddonManager", "resource://gre/modules/AddonManager.jsm"],
|
||||
["AppMenuNotifications", "resource://gre/modules/AppMenuNotifications.jsm"],
|
||||
["AsyncPrefs", "resource://gre/modules/AsyncPrefs.jsm"],
|
||||
["AsyncShutdown", "resource://gre/modules/AsyncShutdown.jsm"],
|
||||
["AutoCompletePopup", "resource://gre/modules/AutoCompletePopup.jsm"],
|
||||
["BookmarkHTMLUtils", "resource://gre/modules/BookmarkHTMLUtils.jsm"],
|
||||
["BookmarkJSONUtils", "resource://gre/modules/BookmarkJSONUtils.jsm"],
|
||||
["BrowserUITelemetry", "resource:///modules/BrowserUITelemetry.jsm"],
|
||||
["BrowserUsageTelemetry", "resource:///modules/BrowserUsageTelemetry.jsm"],
|
||||
["ContentClick", "resource:///modules/ContentClick.jsm"],
|
||||
["ContentPrefServiceParent", "resource://gre/modules/ContentPrefServiceParent.jsm", "alwaysInit"],
|
||||
["ContentSearch", "resource:///modules/ContentSearch.jsm", "init"],
|
||||
["DateTimePickerHelper", "resource://gre/modules/DateTimePickerHelper.jsm"],
|
||||
["DirectoryLinksProvider", "resource:///modules/DirectoryLinksProvider.jsm"],
|
||||
["ExtensionsUI", "resource:///modules/ExtensionsUI.jsm"],
|
||||
["Feeds", "resource:///modules/Feeds.jsm"],
|
||||
["FileUtils", "resource://gre/modules/FileUtils.jsm"],
|
||||
["FormValidationHandler", "resource:///modules/FormValidationHandler.jsm"],
|
||||
["Integration", "resource://gre/modules/Integration.jsm"],
|
||||
["LightweightThemeManager", "resource://gre/modules/LightweightThemeManager.jsm"],
|
||||
["LoginHelper", "resource://gre/modules/LoginHelper.jsm"],
|
||||
["LoginManagerParent", "resource://gre/modules/LoginManagerParent.jsm"],
|
||||
["NetUtil", "resource://gre/modules/NetUtil.jsm"],
|
||||
["NewTabUtils", "resource://gre/modules/NewTabUtils.jsm"],
|
||||
["OS", "resource://gre/modules/osfile.jsm"],
|
||||
["PageActions", "resource:///modules/PageActions.jsm"],
|
||||
["PageThumbs", "resource://gre/modules/PageThumbs.jsm"],
|
||||
["PdfJs", "resource://pdf.js/PdfJs.jsm"],
|
||||
["PermissionUI", "resource:///modules/PermissionUI.jsm"],
|
||||
["PlacesBackups", "resource://gre/modules/PlacesBackups.jsm"],
|
||||
["PlacesUtils", "resource://gre/modules/PlacesUtils.jsm"],
|
||||
["PluralForm", "resource://gre/modules/PluralForm.jsm"],
|
||||
["PrivateBrowsingUtils", "resource://gre/modules/PrivateBrowsingUtils.jsm"],
|
||||
["ProcessHangMonitor", "resource:///modules/ProcessHangMonitor.jsm"],
|
||||
["ReaderParent", "resource:///modules/ReaderParent.jsm"],
|
||||
["RecentWindow", "resource:///modules/RecentWindow.jsm"],
|
||||
["RemotePrompt", "resource:///modules/RemotePrompt.jsm"],
|
||||
["SessionStore", "resource:///modules/sessionstore/SessionStore.jsm"],
|
||||
["ShellService", "resource:///modules/ShellService.jsm"],
|
||||
["SimpleServiceDiscovery", "resource://gre/modules/SimpleServiceDiscovery.jsm"],
|
||||
["TabCrashHandler", "resource:///modules/ContentCrashHandlers.jsm"],
|
||||
["UIState", "resource://services-sync/UIState.jsm"],
|
||||
["UITour", "resource:///modules/UITour.jsm"],
|
||||
["UpdateListener", "resource://gre/modules/UpdateListener.jsm", "init"],
|
||||
["WebChannel", "resource://gre/modules/WebChannel.jsm"],
|
||||
["WindowsRegistry", "resource://gre/modules/WindowsRegistry.jsm"],
|
||||
["webrtcUI", "resource:///modules/webrtcUI.jsm", "init"],
|
||||
].forEach(([name, resource, init]) => {
|
||||
if (init) {
|
||||
XPCOMUtils.defineLazyGetter(this, name, () => {
|
||||
Cu.import(resource, initializedModules);
|
||||
initializedModules[name][init]();
|
||||
return initializedModules[name];
|
||||
});
|
||||
} else {
|
||||
XPCOMUtils.defineLazyModuleGetter(this, name, resource);
|
||||
}
|
||||
XPCOMUtils.defineLazyGetter(this, name, () => {
|
||||
Cu.import(resource, initializedModules);
|
||||
initializedModules[name][init]();
|
||||
return initializedModules[name];
|
||||
});
|
||||
});
|
||||
|
||||
if (AppConstants.MOZ_CRASHREPORTER) {
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PluginCrashReporter",
|
||||
"resource:///modules/ContentCrashHandlers.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "UnsubmittedCrashHandler",
|
||||
"resource:///modules/ContentCrashHandlers.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "CrashSubmit",
|
||||
"resource://gre/modules/CrashSubmit.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
PluginCrashReporter: "resource:///modules/ContentCrashHandlers.jsm",
|
||||
UnsubmittedCrashHandler: "resource:///modules/ContentCrashHandlers.jsm",
|
||||
CrashSubmit: "resource://gre/modules/CrashSubmit.jsm",
|
||||
});
|
||||
}
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "gBrandBundle", function() {
|
||||
|
@ -15,20 +15,15 @@ Cu.import("resource://gre/modules/Services.jsm", this);
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
|
||||
Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", this);
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "console",
|
||||
"resource://gre/modules/Console.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PrivacyFilter",
|
||||
"resource:///modules/sessionstore/PrivacyFilter.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "RunState",
|
||||
"resource:///modules/sessionstore/RunState.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "SessionStore",
|
||||
"resource:///modules/sessionstore/SessionStore.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "SessionFile",
|
||||
"resource:///modules/sessionstore/SessionFile.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
|
||||
"resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AppConstants: "resource://gre/modules/AppConstants.jsm",
|
||||
console: "resource://gre/modules/Console.jsm",
|
||||
PrivacyFilter: "resource:///modules/sessionstore/PrivacyFilter.jsm",
|
||||
RunState: "resource:///modules/sessionstore/RunState.jsm",
|
||||
SessionStore: "resource:///modules/sessionstore/SessionStore.jsm",
|
||||
SessionFile: "resource:///modules/sessionstore/SessionFile.jsm",
|
||||
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
|
||||
});
|
||||
|
||||
/*
|
||||
* Minimal interval between two save operations (in milliseconds).
|
||||
|
@ -161,51 +161,33 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
|
||||
Cu.import("resource://gre/modules/debug.js", this);
|
||||
Cu.import("resource://gre/modules/osfile.jsm", this);
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gSessionStartup",
|
||||
"@mozilla.org/browser/sessionstartup;1", "nsISessionStartup");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gScreenManager",
|
||||
"@mozilla.org/gfx/screenmanager;1", "nsIScreenManager");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "Telemetry",
|
||||
"@mozilla.org/base/telemetry;1", "nsITelemetry");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "console",
|
||||
"resource://gre/modules/Console.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
|
||||
"resource:///modules/RecentWindow.jsm");
|
||||
XPCOMUtils.defineLazyServiceGetters(this, {
|
||||
gSessionStartup: ["@mozilla.org/browser/sessionstartup;1", "nsISessionStartup"],
|
||||
gScreenManager: ["@mozilla.org/gfx/screenmanager;1", "nsIScreenManager"],
|
||||
Telemetry: ["@mozilla.org/base/telemetry;1", "nsITelemetry"],
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "GlobalState",
|
||||
"resource:///modules/sessionstore/GlobalState.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PrivacyFilter",
|
||||
"resource:///modules/sessionstore/PrivacyFilter.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "RunState",
|
||||
"resource:///modules/sessionstore/RunState.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DevToolsShim",
|
||||
"chrome://devtools-shim/content/DevToolsShim.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "SessionSaver",
|
||||
"resource:///modules/sessionstore/SessionSaver.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "SessionCookies",
|
||||
"resource:///modules/sessionstore/SessionCookies.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "SessionFile",
|
||||
"resource:///modules/sessionstore/SessionFile.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
|
||||
"resource://gre/modules/Timer.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TabAttributes",
|
||||
"resource:///modules/sessionstore/TabAttributes.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TabCrashHandler",
|
||||
"resource:///modules/ContentCrashHandlers.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TabState",
|
||||
"resource:///modules/sessionstore/TabState.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TabStateCache",
|
||||
"resource:///modules/sessionstore/TabStateCache.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TabStateFlusher",
|
||||
"resource:///modules/sessionstore/TabStateFlusher.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Utils",
|
||||
"resource://gre/modules/sessionstore/Utils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ViewSourceBrowser",
|
||||
"resource://gre/modules/ViewSourceBrowser.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
|
||||
"resource://gre/modules/AsyncShutdown.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AppConstants: "resource://gre/modules/AppConstants.jsm",
|
||||
AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
|
||||
DevToolsShim: "chrome://devtools-shim/content/DevToolsShim.jsm",
|
||||
GlobalState: "resource:///modules/sessionstore/GlobalState.jsm",
|
||||
PrivacyFilter: "resource:///modules/sessionstore/PrivacyFilter.jsm",
|
||||
RecentWindow: "resource:///modules/RecentWindow.jsm",
|
||||
RunState: "resource:///modules/sessionstore/RunState.jsm",
|
||||
SessionCookies: "resource:///modules/sessionstore/SessionCookies.jsm",
|
||||
SessionFile: "resource:///modules/sessionstore/SessionFile.jsm",
|
||||
SessionSaver: "resource:///modules/sessionstore/SessionSaver.jsm",
|
||||
TabAttributes: "resource:///modules/sessionstore/TabAttributes.jsm",
|
||||
TabCrashHandler: "resource:///modules/ContentCrashHandlers.jsm",
|
||||
TabState: "resource:///modules/sessionstore/TabState.jsm",
|
||||
TabStateCache: "resource:///modules/sessionstore/TabStateCache.jsm",
|
||||
TabStateFlusher: "resource:///modules/sessionstore/TabStateFlusher.jsm",
|
||||
Utils: "resource://gre/modules/sessionstore/Utils.jsm",
|
||||
ViewSourceBrowser: "resource://gre/modules/ViewSourceBrowser.jsm",
|
||||
console: "resource://gre/modules/Console.jsm",
|
||||
setTimeout: "resource://gre/modules/Timer.jsm",
|
||||
});
|
||||
|
||||
/**
|
||||
* |true| if we are in debug mode, |false| otherwise.
|
||||
|
@ -45,36 +45,23 @@ Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(this, "processCount", "dom.ipc.processCount.extension");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
|
||||
"resource://gre/modules/AddonManager.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AddonManagerPrivate",
|
||||
"resource://gre/modules/AddonManager.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
|
||||
"resource://gre/modules/AsyncShutdown.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ExtensionAPIs",
|
||||
"resource://gre/modules/ExtensionAPI.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ExtensionCommon",
|
||||
"resource://gre/modules/ExtensionCommon.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ExtensionPermissions",
|
||||
"resource://gre/modules/ExtensionPermissions.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ExtensionStorage",
|
||||
"resource://gre/modules/ExtensionStorage.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ExtensionTestCommon",
|
||||
"resource://testing-common/ExtensionTestCommon.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Log",
|
||||
"resource://gre/modules/Log.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "MessageChannel",
|
||||
"resource://gre/modules/MessageChannel.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "OS",
|
||||
"resource://gre/modules/osfile.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
|
||||
"resource://gre/modules/Schemas.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
|
||||
"resource://gre/modules/Timer.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
|
||||
"resource://gre/modules/TelemetryStopwatch.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AddonManager: "resource://gre/modules/AddonManager.jsm",
|
||||
AddonManagerPrivate: "resource://gre/modules/AddonManager.jsm",
|
||||
AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
|
||||
ExtensionAPIs: "resource://gre/modules/ExtensionAPI.jsm",
|
||||
ExtensionCommon: "resource://gre/modules/ExtensionCommon.jsm",
|
||||
ExtensionPermissions: "resource://gre/modules/ExtensionPermissions.jsm",
|
||||
ExtensionStorage: "resource://gre/modules/ExtensionStorage.jsm",
|
||||
ExtensionTestCommon: "resource://testing-common/ExtensionTestCommon.jsm",
|
||||
Log: "resource://gre/modules/Log.jsm",
|
||||
MessageChannel: "resource://gre/modules/MessageChannel.jsm",
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
OS: "resource://gre/modules/osfile.jsm",
|
||||
Schemas: "resource://gre/modules/Schemas.jsm",
|
||||
setTimeout: "resource://gre/modules/Timer.jsm",
|
||||
TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(
|
||||
this, "processScript",
|
||||
@ -84,12 +71,10 @@ XPCOMUtils.defineLazyGetter(
|
||||
Cu.import("resource://gre/modules/ExtensionParent.jsm");
|
||||
Cu.import("resource://gre/modules/ExtensionUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "aomStartup",
|
||||
"@mozilla.org/addons/addon-manager-startup;1",
|
||||
"amIAddonManagerStartup");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "uuidGen",
|
||||
"@mozilla.org/uuid-generator;1",
|
||||
"nsIUUIDGenerator");
|
||||
XPCOMUtils.defineLazyServiceGetters(this, {
|
||||
aomStartup: ["@mozilla.org/addons/addon-manager-startup;1", "amIAddonManagerStartup"],
|
||||
uuidGen: ["@mozilla.org/uuid-generator;1", "nsIUUIDGenerator"],
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(this, "useRemoteWebExtensions",
|
||||
"extensions.webextensions.remote", false);
|
||||
|
@ -24,14 +24,12 @@ const Cr = Components.results;
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ExtensionContent",
|
||||
"resource://gre/modules/ExtensionContent.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "MessageChannel",
|
||||
"resource://gre/modules/MessageChannel.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NativeApp",
|
||||
"resource://gre/modules/NativeMessaging.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils",
|
||||
"resource://gre/modules/PromiseUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
ExtensionContent: "resource://gre/modules/ExtensionContent.jsm",
|
||||
MessageChannel: "resource://gre/modules/MessageChannel.jsm",
|
||||
NativeApp: "resource://gre/modules/NativeMessaging.jsm",
|
||||
PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
|
||||
});
|
||||
|
||||
Cu.import("resource://gre/modules/ExtensionCommon.jsm");
|
||||
Cu.import("resource://gre/modules/ExtensionUtils.jsm");
|
||||
|
@ -20,14 +20,12 @@ Cu.importGlobalProperties(["fetch"]);
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "MessageChannel",
|
||||
"resource://gre/modules/MessageChannel.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Preferences",
|
||||
"resource://gre/modules/Preferences.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
|
||||
"resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
|
||||
"resource://gre/modules/Schemas.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
MessageChannel: "resource://gre/modules/MessageChannel.jsm",
|
||||
Preferences: "resource://gre/modules/Preferences.jsm",
|
||||
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
|
||||
Schemas: "resource://gre/modules/Schemas.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "styleSheetService",
|
||||
"@mozilla.org/content/style-sheet-service;1",
|
||||
@ -1162,12 +1160,11 @@ class SchemaAPIManager extends EventEmitter {
|
||||
|
||||
XPCOMUtils.defineLazyGetter(global, "console", getConsole);
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(global, "ExtensionUtils",
|
||||
"resource://gre/modules/ExtensionUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(global, "XPCOMUtils",
|
||||
"resource://gre/modules/XPCOMUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(global, "require",
|
||||
"resource://devtools/shared/Loader.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(global, {
|
||||
ExtensionUtils: "resource://gre/modules/ExtensionUtils.jsm",
|
||||
XPCOMUtils: "resource://gre/modules/XPCOMUtils.jsm",
|
||||
require: "resource://devtools/shared/Loader.jsm",
|
||||
});
|
||||
|
||||
return global;
|
||||
}
|
||||
|
@ -13,16 +13,13 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "LanguageDetector",
|
||||
"resource:///modules/translation/LanguageDetector.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "MessageChannel",
|
||||
"resource://gre/modules/MessageChannel.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
|
||||
"resource://gre/modules/Schemas.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
|
||||
"resource://gre/modules/TelemetryStopwatch.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "WebNavigationFrames",
|
||||
"resource://gre/modules/WebNavigationFrames.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
LanguageDetector: "resource:///modules/translation/LanguageDetector.jsm",
|
||||
MessageChannel: "resource://gre/modules/MessageChannel.jsm",
|
||||
Schemas: "resource://gre/modules/Schemas.jsm",
|
||||
TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
|
||||
WebNavigationFrames: "resource://gre/modules/WebNavigationFrames.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "styleSheetService",
|
||||
"@mozilla.org/content/style-sheet-service;1",
|
||||
|
@ -18,29 +18,21 @@ this.EXPORTED_SYMBOLS = ["ExtensionParent"];
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DeferredSave",
|
||||
"resource://gre/modules/DeferredSave.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "E10SUtils",
|
||||
"resource:///modules/E10SUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
|
||||
"resource://gre/modules/FileUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "MessageChannel",
|
||||
"resource://gre/modules/MessageChannel.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NativeApp",
|
||||
"resource://gre/modules/NativeMessaging.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
|
||||
"resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
|
||||
"resource://gre/modules/Schemas.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AppConstants: "resource://gre/modules/AppConstants.jsm",
|
||||
DeferredSave: "resource://gre/modules/DeferredSave.jsm",
|
||||
E10SUtils: "resource:///modules/E10SUtils.jsm",
|
||||
FileUtils: "resource://gre/modules/FileUtils.jsm",
|
||||
MessageChannel: "resource://gre/modules/MessageChannel.jsm",
|
||||
NativeApp: "resource://gre/modules/NativeMessaging.jsm",
|
||||
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
|
||||
Schemas: "resource://gre/modules/Schemas.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gAddonPolicyService",
|
||||
"@mozilla.org/addons/policy-service;1",
|
||||
"nsIAddonPolicyService");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "aomStartup",
|
||||
"@mozilla.org/addons/addon-manager-startup;1",
|
||||
"amIAddonManagerStartup");
|
||||
XPCOMUtils.defineLazyServiceGetters(this, {
|
||||
gAddonPolicyService: ["@mozilla.org/addons/policy-service;1", "nsIAddonPolicyService"],
|
||||
aomStartup: ["@mozilla.org/addons/addon-manager-startup;1", "amIAddonManagerStartup"],
|
||||
});
|
||||
|
||||
Cu.import("resource://gre/modules/ExtensionCommon.jsm");
|
||||
Cu.import("resource://gre/modules/ExtensionUtils.jsm");
|
||||
|
@ -4,14 +4,12 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ExtensionParent",
|
||||
"resource://gre/modules/ExtensionParent.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ExtensionUtils",
|
||||
"resource://gre/modules/ExtensionUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
|
||||
"resource://gre/modules/FileUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "JSONFile",
|
||||
"resource://gre/modules/JSONFile.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
ExtensionParent: "resource://gre/modules/ExtensionParent.jsm",
|
||||
ExtensionUtils: "resource://gre/modules/ExtensionUtils.jsm",
|
||||
FileUtils: "resource://gre/modules/FileUtils.jsm",
|
||||
JSONFile: "resource://gre/modules/JSONFile.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "StartupCache", () => ExtensionParent.StartupCache);
|
||||
|
||||
|
@ -46,31 +46,21 @@ Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/ExtensionUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
|
||||
BulkKeyBundle: "resource://services-sync/keys.js",
|
||||
CollectionKeyManager: "resource://services-sync/record.js",
|
||||
CommonUtils: "resource://services-common/utils.js",
|
||||
CryptoUtils: "resource://services-crypto/utils.js",
|
||||
fxAccounts: "resource://gre/modules/FxAccounts.jsm",
|
||||
KintoHttpClient: "resource://services-common/kinto-http-client.js",
|
||||
Kinto: "resource://services-common/kinto-offline-client.js",
|
||||
FirefoxAdapter: "resource://services-common/kinto-storage-adapter.js",
|
||||
Observers: "resource://services-common/observers.js",
|
||||
Sqlite: "resource://gre/modules/Sqlite.jsm",
|
||||
Utils: "resource://services-sync/util.js",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
|
||||
"resource://gre/modules/AsyncShutdown.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "BulkKeyBundle",
|
||||
"resource://services-sync/keys.js");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "CollectionKeyManager",
|
||||
"resource://services-sync/record.js");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "CommonUtils",
|
||||
"resource://services-common/utils.js");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "CryptoUtils",
|
||||
"resource://services-crypto/utils.js");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "fxAccounts",
|
||||
"resource://gre/modules/FxAccounts.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "KintoHttpClient",
|
||||
"resource://services-common/kinto-http-client.js");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Kinto",
|
||||
"resource://services-common/kinto-offline-client.js");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FirefoxAdapter",
|
||||
"resource://services-common/kinto-storage-adapter.js");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Observers",
|
||||
"resource://services-common/observers.js");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Sqlite",
|
||||
"resource://gre/modules/Sqlite.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Utils",
|
||||
"resource://services-sync/util.js");
|
||||
XPCOMUtils.defineLazyPreferenceGetter(this, "prefPermitsStorageSync",
|
||||
STORAGE_SYNC_ENABLED_PREF, true);
|
||||
XPCOMUtils.defineLazyPreferenceGetter(this, "prefStorageSyncServerURL",
|
||||
|
@ -13,26 +13,18 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
const {EventEmitter} = Cu.import("resource://gre/modules/EventEmitter.jsm", {});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
|
||||
"resource://gre/modules/AsyncShutdown.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ExtensionChild",
|
||||
"resource://gre/modules/ExtensionChild.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "OS",
|
||||
"resource://gre/modules/osfile.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
|
||||
"resource://gre/modules/Schemas.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Services",
|
||||
"resource://gre/modules/Services.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Subprocess",
|
||||
"resource://gre/modules/Subprocess.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "clearTimeout",
|
||||
"resource://gre/modules/Timer.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
|
||||
"resource://gre/modules/Timer.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry",
|
||||
"resource://gre/modules/WindowsRegistry.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AppConstants: "resource://gre/modules/AppConstants.jsm",
|
||||
AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
|
||||
ExtensionChild: "resource://gre/modules/ExtensionChild.jsm",
|
||||
OS: "resource://gre/modules/osfile.jsm",
|
||||
Schemas: "resource://gre/modules/Schemas.jsm",
|
||||
Services: "resource://gre/modules/Services.jsm",
|
||||
Subprocess: "resource://gre/modules/Subprocess.jsm",
|
||||
clearTimeout: "resource://gre/modules/Timer.jsm",
|
||||
setTimeout: "resource://gre/modules/Timer.jsm",
|
||||
WindowsRegistry: "resource://gre/modules/WindowsRegistry.jsm",
|
||||
});
|
||||
|
||||
const HOST_MANIFEST_SCHEMA = "chrome://extensions/content/schemas/native_host_manifest.json";
|
||||
const VALID_APPLICATION = /^\w+(\.\w+)*$/;
|
||||
|
@ -15,15 +15,12 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "MessageChannel",
|
||||
"resource://gre/modules/MessageChannel.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ExtensionChild",
|
||||
"resource://gre/modules/ExtensionChild.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ExtensionContent",
|
||||
"resource://gre/modules/ExtensionContent.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ExtensionPageChild",
|
||||
"resource://gre/modules/ExtensionPageChild.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
ExtensionChild: "resource://gre/modules/ExtensionChild.jsm",
|
||||
ExtensionContent: "resource://gre/modules/ExtensionContent.jsm",
|
||||
ExtensionPageChild: "resource://gre/modules/ExtensionPageChild.jsm",
|
||||
MessageChannel: "resource://gre/modules/MessageChannel.jsm",
|
||||
});
|
||||
|
||||
Cu.import("resource://gre/modules/ExtensionUtils.jsm");
|
||||
|
||||
|
@ -31,24 +31,18 @@ Cu.importGlobalProperties(["URL"]);
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/AppConstants.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Services",
|
||||
"resource://gre/modules/Services.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "OS",
|
||||
"resource://gre/modules/osfile.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Sqlite",
|
||||
"resource://gre/modules/Sqlite.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
|
||||
"resource://gre/modules/Deprecated.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Bookmarks",
|
||||
"resource://gre/modules/Bookmarks.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "History",
|
||||
"resource://gre/modules/History.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
|
||||
"resource://gre/modules/AsyncShutdown.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PlacesSyncUtils",
|
||||
"resource://gre/modules/PlacesSyncUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
Services: "resource://gre/modules/Services.jsm",
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
OS: "resource://gre/modules/osfile.jsm",
|
||||
Sqlite: "resource://gre/modules/Sqlite.jsm",
|
||||
Deprecated: "resource://gre/modules/Deprecated.jsm",
|
||||
Bookmarks: "resource://gre/modules/Bookmarks.jsm",
|
||||
History: "resource://gre/modules/History.jsm",
|
||||
AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
|
||||
PlacesSyncUtils: "resource://gre/modules/PlacesSyncUtils.jsm",
|
||||
});
|
||||
|
||||
// The minimum amount of transactions before starting a batch. Usually we do
|
||||
// do incremental updates, a batch will cause views to completely
|
||||
|
@ -299,24 +299,17 @@ Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
Cu.importGlobalProperties(["fetch"]);
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
|
||||
"resource://gre/modules/PlacesUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
|
||||
"resource://gre/modules/TelemetryStopwatch.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Sqlite",
|
||||
"resource://gre/modules/Sqlite.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "OS",
|
||||
"resource://gre/modules/osfile.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ExtensionSearchHandler",
|
||||
"resource://gre/modules/ExtensionSearchHandler.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PlacesSearchAutocompleteProvider",
|
||||
"resource://gre/modules/PlacesSearchAutocompleteProvider.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PlacesRemoteTabsAutocompleteProvider",
|
||||
"resource://gre/modules/PlacesRemoteTabsAutocompleteProvider.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
|
||||
"resource://gre/modules/BrowserUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ProfileAge",
|
||||
"resource://gre/modules/ProfileAge.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
|
||||
TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
|
||||
Sqlite: "resource://gre/modules/Sqlite.jsm",
|
||||
OS: "resource://gre/modules/osfile.jsm",
|
||||
ExtensionSearchHandler: "resource://gre/modules/ExtensionSearchHandler.jsm",
|
||||
PlacesSearchAutocompleteProvider: "resource://gre/modules/PlacesSearchAutocompleteProvider.jsm",
|
||||
PlacesRemoteTabsAutocompleteProvider: "resource://gre/modules/PlacesRemoteTabsAutocompleteProvider.jsm",
|
||||
BrowserUtils: "resource://gre/modules/BrowserUtils.jsm",
|
||||
ProfileAge: "resource://gre/modules/ProfileAge.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "textURIService",
|
||||
"@mozilla.org/intl/texttosuburi;1",
|
||||
|
@ -13,34 +13,23 @@ Cu.import("resource://gre/modules/PromiseUtils.jsm");
|
||||
Cu.import("resource://gre/modules/debug.js");
|
||||
Cu.import("resource://gre/modules/AppConstants.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
|
||||
"resource://gre/modules/AsyncShutdown.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask",
|
||||
"resource://gre/modules/DeferredTask.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "OS",
|
||||
"resource://gre/modules/osfile.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
|
||||
"resource://gre/modules/TelemetryStopwatch.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
|
||||
"resource://gre/modules/Deprecated.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "SearchStaticData",
|
||||
"resource://gre/modules/SearchStaticData.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
|
||||
"resource://gre/modules/Timer.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "clearTimeout",
|
||||
"resource://gre/modules/Timer.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Lz4",
|
||||
"resource://gre/modules/lz4.js");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
|
||||
DeferredTask: "resource://gre/modules/DeferredTask.jsm",
|
||||
OS: "resource://gre/modules/osfile.jsm",
|
||||
TelemetryStopwatch: "resource://gre/modules/TelemetryStopwatch.jsm",
|
||||
Deprecated: "resource://gre/modules/Deprecated.jsm",
|
||||
SearchStaticData: "resource://gre/modules/SearchStaticData.jsm",
|
||||
setTimeout: "resource://gre/modules/Timer.jsm",
|
||||
clearTimeout: "resource://gre/modules/Timer.jsm",
|
||||
Lz4: "resource://gre/modules/lz4.js",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gTextToSubURI",
|
||||
"@mozilla.org/intl/texttosuburi;1",
|
||||
"nsITextToSubURI");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gEnvironment",
|
||||
"@mozilla.org/process/environment;1",
|
||||
"nsIEnvironment");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gChromeReg",
|
||||
"@mozilla.org/chrome/chrome-registry;1",
|
||||
"nsIChromeRegistry");
|
||||
XPCOMUtils.defineLazyServiceGetters(this, {
|
||||
gTextToSubURI: ["@mozilla.org/intl/texttosuburi;1", "nsITextToSubURI"],
|
||||
gEnvironment: ["@mozilla.org/process/environment;1", "nsIEnvironment"],
|
||||
gChromeReg: ["@mozilla.org/chrome/chrome-registry;1", "nsIChromeRegistry"],
|
||||
});
|
||||
|
||||
Cu.importGlobalProperties(["XMLHttpRequest"]);
|
||||
|
||||
|
@ -50,35 +50,25 @@ const PING_TYPE_DELETION = "deletion";
|
||||
const REASON_GATHER_PAYLOAD = "gather-payload";
|
||||
const REASON_GATHER_SUBSESSION_PAYLOAD = "gather-subsession-payload";
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ClientID",
|
||||
"resource://gre/modules/ClientID.jsm");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "Telemetry",
|
||||
"@mozilla.org/base/telemetry;1",
|
||||
"nsITelemetry");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
|
||||
"resource://gre/modules/AsyncShutdown.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStorage",
|
||||
"resource://gre/modules/TelemetryStorage.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ThirdPartyCookieProbe",
|
||||
"resource://gre/modules/ThirdPartyCookieProbe.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryEnvironment",
|
||||
"resource://gre/modules/TelemetryEnvironment.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils",
|
||||
"resource://gre/modules/UpdateUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryArchive",
|
||||
"resource://gre/modules/TelemetryArchive.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetrySession",
|
||||
"resource://gre/modules/TelemetrySession.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetrySend",
|
||||
"resource://gre/modules/TelemetrySend.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryReportingPolicy",
|
||||
"resource://gre/modules/TelemetryReportingPolicy.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryModules",
|
||||
"resource://gre/modules/TelemetryModules.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "UpdatePing",
|
||||
"resource://gre/modules/UpdatePing.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryHealthPing",
|
||||
"resource://gre/modules/TelemetryHealthPing.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
ClientID: "resource://gre/modules/ClientID.jsm",
|
||||
AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
|
||||
TelemetryStorage: "resource://gre/modules/TelemetryStorage.jsm",
|
||||
ThirdPartyCookieProbe: "resource://gre/modules/ThirdPartyCookieProbe.jsm",
|
||||
TelemetryEnvironment: "resource://gre/modules/TelemetryEnvironment.jsm",
|
||||
UpdateUtils: "resource://gre/modules/UpdateUtils.jsm",
|
||||
TelemetryArchive: "resource://gre/modules/TelemetryArchive.jsm",
|
||||
TelemetrySession: "resource://gre/modules/TelemetrySession.jsm",
|
||||
TelemetrySend: "resource://gre/modules/TelemetrySend.jsm",
|
||||
TelemetryReportingPolicy: "resource://gre/modules/TelemetryReportingPolicy.jsm",
|
||||
TelemetryModules: "resource://gre/modules/TelemetryModules.jsm",
|
||||
UpdatePing: "resource://gre/modules/UpdatePing.jsm",
|
||||
TelemetryHealthPing: "resource://gre/modules/TelemetryHealthPing.jsm",
|
||||
});
|
||||
|
||||
/**
|
||||
* Setup Telemetry logging. This function also gets called when loggin related
|
||||
|
@ -18,8 +18,19 @@ Cu.import("resource://gre/modules/Timer.jsm");
|
||||
Cu.import("resource://gre/modules/TelemetryUtils.jsm", this);
|
||||
Cu.import("resource://gre/modules/AppConstants.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetrySend",
|
||||
"resource://gre/modules/TelemetrySend.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
TelemetrySend: "resource://gre/modules/TelemetrySend.jsm",
|
||||
AddonManagerPrivate: "resource://gre/modules/AddonManager.jsm",
|
||||
AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
|
||||
TelemetryController: "resource://gre/modules/TelemetryController.jsm",
|
||||
TelemetryStorage: "resource://gre/modules/TelemetryStorage.jsm",
|
||||
TelemetryLog: "resource://gre/modules/TelemetryLog.jsm",
|
||||
ThirdPartyCookieProbe: "resource://gre/modules/ThirdPartyCookieProbe.jsm",
|
||||
UITelemetry: "resource://gre/modules/UITelemetry.jsm",
|
||||
GCTelemetry: "resource://gre/modules/GCTelemetry.jsm",
|
||||
TelemetryEnvironment: "resource://gre/modules/TelemetryEnvironment.jsm",
|
||||
TelemetryReportingPolicy: "resource://gre/modules/TelemetryReportingPolicy.jsm",
|
||||
});
|
||||
|
||||
const Utils = TelemetryUtils;
|
||||
|
||||
@ -99,45 +110,14 @@ var gLastMemoryPoll = null;
|
||||
|
||||
var gWasDebuggerAttached = false;
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "Telemetry",
|
||||
"@mozilla.org/base/telemetry;1",
|
||||
"nsITelemetry");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "idleService",
|
||||
"@mozilla.org/widget/idleservice;1",
|
||||
"nsIIdleService");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
|
||||
"@mozilla.org/childprocessmessagemanager;1",
|
||||
"nsIMessageSender");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "cpml",
|
||||
"@mozilla.org/childprocessmessagemanager;1",
|
||||
"nsIMessageListenerManager");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
|
||||
"@mozilla.org/parentprocessmessagemanager;1",
|
||||
"nsIMessageBroadcaster");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "ppml",
|
||||
"@mozilla.org/parentprocessmessagemanager;1",
|
||||
"nsIMessageListenerManager");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AddonManagerPrivate",
|
||||
"resource://gre/modules/AddonManager.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
|
||||
"resource://gre/modules/AsyncShutdown.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryController",
|
||||
"resource://gre/modules/TelemetryController.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStorage",
|
||||
"resource://gre/modules/TelemetryStorage.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryLog",
|
||||
"resource://gre/modules/TelemetryLog.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ThirdPartyCookieProbe",
|
||||
"resource://gre/modules/ThirdPartyCookieProbe.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "UITelemetry",
|
||||
"resource://gre/modules/UITelemetry.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "GCTelemetry",
|
||||
"resource://gre/modules/GCTelemetry.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryEnvironment",
|
||||
"resource://gre/modules/TelemetryEnvironment.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryReportingPolicy",
|
||||
"resource://gre/modules/TelemetryReportingPolicy.jsm");
|
||||
XPCOMUtils.defineLazyServiceGetters(this, {
|
||||
Telemetry: ["@mozilla.org/base/telemetry;1", "nsITelemetry"],
|
||||
idleService: ["@mozilla.org/widget/idleservice;1", "nsIIdleService"],
|
||||
cpmm: ["@mozilla.org/childprocessmessagemanager;1", "nsIMessageSender"],
|
||||
cpml: ["@mozilla.org/childprocessmessagemanager;1", "nsIMessageListenerManager"],
|
||||
ppmm: ["@mozilla.org/parentprocessmessagemanager;1", "nsIMessageBroadcaster"],
|
||||
ppml: ["@mozilla.org/parentprocessmessagemanager;1", "nsIMessageListenerManager"],
|
||||
});
|
||||
|
||||
function generateUUID() {
|
||||
let str = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator).generateUUID().toString();
|
||||
|
@ -34,17 +34,16 @@ Cu.import("resource://gre/modules/osfile.jsm", this);
|
||||
|
||||
Cu.importGlobalProperties(["FileReader"]);
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Services",
|
||||
"resource://gre/modules/Services.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
|
||||
"resource://gre/modules/FileUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
|
||||
"resource://gre/modules/PlacesUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
Services: "resource://gre/modules/Services.jsm",
|
||||
FileUtils: "resource://gre/modules/FileUtils.jsm",
|
||||
PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
|
||||
Deprecated: "resource://gre/modules/Deprecated.jsm",
|
||||
AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
|
||||
PageThumbUtils: "resource://gre/modules/PageThumbUtils.jsm",
|
||||
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gUpdateTimerManager",
|
||||
"@mozilla.org/updates/timer-manager;1", "nsIUpdateTimerManager");
|
||||
@ -60,15 +59,6 @@ XPCOMUtils.defineLazyGetter(this, "gUnicodeConverter", function() {
|
||||
return converter;
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
|
||||
"resource://gre/modules/Deprecated.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
|
||||
"resource://gre/modules/AsyncShutdown.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PageThumbUtils",
|
||||
"resource://gre/modules/PageThumbUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
|
||||
"resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||
|
||||
/**
|
||||
* Utilities for dealing with promises and Task.jsm
|
||||
*/
|
||||
|
@ -4,26 +4,18 @@
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
|
||||
"resource://gre/modules/BrowserUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
|
||||
"resource://gre/modules/Downloads.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "DownloadLastDir",
|
||||
"resource://gre/modules/DownloadLastDir.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
|
||||
"resource://gre/modules/FileUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "OS",
|
||||
"resource://gre/modules/osfile.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
|
||||
"resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Services",
|
||||
"resource://gre/modules/Services.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
|
||||
"resource://gre/modules/Deprecated.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
BrowserUtils: "resource://gre/modules/BrowserUtils.jsm",
|
||||
Downloads: "resource://gre/modules/Downloads.jsm",
|
||||
DownloadLastDir: "resource://gre/modules/DownloadLastDir.jsm",
|
||||
FileUtils: "resource://gre/modules/FileUtils.jsm",
|
||||
OS: "resource://gre/modules/osfile.jsm",
|
||||
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
|
||||
Services: "resource://gre/modules/Services.jsm",
|
||||
Deprecated: "resource://gre/modules/Deprecated.jsm",
|
||||
AppConstants: "resource://gre/modules/AppConstants.jsm",
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
});
|
||||
|
||||
var ContentAreaUtils = {
|
||||
|
||||
|
@ -66,58 +66,57 @@ XPCOMUtils.defineLazyGetter(Services, "io", () => {
|
||||
.QueryInterface(Ci.nsISpeculativeConnect);
|
||||
});
|
||||
|
||||
var initTable = [
|
||||
["androidBridge", "@mozilla.org/android/bridge;1", "nsIAndroidBridge",
|
||||
AppConstants.platform == "android"],
|
||||
["appShell", "@mozilla.org/appshell/appShellService;1", "nsIAppShellService"],
|
||||
["cache", "@mozilla.org/network/cache-service;1", "nsICacheService"],
|
||||
["cache2", "@mozilla.org/netwerk/cache-storage-service;1", "nsICacheStorageService"],
|
||||
["cpmm", "@mozilla.org/childprocessmessagemanager;1", "nsIMessageSender"],
|
||||
["console", "@mozilla.org/consoleservice;1", "nsIConsoleService"],
|
||||
["contentPrefs", "@mozilla.org/content-pref/service;1", "nsIContentPrefService"],
|
||||
["cookies", "@mozilla.org/cookiemanager;1", "nsICookieManager2"],
|
||||
["downloads", "@mozilla.org/download-manager;1", "nsIDownloadManager"],
|
||||
["droppedLinkHandler", "@mozilla.org/content/dropped-link-handler;1", "nsIDroppedLinkHandler"],
|
||||
["els", "@mozilla.org/eventlistenerservice;1", "nsIEventListenerService"],
|
||||
["eTLD", "@mozilla.org/network/effective-tld-service;1", "nsIEffectiveTLDService"],
|
||||
["intl", "@mozilla.org/mozintl;1", "mozIMozIntl"],
|
||||
["locale", "@mozilla.org/intl/localeservice;1", "mozILocaleService"],
|
||||
["logins", "@mozilla.org/login-manager;1", "nsILoginManager"],
|
||||
["obs", "@mozilla.org/observer-service;1", "nsIObserverService"],
|
||||
["perms", "@mozilla.org/permissionmanager;1", "nsIPermissionManager"],
|
||||
["prompt", "@mozilla.org/embedcomp/prompt-service;1", "nsIPromptService"],
|
||||
["profiler", "@mozilla.org/tools/profiler;1", "nsIProfiler",
|
||||
AppConstants.MOZ_GECKO_PROFILER],
|
||||
["scriptloader", "@mozilla.org/moz/jssubscript-loader;1", "mozIJSSubScriptLoader"],
|
||||
["scriptSecurityManager", "@mozilla.org/scriptsecuritymanager;1", "nsIScriptSecurityManager"],
|
||||
["search", "@mozilla.org/browser/search-service;1", "nsIBrowserSearchService",
|
||||
AppConstants.MOZ_TOOLKIT_SEARCH],
|
||||
["storage", "@mozilla.org/storage/service;1", "mozIStorageService"],
|
||||
["domStorageManager", "@mozilla.org/dom/localStorage-manager;1", "nsIDOMStorageManager"],
|
||||
["strings", "@mozilla.org/intl/stringbundle;1", "nsIStringBundleService"],
|
||||
["telemetry", "@mozilla.org/base/telemetry;1", "nsITelemetry"],
|
||||
["tm", "@mozilla.org/thread-manager;1", "nsIThreadManager"],
|
||||
["urlFormatter", "@mozilla.org/toolkit/URLFormatterService;1", "nsIURLFormatter"],
|
||||
["vc", "@mozilla.org/xpcom/version-comparator;1", "nsIVersionComparator"],
|
||||
["wm", "@mozilla.org/appshell/window-mediator;1", "nsIWindowMediator"],
|
||||
["ww", "@mozilla.org/embedcomp/window-watcher;1", "nsIWindowWatcher"],
|
||||
["startup", "@mozilla.org/toolkit/app-startup;1", "nsIAppStartup"],
|
||||
["sysinfo", "@mozilla.org/system-info;1", "nsIPropertyBag2"],
|
||||
["clipboard", "@mozilla.org/widget/clipboard;1", "nsIClipboard"],
|
||||
["DOMRequest", "@mozilla.org/dom/dom-request-service;1", "nsIDOMRequestService"],
|
||||
["focus", "@mozilla.org/focus-manager;1", "nsIFocusManager"],
|
||||
["uriFixup", "@mozilla.org/docshell/urifixup;1", "nsIURIFixup"],
|
||||
["blocklist", "@mozilla.org/extensions/blocklist;1", "nsIBlocklistService"],
|
||||
["netUtils", "@mozilla.org/network/util;1", "nsINetUtil"],
|
||||
["loadContextInfo", "@mozilla.org/load-context-info-factory;1", "nsILoadContextInfoFactory"],
|
||||
["qms", "@mozilla.org/dom/quota-manager-service;1", "nsIQuotaManagerService"],
|
||||
];
|
||||
var initTable = {
|
||||
appShell: ["@mozilla.org/appshell/appShellService;1", "nsIAppShellService"],
|
||||
cache: ["@mozilla.org/network/cache-service;1", "nsICacheService"],
|
||||
cache2: ["@mozilla.org/netwerk/cache-storage-service;1", "nsICacheStorageService"],
|
||||
cpmm: ["@mozilla.org/childprocessmessagemanager;1", "nsIMessageSender"],
|
||||
console: ["@mozilla.org/consoleservice;1", "nsIConsoleService"],
|
||||
contentPrefs: ["@mozilla.org/content-pref/service;1", "nsIContentPrefService"],
|
||||
cookies: ["@mozilla.org/cookiemanager;1", "nsICookieManager2"],
|
||||
downloads: ["@mozilla.org/download-manager;1", "nsIDownloadManager"],
|
||||
droppedLinkHandler: ["@mozilla.org/content/dropped-link-handler;1", "nsIDroppedLinkHandler"],
|
||||
els: ["@mozilla.org/eventlistenerservice;1", "nsIEventListenerService"],
|
||||
eTLD: ["@mozilla.org/network/effective-tld-service;1", "nsIEffectiveTLDService"],
|
||||
intl: ["@mozilla.org/mozintl;1", "mozIMozIntl"],
|
||||
locale: ["@mozilla.org/intl/localeservice;1", "mozILocaleService"],
|
||||
logins: ["@mozilla.org/login-manager;1", "nsILoginManager"],
|
||||
obs: ["@mozilla.org/observer-service;1", "nsIObserverService"],
|
||||
perms: ["@mozilla.org/permissionmanager;1", "nsIPermissionManager"],
|
||||
prompt: ["@mozilla.org/embedcomp/prompt-service;1", "nsIPromptService"],
|
||||
scriptloader: ["@mozilla.org/moz/jssubscript-loader;1", "mozIJSSubScriptLoader"],
|
||||
scriptSecurityManager: ["@mozilla.org/scriptsecuritymanager;1", "nsIScriptSecurityManager"],
|
||||
storage: ["@mozilla.org/storage/service;1", "mozIStorageService"],
|
||||
domStorageManager: ["@mozilla.org/dom/localStorage-manager;1", "nsIDOMStorageManager"],
|
||||
strings: ["@mozilla.org/intl/stringbundle;1", "nsIStringBundleService"],
|
||||
telemetry: ["@mozilla.org/base/telemetry;1", "nsITelemetry"],
|
||||
tm: ["@mozilla.org/thread-manager;1", "nsIThreadManager"],
|
||||
urlFormatter: ["@mozilla.org/toolkit/URLFormatterService;1", "nsIURLFormatter"],
|
||||
vc: ["@mozilla.org/xpcom/version-comparator;1", "nsIVersionComparator"],
|
||||
wm: ["@mozilla.org/appshell/window-mediator;1", "nsIWindowMediator"],
|
||||
ww: ["@mozilla.org/embedcomp/window-watcher;1", "nsIWindowWatcher"],
|
||||
startup: ["@mozilla.org/toolkit/app-startup;1", "nsIAppStartup"],
|
||||
sysinfo: ["@mozilla.org/system-info;1", "nsIPropertyBag2"],
|
||||
clipboard: ["@mozilla.org/widget/clipboard;1", "nsIClipboard"],
|
||||
DOMRequest: ["@mozilla.org/dom/dom-request-service;1", "nsIDOMRequestService"],
|
||||
focus: ["@mozilla.org/focus-manager;1", "nsIFocusManager"],
|
||||
uriFixup: ["@mozilla.org/docshell/urifixup;1", "nsIURIFixup"],
|
||||
blocklist: ["@mozilla.org/extensions/blocklist;1", "nsIBlocklistService"],
|
||||
netUtils: ["@mozilla.org/network/util;1", "nsINetUtil"],
|
||||
loadContextInfo: ["@mozilla.org/load-context-info-factory;1", "nsILoadContextInfoFactory"],
|
||||
qms: ["@mozilla.org/dom/quota-manager-service;1", "nsIQuotaManagerService"],
|
||||
};
|
||||
|
||||
for (let [name, contract, intf, enabled = true] of initTable) {
|
||||
if (enabled) {
|
||||
XPCOMUtils.defineLazyServiceGetter(Services, name, contract, intf);
|
||||
}
|
||||
if (AppConstants.platform == "android") {
|
||||
initTable.androidBridge = ["@mozilla.org/android/bridge;1", "nsIAndroidBridge"];
|
||||
}
|
||||
if (AppConstants.MOZ_GECKO_PROFILER) {
|
||||
initTable.profiler = ["@mozilla.org/tools/profiler;1", "nsIProfiler"];
|
||||
}
|
||||
if (AppConstants.MOZ_TOOLKIT_SEARCH) {
|
||||
initTable.search = ["@mozilla.org/browser/search-service;1", "nsIBrowserSearchService"];
|
||||
}
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetters(Services, initTable);
|
||||
|
||||
initTable = undefined;
|
||||
|
@ -16,25 +16,20 @@ const TRANSACTIONS_QUEUE_TIMEOUT_MS = 240000 // 4 minutes
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Timer.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
|
||||
"resource://gre/modules/AsyncShutdown.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Services",
|
||||
"resource://gre/modules/Services.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "OS",
|
||||
"resource://gre/modules/osfile.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Log",
|
||||
"resource://gre/modules/Log.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
|
||||
"resource://gre/modules/FileUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Task",
|
||||
"resource://gre/modules/Task.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
|
||||
Services: "resource://gre/modules/Services.jsm",
|
||||
OS: "resource://gre/modules/osfile.jsm",
|
||||
Log: "resource://gre/modules/Log.jsm",
|
||||
FileUtils: "resource://gre/modules/FileUtils.jsm",
|
||||
Task: "resource://gre/modules/Task.jsm",
|
||||
PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
|
||||
console: "resource://gre/modules/Console.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "FinalizationWitnessService",
|
||||
"@mozilla.org/toolkit/finalizationwitness;1",
|
||||
"nsIFinalizationWitnessService");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils",
|
||||
"resource://gre/modules/PromiseUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "console",
|
||||
"resource://gre/modules/Console.jsm");
|
||||
|
||||
// Regular expression used by isInvalidBoundLikeQuery
|
||||
var likeSqlRegex = /\bLIKE\b\s(?![@:?])/i;
|
||||
|
@ -77,14 +77,12 @@ Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/AsyncShutdown.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
|
||||
"resource://gre/modules/addons/AddonRepository.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Extension",
|
||||
"resource://gre/modules/Extension.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
|
||||
"resource://gre/modules/FileUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PromptUtils",
|
||||
"resource://gre/modules/SharedPromptUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AddonRepository: "resource://gre/modules/addons/AddonRepository.jsm",
|
||||
Extension: "resource://gre/modules/Extension.jsm",
|
||||
FileUtils: "resource://gre/modules/FileUtils.jsm",
|
||||
PromptUtils: "resource://gre/modules/SharedPromptUtils.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "CertUtils", function() {
|
||||
let certUtils = {};
|
||||
|
@ -17,78 +17,43 @@ Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/AddonManager.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
|
||||
"resource://gre/modules/addons/AddonRepository.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AddonSettings",
|
||||
"resource://gre/modules/addons/AddonSettings.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ChromeManifestParser",
|
||||
"resource://gre/modules/ChromeManifestParser.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Extension",
|
||||
"resource://gre/modules/Extension.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
|
||||
"resource://gre/modules/LightweightThemeManager.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
|
||||
"resource://gre/modules/FileUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ZipUtils",
|
||||
"resource://gre/modules/ZipUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PermissionsUtils",
|
||||
"resource://gre/modules/PermissionsUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "OS",
|
||||
"resource://gre/modules/osfile.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ConsoleAPI",
|
||||
"resource://gre/modules/Console.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ProductAddonChecker",
|
||||
"resource://gre/modules/addons/ProductAddonChecker.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils",
|
||||
"resource://gre/modules/UpdateUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "isAddonPartOfE10SRollout",
|
||||
"resource://gre/modules/addons/E10SAddonsRollout.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "JSONFile",
|
||||
"resource://gre/modules/JSONFile.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "LegacyExtensionsUtils",
|
||||
"resource://gre/modules/LegacyExtensionsUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AddonRepository: "resource://gre/modules/addons/AddonRepository.jsm",
|
||||
AddonSettings: "resource://gre/modules/addons/AddonSettings.jsm",
|
||||
AppConstants: "resource://gre/modules/AppConstants.jsm",
|
||||
ChromeManifestParser: "resource://gre/modules/ChromeManifestParser.jsm",
|
||||
Extension: "resource://gre/modules/Extension.jsm",
|
||||
LightweightThemeManager: "resource://gre/modules/LightweightThemeManager.jsm",
|
||||
FileUtils: "resource://gre/modules/FileUtils.jsm",
|
||||
ZipUtils: "resource://gre/modules/ZipUtils.jsm",
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
PermissionsUtils: "resource://gre/modules/PermissionsUtils.jsm",
|
||||
OS: "resource://gre/modules/osfile.jsm",
|
||||
ConsoleAPI: "resource://gre/modules/Console.jsm",
|
||||
ProductAddonChecker: "resource://gre/modules/addons/ProductAddonChecker.jsm",
|
||||
UpdateUtils: "resource://gre/modules/UpdateUtils.jsm",
|
||||
isAddonPartOfE10SRollout: "resource://gre/modules/addons/E10SAddonsRollout.jsm",
|
||||
JSONFile: "resource://gre/modules/JSONFile.jsm",
|
||||
LegacyExtensionsUtils: "resource://gre/modules/LegacyExtensionsUtils.jsm",
|
||||
|
||||
/* globals DownloadAddonInstall, LocalAddonInstall, StagedAddonInstall, UpdateChecker, loadManifestFromFile, verifyBundleSignedState */
|
||||
for (let sym of [
|
||||
"DownloadAddonInstall",
|
||||
"LocalAddonInstall",
|
||||
"StagedAddonInstall",
|
||||
"UpdateChecker",
|
||||
"loadManifestFromFile",
|
||||
"verifyBundleSignedState",
|
||||
]) {
|
||||
XPCOMUtils.defineLazyModuleGetter(this, sym, "resource://gre/modules/addons/XPIInstall.jsm");
|
||||
}
|
||||
DownloadAddonInstall: "resource://gre/modules/addons/XPIInstall.jsm",
|
||||
LocalAddonInstall: "resource://gre/modules/addons/XPIInstall.jsm",
|
||||
StagedAddonInstall: "resource://gre/modules/addons/XPIInstall.jsm",
|
||||
UpdateChecker: "resource://gre/modules/addons/XPIInstall.jsm",
|
||||
loadManifestFromFile: "resource://gre/modules/addons/XPIInstall.jsm",
|
||||
verifyBundleSignedState: "resource://gre/modules/addons/XPIInstall.jsm",
|
||||
});
|
||||
|
||||
const {nsIBlocklistService} = Ci;
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "Blocklist",
|
||||
"@mozilla.org/extensions/blocklist;1",
|
||||
"nsIBlocklistService");
|
||||
XPCOMUtils.defineLazyServiceGetter(this,
|
||||
"ChromeRegistry",
|
||||
"@mozilla.org/chrome/chrome-registry;1",
|
||||
"nsIChromeRegistry");
|
||||
XPCOMUtils.defineLazyServiceGetter(this,
|
||||
"ResProtocolHandler",
|
||||
"@mozilla.org/network/protocol;1?name=resource",
|
||||
"nsIResProtocolHandler");
|
||||
XPCOMUtils.defineLazyServiceGetter(this,
|
||||
"AddonPolicyService",
|
||||
"@mozilla.org/addons/policy-service;1",
|
||||
"nsIAddonPolicyService");
|
||||
XPCOMUtils.defineLazyServiceGetter(this,
|
||||
"AddonPathService",
|
||||
"@mozilla.org/addon-path-service;1",
|
||||
"amIAddonPathService");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "aomStartup",
|
||||
"@mozilla.org/addons/addon-manager-startup;1",
|
||||
"amIAddonManagerStartup");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetters(this, {
|
||||
Blocklist: ["@mozilla.org/extensions/blocklist;1", "nsIBlocklistService"],
|
||||
ChromeRegistry: ["@mozilla.org/chrome/chrome-registry;1", "nsIChromeRegistry"],
|
||||
ResProtocolHandler: ["@mozilla.org/network/protocol;1?name=resource", "nsIResProtocolHandler"],
|
||||
AddonPolicyService: ["@mozilla.org/addons/policy-service;1", "nsIAddonPolicyService"],
|
||||
AddonPathService: ["@mozilla.org/addon-path-service;1", "amIAddonPathService"],
|
||||
aomStartup: ["@mozilla.org/addons/addon-manager-startup;1", "amIAddonManagerStartup"],
|
||||
});
|
||||
|
||||
Cu.importGlobalProperties(["URL"]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user