diff --git a/toolkit/mozapps/extensions/src/nsExtensionManager.js.in b/toolkit/mozapps/extensions/src/nsExtensionManager.js.in index 1e8098b85392..fd2a114b23dd 100644 --- a/toolkit/mozapps/extensions/src/nsExtensionManager.js.in +++ b/toolkit/mozapps/extensions/src/nsExtensionManager.js.in @@ -209,7 +209,7 @@ var BundleManager = { * The URI of the bundle to load * @returns A nsIStringBundle which was retrieved. */ - getBundle: function(bundleURI) { + getBundle: function BundleManager_getBundle(bundleURI) { var sbs = Cc["@mozilla.org/intl/stringbundle;1"]. getService(Ci.nsIStringBundleService); return sbs.createBundle(bundleURI); @@ -994,11 +994,11 @@ function ArrayEnumerator(aItems) { ArrayEnumerator.prototype = { _index: 0, - hasMoreElements: function () { + hasMoreElements: function ArrayEnumerator_hasMoreElements() { return this._index < this._contents.length; }, - getNext: function () { + getNext: function ArrayEnumerator_getNext() { return this._contents[this._index++]; } }; @@ -1036,7 +1036,7 @@ FileEnumerator.prototype = { /** * Stop enumerating. Nothing to do here. */ - close: function() { + close: function FileEnumerator_close() { } }; @@ -1100,7 +1100,7 @@ DirectoryInstallLocation.prototype = { * The file containing the directory path * @returns A nsILocalFile object representing the linked directory. */ - _readDirectoryFromFile: function(file) { + _readDirectoryFromFile: function DirInstallLocation__readDirectoryFromFile(file) { var fis = Cc["@mozilla.org/network/file-input-stream;1"]. createInstance(Ci.nsIFileInputStream); fis.init(file, -1, -1, false); @@ -1165,7 +1165,7 @@ DirectoryInstallLocation.prototype = { * N.B. This function makes no promises about whether or not this path is * actually maintained by this Install Location. */ - getIDForLocation: function(file) { + getIDForLocation: function DirInstallLocation_getIDForLocation(file) { var section = file.leafName; var filePD = file.persistentDescriptor; if (filePD in this._locationToIDMap) @@ -1220,7 +1220,7 @@ DirectoryInstallLocation.prototype = { /** * See nsIExtensionManager.idl */ - getItemLocation: function(id) { + getItemLocation: function DirInstallLocation_getItemLocation(id) { var itemLocation = this.location; itemLocation.append(id); if (itemLocation.exists() && !itemLocation.isDirectory()) @@ -1233,7 +1233,7 @@ DirectoryInstallLocation.prototype = { /** * See nsIExtensionManager.idl */ - itemIsManagedIndependently: function(id) { + itemIsManagedIndependently: function DirInstallLocation_itemIsManagedIndependently(id) { if (this._independent) return true; var itemLocation = this.location; @@ -1244,7 +1244,7 @@ DirectoryInstallLocation.prototype = { /** * See nsIExtensionManager.idl */ - getItemFile: function(id, filePath) { + getItemFile: function DirInstallLocation_getItemFile(id, filePath) { var itemLocation = this.getItemLocation(id).clone(); var parts = filePath.split("/"); for (var i = 0; i < parts.length; ++i) @@ -1259,7 +1259,7 @@ DirectoryInstallLocation.prototype = { * @param id * The GUID of the item the file represents */ - stageFile: function(file, id) { + stageFile: function DirInstallLocation_stageFile(file, id) { var stagedFile = this.location; stagedFile.append(DIR_STAGE); stagedFile.append(id); @@ -1288,7 +1288,7 @@ DirectoryInstallLocation.prototype = { * The ID of the staged package * @returns an nsIFile if the package exists otherwise null. */ - getStageFile: function(id) { + getStageFile: function DirInstallLocation_getStageFile(id) { var stageFile = null; var stageDir = this.location; stageDir.append(DIR_STAGE); @@ -1325,7 +1325,7 @@ DirectoryInstallLocation.prototype = { * @param file * The file to remove. */ - removeFile: function(file) { + removeFile: function DirInstallLocation_removeFile(file) { if (file.exists()) file.remove(false); var parent = file.parent; @@ -1428,7 +1428,7 @@ WinRegInstallLocation.prototype = { * @param key * The key that contains the GUID->path pairs */ - _readAddons: function(key) { + _readAddons: function RegInstallLocation__readAddons(key) { var count = key.valueCount; for (var i = 0; i < count; ++i) { var id = key.getValueName(i); @@ -1473,15 +1473,15 @@ WinRegInstallLocation.prototype = { return this._priority; }, - getItemLocation: function(id) { + getItemLocation: function RegInstallLocation_getItemLocation(id) { return this._IDToDirMap[id]; }, - getIDForLocation: function(dir) { + getIDForLocation: function RegInstallLocation_getIDForLocation(dir) { return this._DirToIDMap[dir.path]; }, - getItemFile: function(id, filePath) { + getItemFile: function RegInstallLocation_getItemFile(id, filePath) { var itemLocation = this.getItemLocation(id).clone(); var parts = filePath.split("/"); for (var i = 0; i < parts.length; ++i) @@ -1489,7 +1489,7 @@ WinRegInstallLocation.prototype = { return itemLocation; }, - itemIsManagedIndependently: function(id) { + itemIsManagedIndependently: function RegInstallLocation_itemIsManagedIndependently(id) { return true; }, @@ -1541,7 +1541,7 @@ Installer.prototype = { * the item is assumed to be an expanded directory, located at the GUID * key in the supplied Install Location. */ - installFromFile: function(file) { + installFromFile: function Installer_installFromFile(file) { // Move files from the staging dir into the extension's final home. if (file && file.exists()) { this._installExtensionFiles(file); @@ -1565,7 +1565,7 @@ Installer.prototype = { * @param file * The XPI/JAR file to install from. */ - _installExtensionFiles: function(file) { + _installExtensionFiles: function Installer__installExtensionFiles(file) { /** * Callback for |safeInstallOperation| that performs file level installation * steps for an Extension. @@ -1727,7 +1727,7 @@ Installer.prototype = { * Upgrade contents.rdf Chrome Manifests used by this Theme to the new * chrome.manifest format if necessary. */ - upgradeThemeChrome: function() { + upgradeThemeChrome: function Installer_upgradeThemeChrome() { // Use the Chrome Registry API to install the theme there var cr = Cc["@mozilla.org/chrome/chrome-registry;1"]. getService(Ci.nsIToolkitChromeRegistry); @@ -1780,7 +1780,7 @@ Installer.prototype = { * Upgrade contents.rdf Chrome Manifests used by this Extension to the new * chrome.manifest format if necessary. */ - upgradeExtensionChrome: function() { + upgradeExtensionChrome: function Installer_upgradeExtensionChrome() { // If the extension is aware of the new flat chrome manifests and has // included one, just use it instead of generating one from the // install.rdf/contents.rdf data. @@ -2094,7 +2094,7 @@ var PendingOperations = { * is installed. * "id" The GUID of the item. */ - addItem: function(opType, entry) { + addItem: function PendingOperations_addItem(opType, entry) { if (opType == OP_NONE) this.clearOpsForItem(entry.id); else { @@ -2111,7 +2111,7 @@ var PendingOperations = { * @param id * The GUID of the item to remove the entry for */ - clearItem: function(opType, id) { + clearItem: function PendingOperations_clearItem(opType, id) { if (opType in this._ops && id in this._ops[opType]) delete this._ops[opType][id]; }, @@ -2121,7 +2121,7 @@ var PendingOperations = { * @param id * The ID of the item to remove the entries for */ - clearOpsForItem: function(id) { + clearOpsForItem: function PendingOperations_clearOpsForItem(id) { for (var opType in this._ops) { if (id in this._ops[opType]) delete this._ops[opType][id]; @@ -2133,7 +2133,7 @@ var PendingOperations = { * @param opType * The type of Operation to remove all entries for */ - clearItems: function(opType) { + clearItems: function PendingOperations_clearItems(opType) { if (opType in this._ops) delete this._ops[opType]; }, @@ -2143,7 +2143,7 @@ var PendingOperations = { * @param opType * The type of Operation to return a list of */ - getOperations: function(opType) { + getOperations: function PendingOperations_getOperations(opType) { if (!(opType in this._ops)) return []; var ops = []; @@ -2186,7 +2186,7 @@ var InstallLocations = { * @param name * The name of the Install Location to get */ - get: function(name) { + get: function InstallLocations_get(name) { return name in this._locations ? this._locations[name] : null; }, @@ -2195,7 +2195,7 @@ var InstallLocations = { * @param installLocation * The Install Location to register */ - put: function(installLocation) { + put: function InstallLocations_put(installLocation) { this._locations[installLocation.name] = installLocation; } }; @@ -2229,7 +2229,7 @@ var StartupCache = { * Whether or not we should create a new entry for this item * in the cache if one does not already exist. */ - put: function(installLocation, id, op, shouldCreate) { + put: function StartupCache_put(installLocation, id, op, shouldCreate) { var itemLocation = installLocation.getItemLocation(id); var descriptor = null; @@ -2264,7 +2264,7 @@ var StartupCache = { * @param shouldCreate * Boolean value indicating whether to create or delete the entry. */ - _putRaw: function(key, id, descriptor, mtime, op, shouldCreate) { + _putRaw: function StartupCache__putRaw(key, id, descriptor, mtime, op, shouldCreate) { if (!(key in this.entries)) this.entries[key] = { }; if (!(id in this.entries[key])) @@ -2293,7 +2293,7 @@ var StartupCache = { * @param id * The GUID of the item. */ - clearEntry: function(installLocation, id) { + clearEntry: function StartupCache_clearEntry(installLocation, id) { var key = installLocation.name; if (key in this.entries && id in this.entries[key]) this.entries[key][id] = null; @@ -2305,7 +2305,7 @@ var StartupCache = { * The GUID of the item to locate. * @returns An array of Startup Cache entries for the specified ID. */ - findEntries: function(id) { + findEntries: function StartupCache_findEntries(id) { var entries = []; for (var key in this.entries) { if (id in this.entries[key]) @@ -2319,7 +2319,7 @@ var StartupCache = { * The Item-Change manifest currently holds a list of paths, with the last * mtime for each path, and the GUID of the item at that path. */ - read: function() { + read: function StartupCache_read() { var itemChangeManifest = getFile(KEY_PROFILEDIR, [FILE_EXTENSIONS_STARTUP_CACHE]); if (!itemChangeManifest.exists()) { // There is no change manifest for some reason, either we're in an initial @@ -2365,7 +2365,7 @@ var StartupCache = { /** * Writes the Startup Cache to disk */ - write: function() { + write: function StartupCache_write() { var extensionsCacheFile = getFile(KEY_PROFILEDIR, [FILE_EXTENSIONS_STARTUP_CACHE]); var fos = openSafeFileOutputStream(extensionsCacheFile); for (var locationKey in this.entries) { @@ -2517,7 +2517,7 @@ ExtensionManager.prototype = { /** * See nsIObserver.idl */ - observe: function(subject, topic, data) { + observe: function EM_observe(subject, topic, data) { switch (topic) { case "app-startup": gOS.addObserver(this, "profile-after-change", false); @@ -2555,14 +2555,14 @@ ExtensionManager.prototype = { * Refresh the logging enabled global from preferences when the user changes * the preference settting. */ - _loggingToggled: function() { + _loggingToggled: function EM__loggingToggled() { gLoggingEnabled = getPref("getBoolPref", PREF_EM_LOGGING_ENABLED, false); }, /** * Retrieves the current locale */ - _updateLocale: function() { + _updateLocale: function EM__updateLocale() { try { if (gPref.getBoolPref(PREF_MATCH_OS_LOCALE)) { var localeSvc = Cc["@mozilla.org/intl/nslocaleservice;1"]. @@ -2580,7 +2580,7 @@ ExtensionManager.prototype = { * When a preference is toggled that affects whether an item is usable or not * we must app-enable or app-disable the item based on the new settings. */ - _updateAppDisabledState: function() { + _updateAppDisabledState: function EM__updateAppDisabledState() { gCheckCompatibility = getPref("getBoolPref", PREF_EM_CHECK_COMPATIBILITY, true); gCheckUpdateSecurity = getPref("getBoolPref", PREF_EM_CHECK_UPDATE_SECURITY, true); var ds = this.datasource; @@ -2605,7 +2605,7 @@ ExtensionManager.prototype = { /** * Initialize the system after a profile has been selected. */ - _profileSelected: function() { + _profileSelected: function EM__profileSelected() { // Tell the Chrome Registry which Skin to select try { if (gPref.getBoolPref(PREF_DSS_SWITCHPENDING)) { @@ -2643,7 +2643,7 @@ ExtensionManager.prototype = { /** * Notify user that there are new addons updates */ - _showUpdatesWindow: function() { + _showUpdatesWindow: function EM__showUpdatesWindow() { if (!getPref("getBoolPref", PREF_UPDATE_NOTIFYUSER, false)) return; @@ -2664,7 +2664,7 @@ ExtensionManager.prototype = { /** * Clean up on application shutdown to avoid leaks. */ - _shutdown: function() { + _shutdown: function EM__shutdown() { if (!gAllowFlush) { // Something went wrong and there are potentially flushes pending. ERROR("Reached _shutdown and without clearing any pending flushes"); @@ -2712,7 +2712,7 @@ ExtensionManager.prototype = { * @returns true if any critical file is missing and the system needs to * be rebuilt, false otherwise. */ - _ensureDatasetIntegrity: function () { + _ensureDatasetIntegrity: function EM__ensureDatasetIntegrity() { var extensionsDS = getFile(KEY_PROFILEDIR, [FILE_EXTENSIONS]); var extensionsINI = getFile(KEY_PROFILEDIR, [FILE_EXTENSION_MANIFEST]); var extensionsCache = getFile(KEY_PROFILEDIR, [FILE_EXTENSIONS_STARTUP_CACHE]); @@ -2738,7 +2738,7 @@ ExtensionManager.prototype = { /** * See nsIExtensionManager.idl */ - start: function(commandLine) { + start: function EM_start(commandLine) { var isDirty = false; var forceAutoReg = false; @@ -2807,7 +2807,7 @@ ExtensionManager.prototype = { /** * Begins all background update check timers */ - _startTimers: function() { + _startTimers: function EM__startTimers() { // Register a background update check timer var tm = Cc["@mozilla.org/updates/timer-manager;1"]. getService(Ci.nsIUpdateTimerManager); @@ -2820,7 +2820,7 @@ ExtensionManager.prototype = { * @param timer * The timer that fired */ - notify: function(timer) { + notify: function EM_notify(timer) { if (!getPref("getBoolPref", PREF_EM_UPDATE_ENABLED, true)) return; @@ -2835,7 +2835,7 @@ ExtensionManager.prototype = { /** * See nsIExtensionManager.idl */ - handleCommandLineArgs: function(commandLine) { + handleCommandLineArgs: function EM_handleCommandLineArgs(commandLine) { try { var globalExtension = commandLine.handleFlagWithParam("install-global-extension", false); if (globalExtension) { @@ -2860,7 +2860,7 @@ ExtensionManager.prototype = { * @param file * The XPI/JAR file to extract */ - _installGlobalItem: function(file) { + _installGlobalItem: function EM__installGlobalItem(file) { if (!file || !file.exists()) throw new Error("Unable to find the file specified on the command line!"); #ifdef XP_WIN @@ -2896,7 +2896,7 @@ ExtensionManager.prototype = { * @returns A nsIUpdateItem representing the dropped XPI if this file was a * XPI/JAR that needs installation, null otherwise. */ - _getItemForDroppedFile: function(file, location) { + _getItemForDroppedFile: function EM__getItemForDroppedFile(file, location) { if (fileIsItemPackage(file)) { // We know nothing about this item, it is not something we've // staged in preparation for finalization, so assume it's something @@ -2951,7 +2951,7 @@ ExtensionManager.prototype = { * The callback that configures the item for installation upon * successful validation. */ - installItem: function(id, location, callback) { + installItem: function EM_installItem(id, location, callback) { // As this is the only pint at which we reliably know the installation var installRDF = location.getItemFile(id, FILE_INSTALL_MANIFEST); if (installRDF.exists()) { @@ -3010,7 +3010,7 @@ ExtensionManager.prototype = { * Manager, e.g. items were added or removed from a Install Location or items * in an Install Location changed. */ - _checkForFileChanges: function() { + _checkForFileChanges: function EM__checkForFileChanges() { var em = this; /** @@ -3306,7 +3306,7 @@ ExtensionManager.prototype = { * @returns true if actions were performed that require a restart, false * otherwise. */ - _upgradeChrome: function() { + _upgradeChrome: function EM__upgradeChrome() { if (inSafeMode()) return false; @@ -3401,7 +3401,7 @@ ExtensionManager.prototype = { return checkForNewChrome; }, - _checkForUncoveredItem: function(id) { + _checkForUncoveredItem: function EM__checkForUncoveredItem(id) { var ds = this.datasource; var oldLocation = this.getInstallLocation(id); var newLocations = []; @@ -3445,7 +3445,7 @@ ExtensionManager.prototype = { * @returns true if actions were performed that require a restart, false * otherwise. */ - _finishOperations: function() { + _finishOperations: function EM__finishOperations() { try { // Stuff has changed, load the Extensions datasource in all its RDFey // glory. @@ -3598,7 +3598,7 @@ ExtensionManager.prototype = { * the application must now be restarted to reinitialize XPCOM, * false otherwise. */ - checkForMismatches: function() { + checkForMismatches: function EM_checkForMismatches() { // Check to see if the version of the application that is being started // now is the same one that was started last time. var currAppVersion = gApp.version; @@ -3776,7 +3776,7 @@ ExtensionManager.prototype = { /** * Shows the "Compatibility Updates" UI */ - _showMismatchWindow: function(items) { + _showMismatchWindow: function EM__showMismatchWindow(items) { var wm = Cc["@mozilla.org/appshell/window-mediator;1"]. getService(Ci.nsIWindowMediator); var wizard = wm.getMostRecentWindow("Update:Wizard"); @@ -3800,7 +3800,7 @@ ExtensionManager.prototype = { * 4) migrates the disabled attribute from the old datasource. * 5) migrates the app compatibility info from the old datasource. */ - _upgradeFromV10: function() { + _upgradeFromV10: function EM__upgradeFromV10() { var extensionsDS = getFile(KEY_PROFILEDIR, [FILE_EXTENSIONS]); var dsExists = extensionsDS.exists(); // Toolkiit 1.7 profiles (Firefox 1.0, Thunderbird 1.0, etc.) have a default @@ -3981,7 +3981,7 @@ ExtensionManager.prototype = { * @param needsRestart * true if the application needs to restart again, false otherwise. */ - _updateManifests: function(needsRestart) { + _updateManifests: function EM__updateManifests(needsRestart) { // During startup we block flushing until the startup operations are all // complete to reduce file accesses that can trigger bug 431065 if (gAllowFlush) { @@ -4005,7 +4005,7 @@ ExtensionManager.prototype = { * The nsIUpdateItem type to return a list of items of * @returns An array of active items of the specified type. */ - _getActiveItems: function(type) { + _getActiveItems: function EM__getActiveItems(type) { var allItems = this.getItemList(type, { }); var activeItems = []; var ds = this.datasource; @@ -4038,7 +4038,7 @@ ExtensionManager.prototype = { /** * Write the Extensions List */ - _updateExtensionsManifest: function() { + _updateExtensionsManifest: function EM__updateExtensionsManifest() { // When an operation is performed that requires a component re-registration // (extension enabled/disabled, installed, uninstalled), we must write the // set of paths where extensions live so that the startup system can determine @@ -4139,7 +4139,7 @@ ExtensionManager.prototype = { * INSTALLERROR_BLOCKLISTED * error, item is blocklisted */ - _getInstallData: function(installManifest) { + _getInstallData: function EM__getInstallData(installManifest) { var installData = { id : "", version : "", name : "", @@ -4272,7 +4272,7 @@ ExtensionManager.prototype = { * The name of the Install Location where this item should be * installed. */ - installItemFromFile: function(xpiFile, installLocationKey) { + installItemFromFile: function EM_installItemFromFile(xpiFile, installLocationKey) { this.installItemFromFileInternal(xpiFile, installLocationKey, null); // If there are no compatibility checks running and no downloads in @@ -4295,7 +4295,9 @@ ExtensionManager.prototype = { * Can be null when invoked from callers other than the Version * Update check. */ - installItemFromFileInternal: function(aXPIFile, aInstallLocationKey, aInstallManifest) { + installItemFromFileInternal: function EM_installItemFromFileInternal(aXPIFile, + aInstallLocationKey, + aInstallManifest) { var em = this; /** * Gets the Install Location for an Item. @@ -4479,7 +4481,7 @@ ExtensionManager.prototype = { * @param installRDF * The install.rdf file that was extracted from the xpi. */ - checkForUpdates: function(item, installManifest, xpiFile) { + checkForUpdates: function EM_checkForUpdates(item, installManifest, xpiFile) { this._xpi = xpiFile; this._installManifest = installManifest; @@ -4492,21 +4494,21 @@ ExtensionManager.prototype = { /** * See nsIExtensionManager.idl */ - onUpdateStarted: function() { + onUpdateStarted: function EM_onUpdateStarted() { LOG("Phone Home Listener: Update Started"); }, /** * See nsIExtensionManager.idl */ - onUpdateEnded: function() { + onUpdateEnded: function EM_onUpdateEnded() { LOG("Phone Home Listener: Update Ended"); }, /** * See nsIExtensionManager.idl */ - onAddonUpdateStarted: function(addon) { + onAddonUpdateStarted: function EM_onAddonUpdateStarted(addon) { if (!addon) throw Cr.NS_ERROR_INVALID_ARG; @@ -4518,7 +4520,7 @@ ExtensionManager.prototype = { /** * See nsIExtensionManager.idl */ - onAddonUpdateEnded: function(addon, status) { + onAddonUpdateEnded: function EM_onAddonUpdateEnded(addon, status) { if (!addon) throw Cr.NS_ERROR_INVALID_ARG; @@ -4789,7 +4791,7 @@ ExtensionManager.prototype = { * @returns true if installation of an item of this type requires a * restart. */ - installRequiresRestart: function(id, type) { + installRequiresRestart: function EM_installRequiresRestart(id, type) { switch (type) { case Ci.nsIUpdateItem.TYPE_THEME: var internalName = this.datasource.getItemProperty(id, "internalName"); @@ -4818,7 +4820,10 @@ ExtensionManager.prototype = { * @param type * The nsIUpdateItem type of this item. */ - _configureForthcomingItem: function(installManifest, id, installLocation, type) { + _configureForthcomingItem: function EM__configureForthcomingItem(installManifest, + id, + installLocation, + type) { var ds = this.datasource; ds.updateVisibleList(id, installLocation.name, false); @@ -4866,7 +4871,7 @@ ExtensionManager.prototype = { * @param type * The nsIUpdateItem type of this item. */ - _upgradeItem: function (installManifest, id, installLocation, type) { + _upgradeItem: function EM__upgradeItem(installManifest, id, installLocation, type) { // Don't change any props that would need to be reset if the install fails. // They will be reset as appropriate by the upgrade/install process. var ds = this.datasource; @@ -4893,7 +4898,7 @@ ExtensionManager.prototype = { * The XPI/JAR file to install from. If this is null, we try to * determine the stage file location from the ID. */ - _finalizeInstall: function(id, file) { + _finalizeInstall: function EM__finalizeInstall(id, file) { var ds = this.datasource; var type = ds.getItemProperty(id, "type"); if (id == 0 || id == -1) { @@ -4941,7 +4946,7 @@ ExtensionManager.prototype = { * @param installLocation * The nsIInstallLocation of the item */ - _finalizeUpgrade: function(id, installLocation) { + _finalizeUpgrade: function EM__finalizeUpgrade(id, installLocation) { // Retrieve the item properties *BEFORE* we clean the resource! var ds = this.datasource; @@ -4982,7 +4987,7 @@ ExtensionManager.prototype = { * @param id * The GUID of the item to uninstall. */ - _finalizeUninstall: function(id) { + _finalizeUninstall: function EM__finalizeUninstall(id) { var ds = this.datasource; var installLocation = this.getInstallLocation(id); @@ -5039,7 +5044,7 @@ ExtensionManager.prototype = { * @param id * The GUID of the item to uninstall. */ - uninstallItem: function(id) { + uninstallItem: function EM_uninstallItem(id) { var ds = this.datasource; ds.updateDownloadState(PREFIX_ITEM_URI + id, null); if (!ds.isDownloadItem(id)) { @@ -5082,7 +5087,7 @@ ExtensionManager.prototype = { }, /* See nsIExtensionManager.idl */ - cancelInstallItem: function(id) { + cancelInstallItem: function EM_cancelInstallItem(id) { var ds = this.datasource; var opType = ds.getItemProperty(id, "opType"); if (opType != OP_NEEDS_UPGRADE && opType != OP_NEEDS_INSTALL) @@ -5133,7 +5138,7 @@ ExtensionManager.prototype = { * @param id * The ID of the item. */ - cancelUninstallItem: function(id) { + cancelUninstallItem: function EM_cancelUninstallItem(id) { var ds = this.datasource; var appDisabled = ds.getItemProperty(id, "appDisabled"); var userDisabled = ds.getItemProperty(id, "userDisabled"); @@ -5162,7 +5167,7 @@ ExtensionManager.prototype = { * @param op * The name of the operation to be performed */ - _setOp: function(id, op) { + _setOp: function EM__setOp(id, op) { var location = this.getInstallLocation(id); StartupCache.put(location, id, op, true); PendingOperations.addItem(op, { locationKey: location.name, id: id }); @@ -5200,7 +5205,7 @@ ExtensionManager.prototype = { * @param id * The ID of the item to be enabled by the application. */ - _appEnableItem: function(id) { + _appEnableItem: function EM__appEnableItem(id) { var ds = this.datasource; var appDisabled = ds.getItemProperty(id, "appDisabled"); if (appDisabled == OP_NONE || appDisabled == OP_NEEDS_ENABLE) @@ -5266,7 +5271,7 @@ ExtensionManager.prototype = { * @param id * The ID of the item to be disabled by the application. */ - _appDisableItem: function(id) { + _appDisableItem: function EM__appDisableItem(id) { var ds = this.datasource; var appDisabled = ds.getItemProperty(id, "appDisabled"); if (appDisabled == "true" || appDisabled == OP_NEEDS_DISABLE) @@ -5328,7 +5333,7 @@ ExtensionManager.prototype = { * @param id * The ID of the item to be enabled by the user. */ - enableItem: function(id) { + enableItem: function EM_enableItem(id) { var ds = this.datasource; var opType = ds.getItemProperty(id, "opType"); var appDisabled = ds.getItemProperty(id, "appDisabled"); @@ -5372,7 +5377,7 @@ ExtensionManager.prototype = { * @param id * The ID of the item to be disabled by the user. */ - disableItem: function(id) { + disableItem: function EM_disableItem(id) { var ds = this.datasource; var opType = ds.getItemProperty(id, "opType"); var appDisabled = ds.getItemProperty(id, "appDisabled"); @@ -5414,7 +5419,7 @@ ExtensionManager.prototype = { * @param id * The ID of the item to check */ - _isUsableItem: function(id) { + _isUsableItem: function EM__isUsableItem(id) { var ds = this.datasource; /* If we're not compatibility checking or if the item is compatible * and if it isn't blocklisted and has all dependencies satisfied then @@ -5441,7 +5446,7 @@ ExtensionManager.prototype = { * @param id * The ID of the item whose dependent items will be checked */ - _updateDependentItemsForID: function(id) { + _updateDependentItemsForID: function EM__updateDependentItemsForID(id) { var ds = this.datasource; var dependentItems = this.getDependentItemListForID(id, true, { }); for (var i = 0; i < dependentItems.length; ++i) { @@ -5458,7 +5463,7 @@ ExtensionManager.prototype = { * Notify observers of a change to an item that has been requested by the * user. */ - _notifyAction: function(id, reason) { + _notifyAction: function EM__notifyAction(id, reason) { gOS.notifyObservers(this.datasource.getItemForID(id), EM_ACTION_REQUESTED_TOPIC, reason); }, @@ -5466,7 +5471,7 @@ ExtensionManager.prototype = { /** * See nsIExtensionManager.idl */ - update: function(items, itemCount, updateCheckType, listener) { + update: function EM_update(items, itemCount, updateCheckType, listener) { for (i = 0; i < itemCount; ++i) { var currItem = items[i]; if (!currItem) @@ -5490,7 +5495,7 @@ ExtensionManager.prototype = { * XXXrstrong - this method is not terribly useful and was added so we can * trigger this check from the additional timer used by blocklisting. */ - checkForBlocklistChanges: function() { + checkForBlocklistChanges: function EM_checkForBlocklistChanges() { var ds = this.datasource; var items = this.getItemList(Ci.nsIUpdateItem.TYPE_ANY, { }); for (var i = 0; i < items.length; ++i) { @@ -5523,7 +5528,7 @@ ExtensionManager.prototype = { * The GUID of the item to locate an Install Location for. * @returns The Install Location object where the item is stored. */ - getInstallLocation: function(id) { + getInstallLocation: function EM_getInstallLocation(id) { var key = this.datasource.visibleItems[id]; return key ? InstallLocations.get(this.datasource.visibleItems[id]) : null; }, @@ -5534,7 +5539,7 @@ ExtensionManager.prototype = { * The GUID of the item to construct a nsIUpdateItem for. * @returns The nsIUpdateItem representing the item. */ - getItemForID: function(id) { + getItemForID: function EM_getItemForID(id) { return this.datasource.getItemForID(id); }, @@ -5550,7 +5555,9 @@ ExtensionManager.prototype = { * @returns An array of installed nsIUpdateItems that depend on the item * specified by the id parameter. */ - getDependentItemListForID: function(id, includeDisabled, countRef) { + getDependentItemListForID: function EM_getDependentItemListForID(id, + includeDisabled, + countRef) { return this.datasource.getDependentItemListForID(id, includeDisabled, countRef); }, @@ -5562,13 +5569,16 @@ ExtensionManager.prototype = { * The XPCJS reference to the number of items returned. * @returns An array of nsIUpdateItems matching the id/type filter. */ - getItemList: function(type, countRef) { + getItemList: function EM_getItemList(type, countRef) { return this.datasource.getItemList(type, countRef); }, /* See nsIExtensionManager.idl */ - getIncompatibleItemList: function(id, appVersion, platformVersion, type, includeDisabled, - countRef) { + getIncompatibleItemList: function EM_getIncompatibleItemList(id, appVersion, + platformVersion, + type, + includeDisabled, + countRef) { var items = this.datasource.getIncompatibleItemList(id, appVersion ? appVersion : undefined, platformVersion ? platformVersion : undefined, type, includeDisabled); @@ -5583,7 +5593,7 @@ ExtensionManager.prototype = { * @param destinationID * The ID of an item to move another item to. */ - moveToIndexOf: function(movingID, destinationID) { + moveToIndexOf: function EM_moveToIndexOf(movingID, destinationID) { this.datasource.moveToIndexOf(movingID, destinationID); }, @@ -5598,7 +5608,7 @@ ExtensionManager.prototype = { * @param isAscending * true to sort ascending and false to sort descending */ - sortTypeByProperty: function(type, propertyName, isAscending) { + sortTypeByProperty: function EM_sortTypeByProperty(type, propertyName, isAscending) { this.datasource.sortTypeByProperty(type, propertyName, isAscending); }, @@ -5616,7 +5626,7 @@ ExtensionManager.prototype = { * wishes to cancel all active downloads and quit the application, * false otherwise. */ - _confirmCancelDownloadsOnQuit: function(subject) { + _confirmCancelDownloadsOnQuit: function EM__confirmCancelDownloadsOnQuit(subject) { // If user has already dismissed quit request, then do nothing if ((subject instanceof Ci.nsISupportsPRBool) && subject.data) return; @@ -5652,7 +5662,7 @@ ExtensionManager.prototype = { * wishes to cancel all active downloads and go offline, false * otherwise. */ - _confirmCancelDownloadsOnOffline: function(subject) { + _confirmCancelDownloadsOnOffline: function EM__confirmCancelDownloadsOnOffline(subject) { if (this._downloadCount > 0) { result = this._confirmCancelDownloads(this._downloadCount, "offlineCancelDownloadsAlertTitle", @@ -5681,8 +5691,10 @@ ExtensionManager.prototype = { * The key of the label to be displayed on the "Don't Cancel * Downloads" button. */ - _confirmCancelDownloads: function(count, title, cancelMessageMultiple, - cancelMessageSingle, dontCancelButton) { + _confirmCancelDownloads: function EM__confirmCancelDownloads(count, title, + cancelMessageMultiple, + cancelMessageSingle, + dontCancelButton) { var bundle = BundleManager.getBundle(URI_DOWNLOADS_PROPERTIES); var title = bundle.GetStringFromName(title); var message, quitButton; @@ -5709,7 +5721,7 @@ ExtensionManager.prototype = { }, /* See nsIExtensionManager.idl */ - addDownloads: function(items, itemCount, manager) { + addDownloads: function EM_addDownloads(items, itemCount, manager) { if (itemCount == 0) throw Cr.NS_ERROR_ILLEGAL_VALUE; @@ -5788,7 +5800,7 @@ ExtensionManager.prototype = { * @param value * ??? */ - onStateChange: function(transaction, addon, state, value) { + onStateChange: function EM_onStateChange(transaction, addon, state, value) { var ds = this.datasource; var id = addon.id != addon.xpiURL ? PREFIX_ITEM_URI + addon.id : addon.xpiURL; const nsIXPIProgressDialog = Ci.nsIXPIProgressDialog; @@ -5847,7 +5859,7 @@ ExtensionManager.prototype = { } }, - onProgress: function(addon, value, maxValue) { + onProgress: function EM_onProgress(addon, value, maxValue) { for (var i = 0; i < this._installListeners.length; ++i) this._installListeners[i].onDownloadProgress(addon, value, maxValue); @@ -5857,7 +5869,7 @@ ExtensionManager.prototype = { }, _installListeners: [], - addInstallListener: function(listener) { + addInstallListener: function EM_addInstallListener(listener) { for (var i = 0; i < this._installListeners.length; ++i) { if (this._installListeners[i] == listener) return i; @@ -5866,7 +5878,7 @@ ExtensionManager.prototype = { return this._installListeners.length - 1; }, - removeInstallListenerAt: function(index) { + removeInstallListenerAt: function EM_removeInstallListenerAt(index) { this._installListeners.splice(index, 1); }, @@ -5882,7 +5894,7 @@ ExtensionManager.prototype = { * - on startup and there has been a change to an Install Location * ... it should NOT be called on every startup! */ - _ensureDS: function() { + _ensureDS: function EM__ensureDS() { if (!this._ds) { this._ds = new ExtensionsDataSource(this); if (this._ds) { @@ -5963,7 +5975,7 @@ ItemDownloadTransaction.prototype = { * @param addon * An object implementing nsIUpdateItem for the item to be downloaded */ - addDownload: function(addon) { + addDownload: function ItemDownloadTransaction_addDownload(addon) { this._downloads.push({ addon: addon, waiting: true }); this._manager.datasource.addDownload(addon); }, @@ -5973,14 +5985,14 @@ ItemDownloadTransaction.prototype = { * @param url * The URL to remove */ - removeDownload: function(url) { + removeDownload: function ItemDownloadTransaction_removeDownload(url) { this._manager.datasource.removeDownload(url); }, /** * Remove all downloads from this transaction */ - removeAllDownloads: function() { + removeAllDownloads: function ItemDownloadTransaction_removeAllDownloads() { for (var i = 0; i < this._downloads.length; ++i) { var addon = this._downloads[i].addon; this.removeDownload(addon.xpiURL); @@ -5993,7 +6005,7 @@ ItemDownloadTransaction.prototype = { * The URL to look for * @returns true if this transaction is downloading the supplied url. */ - containsURL: function(url) { + containsURL: function ItemDownloadTransaction_containsURL(url) { for (var i = 0; i < this._downloads.length; ++i) { if (this._downloads[i].addon.xpiURL == url) return true; @@ -6004,7 +6016,7 @@ ItemDownloadTransaction.prototype = { /** * See nsIXPIProgressDialog.idl */ - onStateChange: function(index, state, value) { + onStateChange: function ItemDownloadTransaction_onStateChange(index, state, value) { this._manager.onStateChange(this, this._downloads[index].addon, state, value); }, @@ -6012,7 +6024,7 @@ ItemDownloadTransaction.prototype = { /** * See nsIXPIProgressDialog.idl */ - onProgress: function(index, value, maxValue) { + onProgress: function ItemDownloadTransaction_onProgress(index, value, maxValue) { this._manager.onProgress(this._downloads[index].addon, value, maxValue); }, @@ -6031,7 +6043,7 @@ BackgroundUpdateCheckListener.prototype = { _emDS: null, // nsIObserver implementation - observe: function(aSubject, aTopic, aData) { + observe: function BackgroundUpdateListener_observe(aSubject, aTopic, aData) { if (aTopic != "alertclickcallback") return; @@ -6061,10 +6073,10 @@ BackgroundUpdateCheckListener.prototype = { }, // nsIAddonUpdateCheckListener implementation - onUpdateStarted: function() { + onUpdateStarted: function BackgroundUpdateListener_onUpdateStarted() { }, - onUpdateEnded: function() { + onUpdateEnded: function BackgroundUpdateListener_onUpdateEnded() { if (this._updateCount > 0 && Cc["@mozilla.org/alerts-service;1"]) { var extensionStrings = BundleManager.getBundle(URI_EXTENSIONS_PROPERTIES); var title = extensionStrings.GetStringFromName("updateNotificationTitle"); @@ -6089,10 +6101,10 @@ BackgroundUpdateCheckListener.prototype = { } }, - onAddonUpdateStarted: function(item) { + onAddonUpdateStarted: function BackgroundUpdateListener_onAddonUpdateStarted(item) { }, - onAddonUpdateEnded: function(item, status) { + onAddonUpdateEnded: function BackgroundUpdateListener_onAddonUpdateEnded(item, status) { if (status == Ci.nsIAddonUpdateCheckListener.STATUS_UPDATE) { var lastupdate = this._emDS.getItemProperty(item.id, "availableUpdateVersion"); if (lastupdate != item.version) { @@ -6116,25 +6128,25 @@ AddonUpdateCheckListener.prototype = { _listener: null, _ds: null, - onUpdateStarted: function() { + onUpdateStarted: function AddonUpdateListener_onUpdateStarted() { if (this._listener) this._listener.onUpdateStarted(); this._ds.onUpdateStarted(); }, - onUpdateEnded: function() { + onUpdateEnded: function AddonUpdateListener_onUpdateEnded() { if (this._listener) this._listener.onUpdateEnded(); this._ds.onUpdateEnded(); }, - onAddonUpdateStarted: function(addon) { + onAddonUpdateStarted: function AddonUpdateListener_onAddonUpdateStarted(addon) { if (this._listener) this._listener.onAddonUpdateStarted(addon); this._ds.onAddonUpdateStarted(addon); }, - onAddonUpdateEnded: function(addon, status) { + onAddonUpdateEnded: function AddonUpdateListener_onAddonUpdateEnded(addon, status) { if (this._listener) this._listener.onAddonUpdateEnded(addon, status); this._ds.onAddonUpdateEnded(addon, status); @@ -6188,8 +6200,10 @@ ExtensionItemUpdater.prototype = { # we look ONLY for compatibility updates in this case to determine # whether or not the item can be installed. */ - checkForUpdates: function(aItems, aItemCount, aUpdateCheckType, - aListener) { + checkForUpdates: function ExtensionItemUpdater_checkForUpdates(aItems, + aItemCount, + aUpdateCheckType, + aListener) { this._listener = new AddonUpdateCheckListener(aListener, this._emDS); if (this._listener) this._listener.onUpdateStarted(); @@ -6213,7 +6227,8 @@ ExtensionItemUpdater.prototype = { ///////////////////////////////////////////////////////////////////////////// // ExtensionItemUpdater - _applyVersionUpdates: function(aLocalItem, aRemoteItem) { + _applyVersionUpdates: function ExtensionItemUpdater__applyVersionUpdates(aLocalItem, + aRemoteItem) { var targetAppInfo = this._emDS.getTargetApplicationInfo(aLocalItem.id, this._emDS); // If targetAppInfo is null this is for a new install. If the local item's // maxVersion does not equal the targetAppInfo maxVersion then this is for @@ -6288,7 +6303,7 @@ ExtensionItemUpdater.prototype = { return true; }, - checkForDone: function(item, status) { + checkForDone: function ExtensionItemUpdater_checkForDone(item, status) { if (this._listener) { try { this._listener.onAddonUpdateEnded(item, status); @@ -6383,7 +6398,7 @@ RDFItemUpdater.prototype = { _updateCheckType : 0, _item : null, - checkForUpdates: function(aItem, aUpdateCheckType) { + checkForUpdates: function RDFItemUpdater_checkForUpdates(aItem, aUpdateCheckType) { // A preference setting can disable updating for this item try { if (!gPref.getBoolPref(PREF_EM_ITEM_UPDATE_ENABLED.replace(/%UUID%/, aItem.id))) { @@ -6473,7 +6488,7 @@ RDFItemUpdater.prototype = { request.send(null); }, - onXMLLoad: function(aEvent, aItem) { + onXMLLoad: function RDFItemUpdater_onXMLLoad(aEvent, aItem) { var request = aEvent.target; try { checkCert(request.channel); @@ -6515,7 +6530,7 @@ RDFItemUpdater.prototype = { this.onDatasourceLoaded(ds, aItem); }, - onXMLError: function(aEvent, aItem) { + onXMLError: function RDFItemUpdater_onXMLError(aEvent, aItem) { try { var request = aEvent.target; // the following may throw (e.g. a local file or timeout) @@ -6542,7 +6557,7 @@ RDFItemUpdater.prototype = { Ci.nsIAddonUpdateCheckListener.STATUS_FAILURE); }, - onDatasourceLoaded: function(aDatasource, aLocalItem) { + onDatasourceLoaded: function RDFItemUpdater_onDatasourceLoaded(aDatasource, aLocalItem) { /* # The extension update RDF file looks something like this: # @@ -6698,7 +6713,10 @@ RDFItemUpdater.prototype = { // Get a compulsory property from a resource. Reports an error if the // property was not present. - _getPropertyFromResource: function(aDataSource, aSourceResource, aProperty, aLocalItem) { + _getPropertyFromResource: function RDFItemUpdater__getPropertyFromResource(aDataSource, + aSourceResource, + aProperty, + aLocalItem) { var rv; try { var property = gRDF.GetResource(EM_NS(aProperty)); @@ -6726,7 +6744,9 @@ RDFItemUpdater.prototype = { * @returns An nsIUpdateItem holding the update's information if a valid * update is found or null if not. */ - _parseV20UpdateInfo: function(aDataSource, aLocalItem, aUpdateCheckType) { + _parseV20UpdateInfo: function RDFItemUpdater__parseV20UpdateInfo(aDataSource, + aLocalItem, + aUpdateCheckType) { var extensionRes = gRDF.GetResource(getItemPrefix(aLocalItem.type) + aLocalItem.id); var updatesArc = gRDF.GetResource(EM_NS("updates")); @@ -6795,7 +6815,11 @@ RDFItemUpdater.prototype = { * @returns An nsIUpdateItem holding the update's information if a valid * update is found or null if not. */ - _parseV20Update: function(aDataSource, aUpdateResource, aLocalItem, aNewestVersionFound, aUpdateCheckType) { + _parseV20Update: function RDFItemUpdater__parseV20Update(aDataSource, + aUpdateResource, + aLocalItem, + aNewestVersionFound, + aUpdateCheckType) { var version = this._getPropertyFromResource(aDataSource, aUpdateResource, "version", aLocalItem); /* If we are looking for new versions then test whether this discovered @@ -6896,7 +6920,7 @@ RDFSerializer.prototype = { * @returns a string with all characters invalid in XML character data * converted to entity references. */ - escapeEntities: function(string) + escapeEntities: function RDFSerializer_escapeEntities(string) { string = string.replace(/&/g, "&"); string = string.replace(/ 0 && ++count == aMaxCount)