Bug 454546: Update EM and blocklist service to be initialised on profile-after-change. r=robstrong, a1.9.1=beltzner

This commit is contained in:
Dave Townsend 2008-11-28 12:49:48 -08:00
parent 2e0942e854
commit 2dce35049b
4 changed files with 3 additions and 24 deletions

View File

@ -382,10 +382,6 @@ Blocklist.prototype = {
observe: function (aSubject, aTopic, aData) {
switch (aTopic) {
case "app-startup":
gOS.addObserver(this, "profile-after-change", false);
gOS.addObserver(this, "quit-application", false);
break;
case "profile-after-change":
gLoggingEnabled = getPref("getBoolPref", PREF_EM_LOGGING_ENABLED, false);
gBlocklistEnabled = getPref("getBoolPref", PREF_BLOCKLIST_ENABLED, true);
@ -397,14 +393,10 @@ Blocklist.prototype = {
var interval = getPref("getIntPref", PREF_BLOCKLIST_INTERVAL, 86400);
tm.registerTimer("blocklist-background-update-timer", this, interval);
break;
case "quit-application":
gOS.removeObserver(this, "profile-after-change");
gOS.removeObserver(this, "quit-application");
gPref.removeObserver("extensions.blocklist.", this);
break;
case "xpcom-shutdown":
gOS.removeObserver(this, "xpcom-shutdown");
gOS = null;
gPref.removeObserver("extensions.blocklist.", this);
gPref = null;
gConsole = null;
gVersionChecker = null;
@ -927,10 +919,7 @@ Blocklist.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsIBlocklistService,
Ci.nsITimerCallback]),
_xpcom_categories: [{
category: "app-startup",
service: true
}]
_xpcom_categories: [{ category: "profile-after-change" }]
};
/**

View File

@ -2519,10 +2519,6 @@ ExtensionManager.prototype = {
*/
observe: function EM_observe(subject, topic, data) {
switch (topic) {
case "app-startup":
gOS.addObserver(this, "profile-after-change", false);
gOS.addObserver(this, "quit-application", false);
break;
case "profile-after-change":
this._profileSelected();
break;
@ -2532,10 +2528,6 @@ ExtensionManager.prototype = {
case "offline-requested":
this._confirmCancelDownloadsOnOffline(subject);
break;
case "quit-application":
gOS.removeObserver(this, "profile-after-change");
gOS.removeObserver(this, "quit-application");
break;
case "xpcom-shutdown":
this._shutdown();
break;
@ -5961,7 +5953,7 @@ ExtensionManager.prototype = {
classDescription: "Extension Manager",
contractID: "@mozilla.org/extensions/manager;1",
classID: Components.ID("{8A115FAA-7DCB-4e8f-979B-5F53472F51CF}"),
_xpcom_categories: [{ category: "app-startup", service: true }],
_xpcom_categories: [{ category: "profile-after-change" }],
_xpcom_factory: {
createInstance: function(outer, iid) {
if (outer != null)

View File

@ -216,7 +216,6 @@ function startupEM()
.getService(Components.interfaces.nsIExtensionManager);
gEM.QueryInterface(Components.interfaces.nsIObserver);
gEM.observe(null, "app-startup", null);
gEM.observe(null, "profile-after-change", "startup");
// First run is a new profile which nsAppRunner would consider as an update

View File

@ -131,7 +131,6 @@ function run_test() {
gBlocklist = Components.classes["@mozilla.org/extensions/blocklist;1"]
.getService(Components.interfaces.nsIBlocklistService)
.QueryInterface(Components.interfaces.nsIObserver);
gBlocklist.observe(null, "app-startup", "");
gBlocklist.observe(null, "profile-after-change", "");
do_check_true(timerService.hasTimer(BLOCKLIST_TIMER));