Bug 952307 - Move some addon-private JSM's to a subdirectory. r=Unfocused

--HG--
rename : toolkit/mozapps/extensions/AddonLogging.jsm => toolkit/mozapps/extensions/internal/AddonLogging.jsm
rename : toolkit/mozapps/extensions/AddonRepository.jsm => toolkit/mozapps/extensions/internal/AddonRepository.jsm
rename : toolkit/mozapps/extensions/AddonRepository_SQLiteMigrator.jsm => toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm
rename : toolkit/mozapps/extensions/AddonUpdateChecker.jsm => toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm
rename : toolkit/mozapps/extensions/LightweightThemeImageOptimizer.jsm => toolkit/mozapps/extensions/internal/LightweightThemeImageOptimizer.jsm
rename : toolkit/mozapps/extensions/PluginProvider.jsm => toolkit/mozapps/extensions/internal/PluginProvider.jsm
rename : toolkit/mozapps/extensions/SpellCheckDictionaryBootstrap.js => toolkit/mozapps/extensions/internal/SpellCheckDictionaryBootstrap.js
rename : toolkit/mozapps/extensions/XPIProvider.jsm => toolkit/mozapps/extensions/internal/XPIProvider.jsm
rename : toolkit/mozapps/extensions/XPIProviderUtils.js => toolkit/mozapps/extensions/internal/XPIProviderUtils.js
This commit is contained in:
Alexander J. Vincent 2014-01-07 20:14:08 -08:00
parent baa78cbb12
commit 8d99d1aa31
40 changed files with 79 additions and 61 deletions

View File

@ -75,7 +75,7 @@ exports.getPreferedLocales = function getPreferedLocales() {
* If null, uses getPreferedLocales() results * If null, uses getPreferedLocales() results
* @return the best match for the currently selected locale * @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) { exports.findClosestLocale = function findClosestLocale(aLocales, aMatchLocales) {

View File

@ -16,7 +16,7 @@ def create_jid():
# and all) or in the form of an email address (crazy @ and all). # 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 # Firefox will refuse to install an add-on with an id that doesn't
# match one of these forms. The actual regexp is at: # 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 the JID needs an @-suffix, and the only legal punctuation is
# "-._". So we start with a base64 encoding, and replace the # "-._". So we start with a base64 encoding, and replace the
# punctuation (+/) with letters (AB), losing a few bits of integrity. # punctuation (+/) with letters (AB), losing a few bits of integrity.

View File

@ -13,7 +13,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
"resource://gre/modules/AddonManager.jsm"); "resource://gre/modules/AddonManager.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository", XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
"resource://gre/modules/AddonRepository.jsm"); "resource://gre/modules/addons/AddonRepository.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");

View File

@ -15,7 +15,7 @@ Cu.import("resource://services-sync/util.js");
XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
"resource://gre/modules/AddonManager.jsm"); "resource://gre/modules/AddonManager.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository", XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
"resource://gre/modules/AddonRepository.jsm"); "resource://gre/modules/addons/AddonRepository.jsm");
function AddonUtilsInternal() { function AddonUtilsInternal() {
this._log = Log.repository.getLogger("Sync.AddonUtils"); this._log = Log.repository.getLogger("Sync.AddonUtils");

View File

@ -48,7 +48,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
"resource://gre/modules/AddonManager.jsm"); "resource://gre/modules/AddonManager.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository", XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
"resource://gre/modules/AddonRepository.jsm"); "resource://gre/modules/addons/AddonRepository.jsm");
this.EXPORTED_SYMBOLS = ["AddonsEngine"]; this.EXPORTED_SYMBOLS = ["AddonsEngine"];

View File

@ -8,7 +8,7 @@ let EXPORTED_SYMBOLS = ["Addon", "STATE_ENABLED", "STATE_DISABLED"];
const {classes: Cc, interfaces: Ci, utils: Cu} = Components; const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/AddonManager.jsm"); 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://gre/modules/Services.jsm");
Cu.import("resource://services-common/async.js"); Cu.import("resource://services-common/async.js");
Cu.import("resource://services-sync/addonutils.js"); Cu.import("resource://services-sync/addonutils.js");

View File

@ -7,7 +7,7 @@ this.EXPORTED_SYMBOLS = ["LightweightThemeConsumer"];
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer", XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer",
"resource://gre/modules/LightweightThemeImageOptimizer.jsm"); "resource://gre/modules/addons/LightweightThemeImageOptimizer.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm"); "resource://gre/modules/PrivateBrowsingUtils.jsm");

View File

@ -64,7 +64,7 @@ Cu.import("resource://gre/modules/AsyncShutdown.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Promise", XPCOMUtils.defineLazyModuleGetter(this, "Promise",
"resource://gre/modules/Promise.jsm"); "resource://gre/modules/Promise.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository", XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
"resource://gre/modules/AddonRepository.jsm"); "resource://gre/modules/addons/AddonRepository.jsm");
XPCOMUtils.defineLazyGetter(this, "CertUtils", function certUtilsLazyGetter() { XPCOMUtils.defineLazyGetter(this, "CertUtils", function certUtilsLazyGetter() {
let certUtils = {}; let certUtils = {};
@ -79,13 +79,13 @@ const CATEGORY_PROVIDER_MODULE = "addon-provider-module";
// A list of providers to load by default // A list of providers to load by default
const DEFAULT_PROVIDERS = [ const DEFAULT_PROVIDERS = [
"resource://gre/modules/XPIProvider.jsm", "resource://gre/modules/addons/XPIProvider.jsm",
"resource://gre/modules/LightweightThemeManager.jsm" "resource://gre/modules/LightweightThemeManager.jsm"
]; ];
["LOG", "WARN", "ERROR"].forEach(function(aName) { ["LOG", "WARN", "ERROR"].forEach(function(aName) {
this.__defineGetter__(aName, function logFuncGetter() { 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); LogManager.getLogger("addons.manager", this);
return this[aName]; return this[aName];
@ -1072,7 +1072,7 @@ var AddonManagerInternal = {
}, url); }, url);
pendingUpdates++; pendingUpdates++;
Components.utils.import("resource://gre/modules/AddonUpdateChecker.jsm"); Components.utils.import("resource://gre/modules/addons/AddonUpdateChecker.jsm");
AddonUpdateChecker.checkForUpdates(hotfixID, null, url, { AddonUpdateChecker.checkForUpdates(hotfixID, null, url, {
onUpdateCheckComplete: function BUC_onUpdateCheckComplete(aUpdates) { onUpdateCheckComplete: function BUC_onUpdateCheckComplete(aUpdates) {
let update = AddonUpdateChecker.getNewestCompatibleUpdate(aUpdates); let update = AddonUpdateChecker.getNewestCompatibleUpdate(aUpdates);

View File

@ -44,7 +44,7 @@ const DEFAULT_SAVE_DELAY_MS = 50;
this.DeferredSave = function (aPath, aDataProvider, aDelay) { this.DeferredSave = function (aPath, aDataProvider, aDelay) {
// Set up loggers for this instance of DeferredSave // Set up loggers for this instance of DeferredSave
let leafName = OS.Path.basename(aPath); 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); LogManager.getLogger("DeferredSave/" + leafName, this);
// @type {Deferred|null}, null when no data needs to be written // @type {Deferred|null}, null when no data needs to be written

View File

@ -40,7 +40,7 @@ const PERSIST_FILES = {
}; };
XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer", XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer",
"resource://gre/modules/LightweightThemeImageOptimizer.jsm"); "resource://gre/modules/addons/LightweightThemeImageOptimizer.jsm");
this.__defineGetter__("_prefs", function prefsGetter() { this.__defineGetter__("_prefs", function prefsGetter() {
delete this._prefs; delete this._prefs;

View File

@ -31,7 +31,7 @@ const READY_STATES = [
["LOG", "WARN", "ERROR"].forEach(function(aName) { ["LOG", "WARN", "ERROR"].forEach(function(aName) {
this.__defineGetter__(aName, function logFuncGetter() { 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); LogManager.getLogger("addons.weblistener", this);
return this[aName]; return this[aName];

View File

@ -15,7 +15,7 @@ Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/PluralForm.jsm"); Cu.import("resource://gre/modules/PluralForm.jsm");
Cu.import("resource://gre/modules/DownloadUtils.jsm"); Cu.import("resource://gre/modules/DownloadUtils.jsm");
Cu.import("resource://gre/modules/AddonManager.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"; const PREF_DISCOVERURL = "extensions.webservice.discoverURL";

View File

@ -7,7 +7,7 @@
"use strict"; "use strict";
Components.utils.import("resource://gre/modules/AddonManager.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");
Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/Services.jsm");
const Cc = Components.classes; const Cc = Components.classes;

View File

@ -17,7 +17,7 @@ const METADATA_TIMEOUT = 30000;
Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/AddonManager.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; var gInteruptable = true;

View File

@ -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} contract @mozilla.org/uriloader/content-handler;1?type=application/x-xpinstall {7beb3ba8-6ec3-41b4-b67c-da89b8518922}
component {0f38e086-89a3-40a5-8ffc-9b694de1d04a} amWebInstallListener.js component {0f38e086-89a3-40a5-8ffc-9b694de1d04a} amWebInstallListener.js
contract @mozilla.org/addons/web-install-listener;1 {0f38e086-89a3-40a5-8ffc-9b694de1d04a} 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 #endif

View File

@ -22,7 +22,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "OS",
XPCOMUtils.defineLazyModuleGetter(this, "DeferredSave", XPCOMUtils.defineLazyModuleGetter(this, "DeferredSave",
"resource://gre/modules/DeferredSave.jsm"); "resource://gre/modules/DeferredSave.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository_SQLiteMigrator", XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository_SQLiteMigrator",
"resource://gre/modules/AddonRepository_SQLiteMigrator.jsm"); "resource://gre/modules/addons/AddonRepository_SQLiteMigrator.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Promise", XPCOMUtils.defineLazyModuleGetter(this, "Promise",
"resource://gre/modules/Promise.jsm"); "resource://gre/modules/Promise.jsm");
@ -63,7 +63,7 @@ const TOOLKIT_ID = "toolkit@mozilla.org";
["LOG", "WARN", "ERROR"].forEach(function(aName) { ["LOG", "WARN", "ERROR"].forEach(function(aName) {
this.__defineGetter__(aName, function logFuncGetter() { 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); LogManager.getLogger("addons.repository", this);
return this[aName]; return this[aName];

View File

@ -27,7 +27,7 @@ const PROP_SINGLE = ["id", "type", "name", "version", "creator", "description",
["LOG", "WARN", "ERROR"].forEach(function(aName) { ["LOG", "WARN", "ERROR"].forEach(function(aName) {
this.__defineGetter__(aName, function logFuncGetter() { 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); LogManager.getLogger("addons.repository.sqlmigrator", this);
return this[aName]; return this[aName];

View File

@ -32,7 +32,7 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
"resource://gre/modules/AddonManager.jsm"); "resource://gre/modules/AddonManager.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository", XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
"resource://gre/modules/AddonRepository.jsm"); "resource://gre/modules/addons/AddonRepository.jsm");
// Shared code for suppressing bad cert dialogs. // Shared code for suppressing bad cert dialogs.
XPCOMUtils.defineLazyGetter(this, "CertUtils", function certUtilsLazyGetter() { 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) { ["LOG", "WARN", "ERROR"].forEach(function(aName) {
this.__defineGetter__(aName, function logFuncGetter() { 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); LogManager.getLogger("addons.updates", this);
return this[aName]; return this[aName];

View File

@ -18,7 +18,7 @@ const LIST_UPDATED_TOPIC = "plugins-list-updated";
for (let name of ["LOG", "WARN", "ERROR"]) { for (let name of ["LOG", "WARN", "ERROR"]) {
this.__defineGetter__(name, function() { 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); LogManager.getLogger("addons.plugins", this);
return this[name]; return this[name];

View File

@ -16,7 +16,7 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/AddonManager.jsm"); Components.utils.import("resource://gre/modules/AddonManager.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository", XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
"resource://gre/modules/AddonRepository.jsm"); "resource://gre/modules/addons/AddonRepository.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ChromeManifestParser", XPCOMUtils.defineLazyModuleGetter(this, "ChromeManifestParser",
"resource://gre/modules/ChromeManifestParser.jsm"); "resource://gre/modules/ChromeManifestParser.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager", 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) { ["LOG", "WARN", "ERROR"].forEach(function(aName) {
Object.defineProperty(this, aName, { Object.defineProperty(this, aName, {
get: function logFuncGetter() { 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); LogManager.getLogger("addons.xpi", this);
return this[aName]; return this[aName];
@ -213,7 +213,7 @@ function loadLazyObjects() {
let scope = {}; let scope = {};
scope.AddonInternal = AddonInternal; scope.AddonInternal = AddonInternal;
scope.XPIProvider = XPIProvider; scope.XPIProvider = XPIProvider;
Services.scriptloader.loadSubScript("resource://gre/modules/XPIProviderUtils.js", Services.scriptloader.loadSubScript("resource://gre/modules/addons/XPIProviderUtils.js",
scope); scope);
for (let name of LAZY_OBJECTS) { for (let name of LAZY_OBJECTS) {
@ -4232,7 +4232,7 @@ var XPIProvider = {
// sandbox with the latest JS version set explicitly. // sandbox with the latest JS version set explicitly.
if (aType == "dictionary") { if (aType == "dictionary") {
this.bootstrapScopes[aId].__SCRIPT_URI_SPEC__ = this.bootstrapScopes[aId].__SCRIPT_URI_SPEC__ =
"resource://gre/modules/SpellCheckDictionaryBootstrap.js" "resource://gre/modules/addons/SpellCheckDictionaryBootstrap.js"
} else { } else {
this.bootstrapScopes[aId].__SCRIPT_URI_SPEC__ = uri; this.bootstrapScopes[aId].__SCRIPT_URI_SPEC__ = uri;
} }
@ -5913,7 +5913,7 @@ function UpdateChecker(aAddon, aListener, aReason, aAppVersion, aPlatformVersion
if (!aListener || !aReason) if (!aListener || !aReason)
throw Cr.NS_ERROR_INVALID_ARG; 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; this.addon = aAddon;
aAddon._updateCheck = this; aAddon._updateCheck = this;

View File

@ -14,7 +14,7 @@ Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/AddonManager.jsm"); Cu.import("resource://gre/modules/AddonManager.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository", XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
"resource://gre/modules/AddonRepository.jsm"); "resource://gre/modules/addons/AddonRepository.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "FileUtils", XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
"resource://gre/modules/FileUtils.jsm"); "resource://gre/modules/FileUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "DeferredSave", XPCOMUtils.defineLazyModuleGetter(this, "DeferredSave",
@ -27,7 +27,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "OS",
["LOG", "WARN", "ERROR"].forEach(function(aName) { ["LOG", "WARN", "ERROR"].forEach(function(aName) {
Object.defineProperty(this, aName, { Object.defineProperty(this, aName, {
get: function logFuncGetter () { get: function logFuncGetter () {
Cu.import("resource://gre/modules/AddonLogging.jsm"); Cu.import("resource://gre/modules/addons/AddonLogging.jsm");
LogManager.getLogger("addons.xpi-utils", this); LogManager.getLogger("addons.xpi-utils", this);
return this[aName]; return this[aName];

View File

@ -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

View File

@ -4,6 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIRS += ['internal']
TEST_DIRS += ['test'] TEST_DIRS += ['test']
XPIDL_SOURCES += [ XPIDL_SOURCES += [
@ -27,31 +28,18 @@ EXTRA_PP_COMPONENTS += [
] ]
EXTRA_JS_MODULES += [ EXTRA_JS_MODULES += [
'AddonLogging.jsm',
'AddonRepository.jsm',
'AddonRepository_SQLiteMigrator.jsm',
'AddonUpdateChecker.jsm',
'ChromeManifestParser.jsm', 'ChromeManifestParser.jsm',
'DeferredSave.jsm', 'DeferredSave.jsm',
'LightweightThemeImageOptimizer.jsm',
'LightweightThemeManager.jsm', 'LightweightThemeManager.jsm',
'PluginProvider.jsm',
'SpellCheckDictionaryBootstrap.js',
] ]
EXTRA_PP_JS_MODULES += [ EXTRA_PP_JS_MODULES += [
'AddonManager.jsm', 'AddonManager.jsm'
'XPIProvider.jsm',
'XPIProviderUtils.js',
] ]
if CONFIG['MOZ_UPDATE_CHANNEL'] not in ('aurora', 'beta', 'release', 'esr'): if CONFIG['MOZ_UPDATE_CHANNEL'] not in ('aurora', 'beta', 'release', 'esr'):
DEFINES['MOZ_COMPATIBILITY_NIGHTLY'] = 1 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 # Additional debugging info is exposed in debug builds
if CONFIG['MOZ_EM_DEBUG']: if CONFIG['MOZ_EM_DEBUG']:
DEFINES['MOZ_EM_DEBUG'] = 1 DEFINES['MOZ_EM_DEBUG'] = 1

View File

@ -5,7 +5,7 @@
// Tests that the metadata request includes startup time measurements // Tests that the metadata request includes startup time measurements
let tmp = {}; 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; let AddonRepository = tmp.AddonRepository;
var gTelemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry); var gTelemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);

View File

@ -64,7 +64,7 @@ function check_allresultslink(aShouldShow) {
is_element_visible(link, "All Results link should be visible"); 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"); is(link.value, "See all " + SEARCH_EXPECTED_TOTAL + " results", "All Results link should show the correct message");
var scope = {}; 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"); is(link.href, scope.AddonRepository.getSearchURL(SEARCH_QUERY), "All Results link should have the correct href");
} else { } else {
is_element_hidden(link, "All Results link should be hidden"); is_element_hidden(link, "All Results link should be hidden");

View File

@ -13,7 +13,7 @@ const PREF_MIN_PLATFORM_COMPAT = "extensions.minCompatiblePlatformVersion
Components.utils.import("resource://gre/modules/Promise.jsm"); Components.utils.import("resource://gre/modules/Promise.jsm");
let repo = {}; 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(", ")); info("ARContext: " + Object.keys(ARContext).join(", "));
// Mock out the XMLHttpRequest factory for AddonRepository so // Mock out the XMLHttpRequest factory for AddonRepository so

View File

@ -3,7 +3,7 @@
*/ */
let tempScope = {}; 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; let AddonUpdateChecker = tempScope.AddonUpdateChecker;
const updaterdf = RELATIVE_DIR + "browser_updatessl.rdf"; const updaterdf = RELATIVE_DIR + "browser_updatessl.rdf";

View File

@ -18,7 +18,7 @@ const PREF_GETADDONS_BYIDS_PERFORMANCE = "extensions.getAddons.getWithPerforma
// Forcibly end the test if it runs longer than 15 minutes // Forcibly end the test if it runs longer than 15 minutes
const TIMEOUT_MS = 900000; 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/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/FileUtils.jsm"); Components.utils.import("resource://gre/modules/FileUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/Services.jsm");
@ -445,13 +445,13 @@ function shutdownManager() {
// Force the XPIProvider provider to reload to better // Force the XPIProvider provider to reload to better
// simulate real-world usage. // 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 // This would be cleaner if I could get it as the rejection reason from
// the AddonManagerInternal.shutdown() promise // the AddonManagerInternal.shutdown() promise
gXPISaveError = XPIscope.XPIProvider._shutdownError; gXPISaveError = XPIscope.XPIProvider._shutdownError;
do_print("gXPISaveError set to: " + gXPISaveError); do_print("gXPISaveError set to: " + gXPISaveError);
AddonManagerPrivate.unregisterProvider(XPIscope.XPIProvider); AddonManagerPrivate.unregisterProvider(XPIscope.XPIProvider);
Components.utils.unload("resource://gre/modules/XPIProvider.jsm"); Components.utils.unload("resource://gre/modules/addons/XPIProvider.jsm");
} }
function loadAddonsList() { function loadAddonsList() {

View File

@ -4,7 +4,7 @@
// Tests AddonRepository.jsm // 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"); Components.utils.import("resource://testing-common/httpd.js");
var gServer = new HttpServer(); var gServer = new HttpServer();

View File

@ -4,7 +4,7 @@
// Tests caching in AddonRepository.jsm // 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"); Components.utils.import("resource://testing-common/httpd.js");
let gServer; let gServer;

View File

@ -4,7 +4,7 @@
// Test the cancellable doing/done/cancelAll API in XPIProvider // 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; let XPIProvider = scope.XPIProvider;
function run_test() { function run_test() {

View File

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. * 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"; const PREF_GETADDONS_GETRECOMMENDED = "extensions.getAddons.recommended.url";

View File

@ -5,7 +5,7 @@
// This verifies that if the AMO response provides total_results, // This verifies that if the AMO response provides total_results,
// searchSucceeded is called with the correct number of 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"; const PREF_GETADDONS_GETSEARCHRESULTS = "extensions.getAddons.search.url";

View File

@ -8,7 +8,7 @@
Components.utils.import("resource://gre/modules/Promise.jsm"); Components.utils.import("resource://gre/modules/Promise.jsm");
// Load XPI Provider to get schema version ID // 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; const DB_SCHEMA = XPIScope.DB_SCHEMA;
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2"); createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");

View File

@ -5,7 +5,7 @@
const LIST_UPDATED_TOPIC = "plugins-list-updated"; const LIST_UPDATED_TOPIC = "plugins-list-updated";
// We need to use the same algorithm for generating IDs for plugins // 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) { function PluginTag(name, description) {
this.name = name; this.name = name;

View File

@ -7,7 +7,7 @@ Components.utils.import("resource://gre/modules/Services.jsm");
// restartManager() mucks with XPIProvider.jsm importing, so we hack around. // restartManager() mucks with XPIProvider.jsm importing, so we hack around.
this.__defineGetter__("XPIProvider", function () { this.__defineGetter__("XPIProvider", function () {
let scope = {}; let scope = {};
return Components.utils.import("resource://gre/modules/XPIProvider.jsm", scope) return Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm", scope)
.XPIProvider; .XPIProvider;
}); });

View File

@ -4,7 +4,7 @@
// This verifies that AddonUpdateChecker works correctly // 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"); Components.utils.import("resource://testing-common/httpd.js");
var testserver; var testserver;