From c9f00b04473a08eefef354273b451972de3afd53 Mon Sep 17 00:00:00 2001 From: Matthew Noorenberghe Date: Sat, 11 Feb 2017 23:13:02 +0800 Subject: [PATCH] Bug 1333682 - Backed out changeset 7cde5062bfea because it was just hiding the real problem. r=me MozReview-Commit-ID: 3ULIILdZm5o --HG-- extra : rebase_source : a610b302d778924a18a20147fd917c2669b04723 --- .../formautofill/content/FormAutofillContent.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/browser/extensions/formautofill/content/FormAutofillContent.js b/browser/extensions/formautofill/content/FormAutofillContent.js index 1404f1d98f0d..c1f2c1194519 100644 --- a/browser/extensions/formautofill/content/FormAutofillContent.js +++ b/browser/extensions/formautofill/content/FormAutofillContent.js @@ -182,12 +182,10 @@ AutocompleteFactory.prototype = { this._factory = factory; let registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar); - if (proto.classID && !registrar.isCIDRegistered(proto.classID)) { - registrar.registerFactory(proto.classID, proto.classDescription, - proto.contractID, factory); - } + registrar.registerFactory(proto.classID, proto.classDescription, + proto.contractID, factory); - if (proto.classID2 && !registrar.isCIDRegistered(proto.classID2)) { + if (proto.classID2) { this._classID2 = proto.classID2; registrar.registerFactory(proto.classID2, proto.classDescription, proto.contractID2, factory); @@ -196,14 +194,10 @@ AutocompleteFactory.prototype = { unregister() { let registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar); - if (this._classID && registrar.isCIDRegistered(this._classID)) { - registrar.unregisterFactory(this._classID, this._factory); - } - - if (this._classID2 && registrar.isCIDRegistered(this._classID2)) { + registrar.unregisterFactory(this._classID, this._factory); + if (this._classID2) { registrar.unregisterFactory(this._classID2, this._factory); } - this._factory = null; }, };