diff --git a/addon-sdk/source/lib/sdk/l10n/locale.js b/addon-sdk/source/lib/sdk/l10n/locale.js index 0e59a641883..f3fa879f699 100644 --- a/addon-sdk/source/lib/sdk/l10n/locale.js +++ b/addon-sdk/source/lib/sdk/l10n/locale.js @@ -75,7 +75,7 @@ exports.getPreferedLocales = function getPreferedLocales() { * If null, uses getPreferedLocales() results * @return the best match for the currently selected locale * - * Stolen from http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/XPIProvider.jsm + * Stolen from http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/internal/XPIProvider.jsm */ exports.findClosestLocale = function findClosestLocale(aLocales, aMatchLocales) { diff --git a/addon-sdk/source/python-lib/cuddlefish/preflight.py b/addon-sdk/source/python-lib/cuddlefish/preflight.py index 8b500ec8b66..c92a0890d95 100755 --- a/addon-sdk/source/python-lib/cuddlefish/preflight.py +++ b/addon-sdk/source/python-lib/cuddlefish/preflight.py @@ -16,7 +16,7 @@ def create_jid(): # and all) or in the form of an email address (crazy @ and all). # Firefox will refuse to install an add-on with an id that doesn't # match one of these forms. The actual regexp is at: - # http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/XPIProvider.jsm#130 + # http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/internal/XPIProvider.jsm#130 # So the JID needs an @-suffix, and the only legal punctuation is # "-._". So we start with a base64 encoding, and replace the # punctuation (+/) with letters (AB), losing a few bits of integrity. diff --git a/mobile/android/components/AddonUpdateService.js b/mobile/android/components/AddonUpdateService.js index 28accd6c82a..cfc0df06f1d 100644 --- a/mobile/android/components/AddonUpdateService.js +++ b/mobile/android/components/AddonUpdateService.js @@ -13,7 +13,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository", - "resource://gre/modules/AddonRepository.jsm"); + "resource://gre/modules/addons/AddonRepository.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm"); diff --git a/services/sync/modules/addonutils.js b/services/sync/modules/addonutils.js index d953814d095..54b441b9e59 100644 --- a/services/sync/modules/addonutils.js +++ b/services/sync/modules/addonutils.js @@ -15,7 +15,7 @@ Cu.import("resource://services-sync/util.js"); XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository", - "resource://gre/modules/AddonRepository.jsm"); + "resource://gre/modules/addons/AddonRepository.jsm"); function AddonUtilsInternal() { this._log = Log.repository.getLogger("Sync.AddonUtils"); diff --git a/services/sync/modules/engines/addons.js b/services/sync/modules/engines/addons.js index 9b0eafbf95b..332171743fa 100644 --- a/services/sync/modules/engines/addons.js +++ b/services/sync/modules/engines/addons.js @@ -48,7 +48,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository", - "resource://gre/modules/AddonRepository.jsm"); + "resource://gre/modules/addons/AddonRepository.jsm"); this.EXPORTED_SYMBOLS = ["AddonsEngine"]; diff --git a/services/sync/tps/extensions/tps/modules/addons.jsm b/services/sync/tps/extensions/tps/modules/addons.jsm index 69cc43c1705..55c4e6c7f7a 100644 --- a/services/sync/tps/extensions/tps/modules/addons.jsm +++ b/services/sync/tps/extensions/tps/modules/addons.jsm @@ -8,7 +8,7 @@ let EXPORTED_SYMBOLS = ["Addon", "STATE_ENABLED", "STATE_DISABLED"]; const {classes: Cc, interfaces: Ci, utils: Cu} = Components; Cu.import("resource://gre/modules/AddonManager.jsm"); -Cu.import("resource://gre/modules/AddonRepository.jsm"); +Cu.import("resource://gre/modules/addons/AddonRepository.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://services-common/async.js"); Cu.import("resource://services-sync/addonutils.js"); diff --git a/toolkit/modules/LightweightThemeConsumer.jsm b/toolkit/modules/LightweightThemeConsumer.jsm index 611b640579b..8bb7e4f2679 100644 --- a/toolkit/modules/LightweightThemeConsumer.jsm +++ b/toolkit/modules/LightweightThemeConsumer.jsm @@ -7,7 +7,7 @@ this.EXPORTED_SYMBOLS = ["LightweightThemeConsumer"]; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer", - "resource://gre/modules/LightweightThemeImageOptimizer.jsm"); + "resource://gre/modules/addons/LightweightThemeImageOptimizer.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", "resource://gre/modules/PrivateBrowsingUtils.jsm"); diff --git a/toolkit/mozapps/extensions/AddonManager.jsm b/toolkit/mozapps/extensions/AddonManager.jsm index b5fcf2f7354..3498f0c2a17 100644 --- a/toolkit/mozapps/extensions/AddonManager.jsm +++ b/toolkit/mozapps/extensions/AddonManager.jsm @@ -64,7 +64,7 @@ Cu.import("resource://gre/modules/AsyncShutdown.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Promise", "resource://gre/modules/Promise.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository", - "resource://gre/modules/AddonRepository.jsm"); + "resource://gre/modules/addons/AddonRepository.jsm"); XPCOMUtils.defineLazyGetter(this, "CertUtils", function certUtilsLazyGetter() { let certUtils = {}; @@ -79,13 +79,13 @@ const CATEGORY_PROVIDER_MODULE = "addon-provider-module"; // A list of providers to load by default const DEFAULT_PROVIDERS = [ - "resource://gre/modules/XPIProvider.jsm", + "resource://gre/modules/addons/XPIProvider.jsm", "resource://gre/modules/LightweightThemeManager.jsm" ]; ["LOG", "WARN", "ERROR"].forEach(function(aName) { this.__defineGetter__(aName, function logFuncGetter() { - Components.utils.import("resource://gre/modules/AddonLogging.jsm"); + Components.utils.import("resource://gre/modules/addons/AddonLogging.jsm"); LogManager.getLogger("addons.manager", this); return this[aName]; @@ -1072,7 +1072,7 @@ var AddonManagerInternal = { }, url); pendingUpdates++; - Components.utils.import("resource://gre/modules/AddonUpdateChecker.jsm"); + Components.utils.import("resource://gre/modules/addons/AddonUpdateChecker.jsm"); AddonUpdateChecker.checkForUpdates(hotfixID, null, url, { onUpdateCheckComplete: function BUC_onUpdateCheckComplete(aUpdates) { let update = AddonUpdateChecker.getNewestCompatibleUpdate(aUpdates); diff --git a/toolkit/mozapps/extensions/DeferredSave.jsm b/toolkit/mozapps/extensions/DeferredSave.jsm index 68e9a2f5607..e692255d169 100644 --- a/toolkit/mozapps/extensions/DeferredSave.jsm +++ b/toolkit/mozapps/extensions/DeferredSave.jsm @@ -44,7 +44,7 @@ const DEFAULT_SAVE_DELAY_MS = 50; this.DeferredSave = function (aPath, aDataProvider, aDelay) { // Set up loggers for this instance of DeferredSave let leafName = OS.Path.basename(aPath); - Cu.import("resource://gre/modules/AddonLogging.jsm"); + Cu.import("resource://gre/modules/addons/AddonLogging.jsm"); LogManager.getLogger("DeferredSave/" + leafName, this); // @type {Deferred|null}, null when no data needs to be written diff --git a/toolkit/mozapps/extensions/LightweightThemeManager.jsm b/toolkit/mozapps/extensions/LightweightThemeManager.jsm index 926e29e7ca8..8c9f30492d3 100644 --- a/toolkit/mozapps/extensions/LightweightThemeManager.jsm +++ b/toolkit/mozapps/extensions/LightweightThemeManager.jsm @@ -40,7 +40,7 @@ const PERSIST_FILES = { }; XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer", - "resource://gre/modules/LightweightThemeImageOptimizer.jsm"); + "resource://gre/modules/addons/LightweightThemeImageOptimizer.jsm"); this.__defineGetter__("_prefs", function prefsGetter() { delete this._prefs; diff --git a/toolkit/mozapps/extensions/amWebInstallListener.js b/toolkit/mozapps/extensions/amWebInstallListener.js index 06ac7c248da..2ca582bb6f8 100644 --- a/toolkit/mozapps/extensions/amWebInstallListener.js +++ b/toolkit/mozapps/extensions/amWebInstallListener.js @@ -31,7 +31,7 @@ const READY_STATES = [ ["LOG", "WARN", "ERROR"].forEach(function(aName) { this.__defineGetter__(aName, function logFuncGetter() { - Components.utils.import("resource://gre/modules/AddonLogging.jsm"); + Components.utils.import("resource://gre/modules/addons/AddonLogging.jsm"); LogManager.getLogger("addons.weblistener", this); return this[aName]; diff --git a/toolkit/mozapps/extensions/content/extensions.js b/toolkit/mozapps/extensions/content/extensions.js index 90c6d7fb856..61e61e30fa2 100644 --- a/toolkit/mozapps/extensions/content/extensions.js +++ b/toolkit/mozapps/extensions/content/extensions.js @@ -15,7 +15,7 @@ Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/PluralForm.jsm"); Cu.import("resource://gre/modules/DownloadUtils.jsm"); Cu.import("resource://gre/modules/AddonManager.jsm"); -Cu.import("resource://gre/modules/AddonRepository.jsm"); +Cu.import("resource://gre/modules/addons/AddonRepository.jsm"); const PREF_DISCOVERURL = "extensions.webservice.discoverURL"; diff --git a/toolkit/mozapps/extensions/content/selectAddons.js b/toolkit/mozapps/extensions/content/selectAddons.js index 98a5fe4fc1d..6291a268be9 100644 --- a/toolkit/mozapps/extensions/content/selectAddons.js +++ b/toolkit/mozapps/extensions/content/selectAddons.js @@ -7,7 +7,7 @@ "use strict"; Components.utils.import("resource://gre/modules/AddonManager.jsm"); -Components.utils.import("resource://gre/modules/AddonRepository.jsm"); +Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); const Cc = Components.classes; diff --git a/toolkit/mozapps/extensions/content/update.js b/toolkit/mozapps/extensions/content/update.js index 9d7670e6155..93c0d6230f7 100644 --- a/toolkit/mozapps/extensions/content/update.js +++ b/toolkit/mozapps/extensions/content/update.js @@ -17,7 +17,7 @@ const METADATA_TIMEOUT = 30000; Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/AddonManager.jsm"); -Components.utils.import("resource://gre/modules/AddonRepository.jsm"); +Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm"); var gInteruptable = true; diff --git a/toolkit/mozapps/extensions/extensions.manifest b/toolkit/mozapps/extensions/extensions.manifest index 7ac5a2076c7..8891a89ba11 100644 --- a/toolkit/mozapps/extensions/extensions.manifest +++ b/toolkit/mozapps/extensions/extensions.manifest @@ -9,5 +9,5 @@ component {7beb3ba8-6ec3-41b4-b67c-da89b8518922} amContentHandler.js contract @mozilla.org/uriloader/content-handler;1?type=application/x-xpinstall {7beb3ba8-6ec3-41b4-b67c-da89b8518922} component {0f38e086-89a3-40a5-8ffc-9b694de1d04a} amWebInstallListener.js contract @mozilla.org/addons/web-install-listener;1 {0f38e086-89a3-40a5-8ffc-9b694de1d04a} -category addon-provider-module PluginProvider resource://gre/modules/PluginProvider.jsm +category addon-provider-module PluginProvider resource://gre/modules/addons/PluginProvider.jsm #endif diff --git a/toolkit/mozapps/extensions/AddonLogging.jsm b/toolkit/mozapps/extensions/internal/AddonLogging.jsm similarity index 100% rename from toolkit/mozapps/extensions/AddonLogging.jsm rename to toolkit/mozapps/extensions/internal/AddonLogging.jsm diff --git a/toolkit/mozapps/extensions/AddonRepository.jsm b/toolkit/mozapps/extensions/internal/AddonRepository.jsm similarity index 99% rename from toolkit/mozapps/extensions/AddonRepository.jsm rename to toolkit/mozapps/extensions/internal/AddonRepository.jsm index 478dc91c0b4..adf2dfb9a66 100644 --- a/toolkit/mozapps/extensions/AddonRepository.jsm +++ b/toolkit/mozapps/extensions/internal/AddonRepository.jsm @@ -22,7 +22,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "OS", XPCOMUtils.defineLazyModuleGetter(this, "DeferredSave", "resource://gre/modules/DeferredSave.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository_SQLiteMigrator", - "resource://gre/modules/AddonRepository_SQLiteMigrator.jsm"); + "resource://gre/modules/addons/AddonRepository_SQLiteMigrator.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Promise", "resource://gre/modules/Promise.jsm"); @@ -63,7 +63,7 @@ const TOOLKIT_ID = "toolkit@mozilla.org"; ["LOG", "WARN", "ERROR"].forEach(function(aName) { this.__defineGetter__(aName, function logFuncGetter() { - Components.utils.import("resource://gre/modules/AddonLogging.jsm"); + Components.utils.import("resource://gre/modules/addons/AddonLogging.jsm"); LogManager.getLogger("addons.repository", this); return this[aName]; diff --git a/toolkit/mozapps/extensions/AddonRepository_SQLiteMigrator.jsm b/toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm similarity index 99% rename from toolkit/mozapps/extensions/AddonRepository_SQLiteMigrator.jsm rename to toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm index 34d9aa3d595..f0738d52c48 100644 --- a/toolkit/mozapps/extensions/AddonRepository_SQLiteMigrator.jsm +++ b/toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm @@ -27,7 +27,7 @@ const PROP_SINGLE = ["id", "type", "name", "version", "creator", "description", ["LOG", "WARN", "ERROR"].forEach(function(aName) { this.__defineGetter__(aName, function logFuncGetter() { - Components.utils.import("resource://gre/modules/AddonLogging.jsm"); + Components.utils.import("resource://gre/modules/addons/AddonLogging.jsm"); LogManager.getLogger("addons.repository.sqlmigrator", this); return this[aName]; diff --git a/toolkit/mozapps/extensions/AddonUpdateChecker.jsm b/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm similarity index 99% rename from toolkit/mozapps/extensions/AddonUpdateChecker.jsm rename to toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm index 6db82d630f8..c65070350d7 100644 --- a/toolkit/mozapps/extensions/AddonUpdateChecker.jsm +++ b/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm @@ -32,7 +32,7 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository", - "resource://gre/modules/AddonRepository.jsm"); + "resource://gre/modules/addons/AddonRepository.jsm"); // Shared code for suppressing bad cert dialogs. XPCOMUtils.defineLazyGetter(this, "CertUtils", function certUtilsLazyGetter() { @@ -46,7 +46,7 @@ var gRDF = Cc["@mozilla.org/rdf/rdf-service;1"]. ["LOG", "WARN", "ERROR"].forEach(function(aName) { this.__defineGetter__(aName, function logFuncGetter() { - Components.utils.import("resource://gre/modules/AddonLogging.jsm"); + Components.utils.import("resource://gre/modules/addons/AddonLogging.jsm"); LogManager.getLogger("addons.updates", this); return this[aName]; diff --git a/toolkit/mozapps/extensions/LightweightThemeImageOptimizer.jsm b/toolkit/mozapps/extensions/internal/LightweightThemeImageOptimizer.jsm similarity index 100% rename from toolkit/mozapps/extensions/LightweightThemeImageOptimizer.jsm rename to toolkit/mozapps/extensions/internal/LightweightThemeImageOptimizer.jsm diff --git a/toolkit/mozapps/extensions/PluginProvider.jsm b/toolkit/mozapps/extensions/internal/PluginProvider.jsm similarity index 99% rename from toolkit/mozapps/extensions/PluginProvider.jsm rename to toolkit/mozapps/extensions/internal/PluginProvider.jsm index b511ac2853c..ace38bcc806 100644 --- a/toolkit/mozapps/extensions/PluginProvider.jsm +++ b/toolkit/mozapps/extensions/internal/PluginProvider.jsm @@ -18,7 +18,7 @@ const LIST_UPDATED_TOPIC = "plugins-list-updated"; for (let name of ["LOG", "WARN", "ERROR"]) { this.__defineGetter__(name, function() { - Components.utils.import("resource://gre/modules/AddonLogging.jsm"); + Components.utils.import("resource://gre/modules/addons/AddonLogging.jsm"); LogManager.getLogger("addons.plugins", this); return this[name]; diff --git a/toolkit/mozapps/extensions/SpellCheckDictionaryBootstrap.js b/toolkit/mozapps/extensions/internal/SpellCheckDictionaryBootstrap.js similarity index 100% rename from toolkit/mozapps/extensions/SpellCheckDictionaryBootstrap.js rename to toolkit/mozapps/extensions/internal/SpellCheckDictionaryBootstrap.js diff --git a/toolkit/mozapps/extensions/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm similarity index 99% rename from toolkit/mozapps/extensions/XPIProvider.jsm rename to toolkit/mozapps/extensions/internal/XPIProvider.jsm index 5e57de0c2a4..778f3c25569 100644 --- a/toolkit/mozapps/extensions/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm @@ -16,7 +16,7 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/AddonManager.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository", - "resource://gre/modules/AddonRepository.jsm"); + "resource://gre/modules/addons/AddonRepository.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "ChromeManifestParser", "resource://gre/modules/ChromeManifestParser.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager", @@ -195,7 +195,7 @@ var gIDTest = /^(\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\ ["LOG", "WARN", "ERROR"].forEach(function(aName) { Object.defineProperty(this, aName, { get: function logFuncGetter() { - Components.utils.import("resource://gre/modules/AddonLogging.jsm"); + Components.utils.import("resource://gre/modules/addons/AddonLogging.jsm"); LogManager.getLogger("addons.xpi", this); return this[aName]; @@ -213,7 +213,7 @@ function loadLazyObjects() { let scope = {}; scope.AddonInternal = AddonInternal; scope.XPIProvider = XPIProvider; - Services.scriptloader.loadSubScript("resource://gre/modules/XPIProviderUtils.js", + Services.scriptloader.loadSubScript("resource://gre/modules/addons/XPIProviderUtils.js", scope); for (let name of LAZY_OBJECTS) { @@ -4232,7 +4232,7 @@ var XPIProvider = { // sandbox with the latest JS version set explicitly. if (aType == "dictionary") { this.bootstrapScopes[aId].__SCRIPT_URI_SPEC__ = - "resource://gre/modules/SpellCheckDictionaryBootstrap.js" + "resource://gre/modules/addons/SpellCheckDictionaryBootstrap.js" } else { this.bootstrapScopes[aId].__SCRIPT_URI_SPEC__ = uri; } @@ -5913,7 +5913,7 @@ function UpdateChecker(aAddon, aListener, aReason, aAppVersion, aPlatformVersion if (!aListener || !aReason) throw Cr.NS_ERROR_INVALID_ARG; - Components.utils.import("resource://gre/modules/AddonUpdateChecker.jsm"); + Components.utils.import("resource://gre/modules/addons/AddonUpdateChecker.jsm"); this.addon = aAddon; aAddon._updateCheck = this; diff --git a/toolkit/mozapps/extensions/XPIProviderUtils.js b/toolkit/mozapps/extensions/internal/XPIProviderUtils.js similarity index 99% rename from toolkit/mozapps/extensions/XPIProviderUtils.js rename to toolkit/mozapps/extensions/internal/XPIProviderUtils.js index 25288a1ea30..835507b8de1 100644 --- a/toolkit/mozapps/extensions/XPIProviderUtils.js +++ b/toolkit/mozapps/extensions/internal/XPIProviderUtils.js @@ -14,7 +14,7 @@ Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/AddonManager.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository", - "resource://gre/modules/AddonRepository.jsm"); + "resource://gre/modules/addons/AddonRepository.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "FileUtils", "resource://gre/modules/FileUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "DeferredSave", @@ -27,7 +27,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "OS", ["LOG", "WARN", "ERROR"].forEach(function(aName) { Object.defineProperty(this, aName, { get: function logFuncGetter () { - Cu.import("resource://gre/modules/AddonLogging.jsm"); + Cu.import("resource://gre/modules/addons/AddonLogging.jsm"); LogManager.getLogger("addons.xpi-utils", this); return this[aName]; diff --git a/toolkit/mozapps/extensions/internal/moz.build b/toolkit/mozapps/extensions/internal/moz.build new file mode 100644 index 00000000000..2f741a4c854 --- /dev/null +++ b/toolkit/mozapps/extensions/internal/moz.build @@ -0,0 +1,30 @@ +# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +JS_MODULES_PATH = 'modules/addons' + +EXTRA_JS_MODULES += [ + 'AddonLogging.jsm', + 'AddonRepository.jsm', + 'AddonRepository_SQLiteMigrator.jsm', + 'AddonUpdateChecker.jsm', + 'LightweightThemeImageOptimizer.jsm', + 'PluginProvider.jsm', + 'SpellCheckDictionaryBootstrap.js', +] + +EXTRA_PP_JS_MODULES += [ + 'XPIProvider.jsm', + 'XPIProviderUtils.js', +] + +# This is used in multiple places, so is defined here to avoid it getting +# out of sync. +DEFINES['MOZ_EXTENSIONS_DB_SCHEMA'] = 16 + +# Additional debugging info is exposed in debug builds +if CONFIG['MOZ_EM_DEBUG']: + DEFINES['MOZ_EM_DEBUG'] = 1 diff --git a/toolkit/mozapps/extensions/moz.build b/toolkit/mozapps/extensions/moz.build index e3a8139f8d2..e724af14a30 100644 --- a/toolkit/mozapps/extensions/moz.build +++ b/toolkit/mozapps/extensions/moz.build @@ -4,6 +4,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +DIRS += ['internal'] TEST_DIRS += ['test'] XPIDL_SOURCES += [ @@ -27,31 +28,18 @@ EXTRA_PP_COMPONENTS += [ ] EXTRA_JS_MODULES += [ - 'AddonLogging.jsm', - 'AddonRepository.jsm', - 'AddonRepository_SQLiteMigrator.jsm', - 'AddonUpdateChecker.jsm', 'ChromeManifestParser.jsm', 'DeferredSave.jsm', - 'LightweightThemeImageOptimizer.jsm', 'LightweightThemeManager.jsm', - 'PluginProvider.jsm', - 'SpellCheckDictionaryBootstrap.js', ] EXTRA_PP_JS_MODULES += [ - 'AddonManager.jsm', - 'XPIProvider.jsm', - 'XPIProviderUtils.js', + 'AddonManager.jsm' ] if CONFIG['MOZ_UPDATE_CHANNEL'] not in ('aurora', 'beta', 'release', 'esr'): DEFINES['MOZ_COMPATIBILITY_NIGHTLY'] = 1 -# This is used in multiple places, so is defined here to avoid it getting -# out of sync. -DEFINES['MOZ_EXTENSIONS_DB_SCHEMA'] = 16 - # Additional debugging info is exposed in debug builds if CONFIG['MOZ_EM_DEBUG']: DEFINES['MOZ_EM_DEBUG'] = 1 diff --git a/toolkit/mozapps/extensions/test/browser/browser_addonrepository_performance.js b/toolkit/mozapps/extensions/test/browser/browser_addonrepository_performance.js index 6ecf129c769..0ba3127cdd3 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_addonrepository_performance.js +++ b/toolkit/mozapps/extensions/test/browser/browser_addonrepository_performance.js @@ -5,7 +5,7 @@ // Tests that the metadata request includes startup time measurements let tmp = {}; -Components.utils.import("resource://gre/modules/AddonRepository.jsm", tmp); +Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm", tmp); let AddonRepository = tmp.AddonRepository; var gTelemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry); diff --git a/toolkit/mozapps/extensions/test/browser/browser_bug581076.js b/toolkit/mozapps/extensions/test/browser/browser_bug581076.js index 0d72c833567..4c25c409d72 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_bug581076.js +++ b/toolkit/mozapps/extensions/test/browser/browser_bug581076.js @@ -64,7 +64,7 @@ function check_allresultslink(aShouldShow) { is_element_visible(link, "All Results link should be visible"); is(link.value, "See all " + SEARCH_EXPECTED_TOTAL + " results", "All Results link should show the correct message"); var scope = {}; - Components.utils.import("resource://gre/modules/AddonRepository.jsm", scope); + Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm", scope); is(link.href, scope.AddonRepository.getSearchURL(SEARCH_QUERY), "All Results link should have the correct href"); } else { is_element_hidden(link, "All Results link should be hidden"); diff --git a/toolkit/mozapps/extensions/test/browser/browser_metadataTimeout.js b/toolkit/mozapps/extensions/test/browser/browser_metadataTimeout.js index 275140a8642..b1c436c53d5 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_metadataTimeout.js +++ b/toolkit/mozapps/extensions/test/browser/browser_metadataTimeout.js @@ -13,7 +13,7 @@ const PREF_MIN_PLATFORM_COMPAT = "extensions.minCompatiblePlatformVersion Components.utils.import("resource://gre/modules/Promise.jsm"); let repo = {}; -let ARContext = Components.utils.import("resource://gre/modules/AddonRepository.jsm", repo); +let ARContext = Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm", repo); info("ARContext: " + Object.keys(ARContext).join(", ")); // Mock out the XMLHttpRequest factory for AddonRepository so diff --git a/toolkit/mozapps/extensions/test/browser/browser_updatessl.js b/toolkit/mozapps/extensions/test/browser/browser_updatessl.js index 5fcd6f594bc..7a9149aa556 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_updatessl.js +++ b/toolkit/mozapps/extensions/test/browser/browser_updatessl.js @@ -3,7 +3,7 @@ */ let tempScope = {}; -Components.utils.import("resource://gre/modules/AddonUpdateChecker.jsm", tempScope); +Components.utils.import("resource://gre/modules/addons/AddonUpdateChecker.jsm", tempScope); let AddonUpdateChecker = tempScope.AddonUpdateChecker; const updaterdf = RELATIVE_DIR + "browser_updatessl.rdf"; diff --git a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js index b4ff46e98e8..7df61186fcd 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js +++ b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js @@ -18,7 +18,7 @@ const PREF_GETADDONS_BYIDS_PERFORMANCE = "extensions.getAddons.getWithPerforma // Forcibly end the test if it runs longer than 15 minutes const TIMEOUT_MS = 900000; -Components.utils.import("resource://gre/modules/AddonRepository.jsm"); +Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm"); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/FileUtils.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); @@ -445,13 +445,13 @@ function shutdownManager() { // Force the XPIProvider provider to reload to better // simulate real-world usage. - let XPIscope = Components.utils.import("resource://gre/modules/XPIProvider.jsm"); + let XPIscope = Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm"); // This would be cleaner if I could get it as the rejection reason from // the AddonManagerInternal.shutdown() promise gXPISaveError = XPIscope.XPIProvider._shutdownError; do_print("gXPISaveError set to: " + gXPISaveError); AddonManagerPrivate.unregisterProvider(XPIscope.XPIProvider); - Components.utils.unload("resource://gre/modules/XPIProvider.jsm"); + Components.utils.unload("resource://gre/modules/addons/XPIProvider.jsm"); } function loadAddonsList() { diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository.js b/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository.js index 6b646cd1380..d7a694ac0ff 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository.js @@ -4,7 +4,7 @@ // Tests AddonRepository.jsm -Components.utils.import("resource://gre/modules/AddonRepository.jsm"); +Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm"); Components.utils.import("resource://testing-common/httpd.js"); var gServer = new HttpServer(); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js b/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js index 439d368bb6e..1a6380e60ca 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js @@ -4,7 +4,7 @@ // Tests caching in AddonRepository.jsm -Components.utils.import("resource://gre/modules/AddonRepository.jsm"); +Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm"); Components.utils.import("resource://testing-common/httpd.js"); let gServer; diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_XPIcancel.js b/toolkit/mozapps/extensions/test/xpcshell/test_XPIcancel.js index 99aa9422cbe..7d8778301e9 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_XPIcancel.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_XPIcancel.js @@ -4,7 +4,7 @@ // Test the cancellable doing/done/cancelAll API in XPIProvider -let scope = Components.utils.import("resource://gre/modules/XPIProvider.jsm"); +let scope = Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm"); let XPIProvider = scope.XPIProvider; function run_test() { diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_bug424262.js b/toolkit/mozapps/extensions/test/xpcshell/test_bug424262.js index 8bda5652dcd..8b29e15a5e2 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_bug424262.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug424262.js @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -Components.utils.import("resource://gre/modules/AddonRepository.jsm"); +Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm"); const PREF_GETADDONS_GETRECOMMENDED = "extensions.getAddons.recommended.url"; diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_bug554133.js b/toolkit/mozapps/extensions/test/xpcshell/test_bug554133.js index dca1b8b9fe4..c252e1cedfb 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_bug554133.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug554133.js @@ -5,7 +5,7 @@ // This verifies that if the AMO response provides total_results, // searchSucceeded is called with the correct number of total results -Components.utils.import("resource://gre/modules/AddonRepository.jsm"); +Components.utils.import("resource://gre/modules/addons/AddonRepository.jsm"); const PREF_GETADDONS_GETSEARCHRESULTS = "extensions.getAddons.search.url"; diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_no_addons.js b/toolkit/mozapps/extensions/test/xpcshell/test_no_addons.js index 512523df48d..ae75fbb438d 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_no_addons.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_no_addons.js @@ -8,7 +8,7 @@ Components.utils.import("resource://gre/modules/Promise.jsm"); // Load XPI Provider to get schema version ID -let XPIScope = Components.utils.import("resource://gre/modules/XPIProvider.jsm"); +let XPIScope = Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm"); const DB_SCHEMA = XPIScope.DB_SCHEMA; createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2"); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_pluginchange.js b/toolkit/mozapps/extensions/test/xpcshell/test_pluginchange.js index ba24e92e019..b489b49dde7 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_pluginchange.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_pluginchange.js @@ -5,7 +5,7 @@ const LIST_UPDATED_TOPIC = "plugins-list-updated"; // We need to use the same algorithm for generating IDs for plugins -var { getIDHashForString } = Components.utils.import("resource://gre/modules/PluginProvider.jsm"); +var { getIDHashForString } = Components.utils.import("resource://gre/modules/addons/PluginProvider.jsm"); function PluginTag(name, description) { this.name = name; diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_syncGUID.js b/toolkit/mozapps/extensions/test/xpcshell/test_syncGUID.js index f57fa4d22d3..f1d6e09149a 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_syncGUID.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_syncGUID.js @@ -7,7 +7,7 @@ Components.utils.import("resource://gre/modules/Services.jsm"); // restartManager() mucks with XPIProvider.jsm importing, so we hack around. this.__defineGetter__("XPIProvider", function () { let scope = {}; - return Components.utils.import("resource://gre/modules/XPIProvider.jsm", scope) + return Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm", scope) .XPIProvider; }); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_updatecheck.js b/toolkit/mozapps/extensions/test/xpcshell/test_updatecheck.js index a2abfcaece7..d2e15103ba8 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_updatecheck.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_updatecheck.js @@ -4,7 +4,7 @@ // This verifies that AddonUpdateChecker works correctly -Components.utils.import("resource://gre/modules/AddonUpdateChecker.jsm"); +Components.utils.import("resource://gre/modules/addons/AddonUpdateChecker.jsm"); Components.utils.import("resource://testing-common/httpd.js"); var testserver;