Index: lib/contentPolicy.js |
=================================================================== |
--- a/lib/contentPolicy.js |
+++ b/lib/contentPolicy.js |
@@ -376,32 +376,17 @@ var PolicyImplementation = |
xpcom_categories: ["content-policy", "net-channel-event-sinks"], |
/** |
* Registers the content policy on startup. |
*/ |
init: function() |
{ |
let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); |
- try |
- { |
- registrar.registerFactory(this.classID, this.classDescription, this.contractID, this); |
- } |
- catch (e) |
- { |
- // See bug 924340 - it might be too early to init now, the old version |
- // we are replacing didn't finish removing itself yet. |
- if (e.result == Cr.NS_ERROR_FACTORY_EXISTS) |
- { |
- Utils.runAsync(this.init.bind(this)); |
- return; |
- } |
- |
- Cu.reportError(e); |
- } |
+ registrar.registerFactory(this.classID, this.classDescription, this.contractID, this); |
let catMan = Utils.categoryManager; |
for (let category of this.xpcom_categories) |
catMan.addCategoryEntry(category, this.contractID, this.contractID, false, true); |
// http-on-opening-request is new in Gecko 18, http-on-modify-request can |
// be used in earlier releases. |
let httpTopic = "http-on-opening-request"; |
@@ -416,21 +401,17 @@ var PolicyImplementation = |
// Our category observers should be removed before changing category |
// memberships, just in case. |
Services.obs.removeObserver(this, httpTopic); |
Services.obs.removeObserver(this, "content-document-global-created"); |
for (let category of this.xpcom_categories) |
catMan.deleteCategoryEntry(category, this.contractID, false); |
- // This needs to run asynchronously, see bug 753687 |
- Utils.runAsync(function() |
- { |
- registrar.unregisterFactory(this.classID, this); |
- }.bind(this)); |
+ registrar.unregisterFactory(this.classID, this); |
this.previousRequest = null; |
}.bind(this)); |
}, |
// |
// nsISupports interface implementation |
// |