зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1524688: Part 9 - Convert AddonManager components to static registration. r=aswan
--HG-- rename : toolkit/mozapps/extensions/amContentHandler.js => toolkit/mozapps/extensions/amContentHandler.jsm rename : toolkit/mozapps/extensions/amInstallTrigger.js => toolkit/mozapps/extensions/amInstallTrigger.jsm rename : toolkit/mozapps/extensions/amWebAPI.js => toolkit/mozapps/extensions/amWebAPI.jsm extra : source : 4fb0f0a59fe22e150f1217d5558fed909f98259a
This commit is contained in:
Родитель
da054397cd
Коммит
64a55fa4a5
|
@ -219,10 +219,6 @@
|
||||||
@RESPATH@/components/NetworkGeolocationProvider.manifest
|
@RESPATH@/components/NetworkGeolocationProvider.manifest
|
||||||
@RESPATH@/components/NetworkGeolocationProvider.js
|
@RESPATH@/components/NetworkGeolocationProvider.js
|
||||||
@RESPATH@/components/extensions.manifest
|
@RESPATH@/components/extensions.manifest
|
||||||
@RESPATH@/components/addonManager.js
|
|
||||||
@RESPATH@/components/amContentHandler.js
|
|
||||||
@RESPATH@/components/amInstallTrigger.js
|
|
||||||
@RESPATH@/components/amWebAPI.js
|
|
||||||
#ifdef MOZ_UPDATER
|
#ifdef MOZ_UPDATER
|
||||||
@RESPATH@/components/nsUpdateService.manifest
|
@RESPATH@/components/nsUpdateService.manifest
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -137,7 +137,6 @@
|
||||||
@BINPATH@/components/NetworkGeolocationProvider.js
|
@BINPATH@/components/NetworkGeolocationProvider.js
|
||||||
|
|
||||||
@BINPATH@/components/extensions.manifest
|
@BINPATH@/components/extensions.manifest
|
||||||
@BINPATH@/components/addonManager.js
|
|
||||||
|
|
||||||
#ifndef MOZ_GECKOVIEW_JAR
|
#ifndef MOZ_GECKOVIEW_JAR
|
||||||
@BINPATH@/components/utils.manifest
|
@BINPATH@/components/utils.manifest
|
||||||
|
|
|
@ -34,7 +34,6 @@ const MSG_ADDON_EVENT = "WebAPIAddonEvent";
|
||||||
|
|
||||||
const CHILD_SCRIPT = "resource://gre/modules/addons/Content.js";
|
const CHILD_SCRIPT = "resource://gre/modules/addons/Content.js";
|
||||||
|
|
||||||
const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
||||||
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||||
|
|
||||||
var gSingleton = null;
|
var gSingleton = null;
|
||||||
|
@ -332,4 +331,5 @@ BlocklistService.prototype = {
|
||||||
Ci.nsITimerCallback]),
|
Ci.nsITimerCallback]),
|
||||||
};
|
};
|
||||||
|
|
||||||
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([amManager, BlocklistService]);
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
var EXPORTED_SYMBOLS = ["amManager", "BlocklistService"];
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
const XPI_CONTENT_TYPE = "application/x-xpinstall";
|
const XPI_CONTENT_TYPE = "application/x-xpinstall";
|
||||||
const MSG_INSTALL_ADDON = "WebInstallerInstallAddonFromWebpage";
|
const MSG_INSTALL_ADDON = "WebInstallerInstallAddonFromWebpage";
|
||||||
|
|
||||||
const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
||||||
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||||
|
|
||||||
function amContentHandler() {
|
function amContentHandler() {
|
||||||
|
@ -101,4 +100,4 @@ amContentHandler.prototype = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([amContentHandler]);
|
var EXPORTED_SYMBOLS = ["amContentHandler"];
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
||||||
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||||
const {Preferences} = ChromeUtils.import("resource://gre/modules/Preferences.jsm");
|
const {Preferences} = ChromeUtils.import("resource://gre/modules/Preferences.jsm");
|
||||||
const {Log} = ChromeUtils.import("resource://gre/modules/Log.jsm");
|
const {Log} = ChromeUtils.import("resource://gre/modules/Log.jsm");
|
||||||
|
@ -150,7 +149,7 @@ InstallTrigger.prototype = {
|
||||||
item = { URL: item };
|
item = { URL: item };
|
||||||
}
|
}
|
||||||
if (!item.URL) {
|
if (!item.URL) {
|
||||||
throw new this._window.Error("Missing URL property for '" + name + "'");
|
throw new this._window.Error("Missing URL property for '" + keys[0] + "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
let url = this._resolveURL(item.URL);
|
let url = this._resolveURL(item.URL);
|
||||||
|
@ -221,6 +220,4 @@ InstallTrigger.prototype = {
|
||||||
QueryInterface: ChromeUtils.generateQI([Ci.nsIDOMGlobalPropertyInitializer]),
|
QueryInterface: ChromeUtils.generateQI([Ci.nsIDOMGlobalPropertyInitializer]),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var EXPORTED_SYMBOLS = ["InstallTrigger"];
|
||||||
|
|
||||||
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([InstallTrigger]);
|
|
|
@ -270,4 +270,4 @@ class WebAPI extends APIObject {
|
||||||
}
|
}
|
||||||
WebAPI.prototype.QueryInterface = ChromeUtils.generateQI(["nsIDOMGlobalPropertyInitializer"]);
|
WebAPI.prototype.QueryInterface = ChromeUtils.generateQI(["nsIDOMGlobalPropertyInitializer"]);
|
||||||
WebAPI.prototype.classID = Components.ID("{8866d8e3-4ea5-48b7-a891-13ba0ac15235}");
|
WebAPI.prototype.classID = Components.ID("{8866d8e3-4ea5-48b7-a891-13ba0ac15235}");
|
||||||
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WebAPI]);
|
var EXPORTED_SYMBOLS = ["WebAPI"];
|
|
@ -0,0 +1,42 @@
|
||||||
|
# -*- Mode: python; 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/.
|
||||||
|
|
||||||
|
Classes = [
|
||||||
|
{
|
||||||
|
'cid': '{66354bc9-7ed1-4692-ae1d-8da97d6b205e}',
|
||||||
|
'contract_ids': ['@mozilla.org/extensions/blocklist;1'],
|
||||||
|
'jsm': 'resource://gre/modules/addonManager.js',
|
||||||
|
'constructor': 'BlocklistService',
|
||||||
|
'processes': ProcessSelector.MAIN_PROCESS_ONLY,
|
||||||
|
'categories': ({'profile-after-change': 'nsBlocklistService'}
|
||||||
|
if buildconfig.substs['MOZ_BUILD_APP'] == 'browser'
|
||||||
|
else {}),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'cid': '{4399533d-08d1-458c-a87a-235f74451cfa}',
|
||||||
|
'contract_ids': ['@mozilla.org/addons/integration;1'],
|
||||||
|
'jsm': 'resource://gre/modules/addonManager.js',
|
||||||
|
'constructor': 'amManager',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'cid': '{7beb3ba8-6ec3-41b4-b67c-da89b8518922}',
|
||||||
|
'contract_ids': ['@mozilla.org/uriloader/content-handler;1?type=application/x-xpinstall'],
|
||||||
|
'jsm': 'resource://gre/modules/amContentHandler.jsm',
|
||||||
|
'constructor': 'amContentHandler',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'cid': '{9df8ef2b-94da-45c9-ab9f-132eb55fddf1}',
|
||||||
|
'contract_ids': ['@mozilla.org/addons/installtrigger;1'],
|
||||||
|
'jsm': 'resource://gre/modules/amInstallTrigger.jsm',
|
||||||
|
'constructor': 'InstallTrigger',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'cid': '{8866d8e3-4ea5-48b7-a891-13ba0ac15235}',
|
||||||
|
'contract_ids': ['@mozilla.org/addon-web-api/manager;1'],
|
||||||
|
'jsm': 'resource://gre/modules/amWebAPI.jsm',
|
||||||
|
'constructor': 'WebAPI',
|
||||||
|
},
|
||||||
|
]
|
|
@ -1,22 +1,8 @@
|
||||||
component {66354bc9-7ed1-4692-ae1d-8da97d6b205e} addonManager.js process=main
|
|
||||||
contract @mozilla.org/extensions/blocklist;1 {66354bc9-7ed1-4692-ae1d-8da97d6b205e} process=main
|
|
||||||
#ifndef MOZ_BUILD_APP_IS_BROWSER
|
|
||||||
category profile-after-change nsBlocklistService @mozilla.org/extensions/blocklist;1 process=main
|
|
||||||
#endif
|
|
||||||
|
|
||||||
category update-timer nsBlocklistService @mozilla.org/extensions/blocklist;1,getService,blocklist-background-update-timer,extensions.blocklist.interval,86400
|
category update-timer nsBlocklistService @mozilla.org/extensions/blocklist;1,getService,blocklist-background-update-timer,extensions.blocklist.interval,86400
|
||||||
component {4399533d-08d1-458c-a87a-235f74451cfa} addonManager.js
|
|
||||||
contract @mozilla.org/addons/integration;1 {4399533d-08d1-458c-a87a-235f74451cfa}
|
|
||||||
#ifndef MOZ_WIDGET_ANDROID
|
#ifndef MOZ_WIDGET_ANDROID
|
||||||
category update-timer addonManager @mozilla.org/addons/integration;1,getService,addon-background-update-timer,extensions.update.interval,86400
|
category update-timer addonManager @mozilla.org/addons/integration;1,getService,addon-background-update-timer,extensions.update.interval,86400
|
||||||
#endif
|
#endif
|
||||||
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 {9df8ef2b-94da-45c9-ab9f-132eb55fddf1} amInstallTrigger.js
|
|
||||||
contract @mozilla.org/addons/installtrigger;1 {9df8ef2b-94da-45c9-ab9f-132eb55fddf1}
|
|
||||||
#ifndef MOZ_WIDGET_ANDROID
|
#ifndef MOZ_WIDGET_ANDROID
|
||||||
category addon-provider-module PluginProvider resource://gre/modules/addons/PluginProvider.jsm
|
category addon-provider-module PluginProvider resource://gre/modules/addons/PluginProvider.jsm
|
||||||
#endif
|
#endif
|
||||||
category addon-provider-module GMPProvider resource://gre/modules/addons/GMPProvider.jsm
|
category addon-provider-module GMPProvider resource://gre/modules/addons/GMPProvider.jsm
|
||||||
component {8866d8e3-4ea5-48b7-a891-13ba0ac15235} amWebAPI.js
|
|
||||||
contract @mozilla.org/addon-web-api/manager;1 {8866d8e3-4ea5-48b7-a891-13ba0ac15235}
|
|
||||||
|
|
|
@ -43,19 +43,16 @@ elif CONFIG['MOZ_BUILD_APP'] == 'mobile/android':
|
||||||
'!%s' % built_in_addons,
|
'!%s' % built_in_addons,
|
||||||
]
|
]
|
||||||
|
|
||||||
EXTRA_COMPONENTS += [
|
|
||||||
'addonManager.js',
|
|
||||||
'amContentHandler.js',
|
|
||||||
'amInstallTrigger.js',
|
|
||||||
'amWebAPI.js',
|
|
||||||
]
|
|
||||||
|
|
||||||
EXTRA_PP_COMPONENTS += [
|
EXTRA_PP_COMPONENTS += [
|
||||||
'extensions.manifest',
|
'extensions.manifest',
|
||||||
]
|
]
|
||||||
|
|
||||||
EXTRA_JS_MODULES += [
|
EXTRA_JS_MODULES += [
|
||||||
|
'addonManager.js',
|
||||||
'AddonManager.jsm',
|
'AddonManager.jsm',
|
||||||
|
'amContentHandler.jsm',
|
||||||
|
'amInstallTrigger.jsm',
|
||||||
|
'amWebAPI.jsm',
|
||||||
'Blocklist.jsm',
|
'Blocklist.jsm',
|
||||||
'LightweightThemeManager.jsm',
|
'LightweightThemeManager.jsm',
|
||||||
]
|
]
|
||||||
|
@ -74,6 +71,10 @@ UNIFIED_SOURCES += [
|
||||||
'AddonManagerWebAPI.cpp',
|
'AddonManagerWebAPI.cpp',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
XPCOM_MANIFESTS += [
|
||||||
|
'components.conf',
|
||||||
|
]
|
||||||
|
|
||||||
LOCAL_INCLUDES += [
|
LOCAL_INCLUDES += [
|
||||||
'/chrome',
|
'/chrome',
|
||||||
'/dom/base',
|
'/dom/base',
|
||||||
|
|
Загрузка…
Ссылка в новой задаче