Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/contentPolicy.js

Issue 29329393: Issue 3208 - Drop asynchronous factory registration/unregistration (Closed)
Patch Set: Created Oct. 26, 2015, 8:02 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
//
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld