Bug 565471 - HelperAppDialog.js shouldn't do delayed registration [r=mfinkle]
authorMichael Wu <mwu@mozilla.com>
Fri, 21 May 2010 15:28:41 -0700
changeset 66244 b6ed68f20286a0b2c9726757556be5e80c8a95bb
parent 66243 e26847b4011de3fd58e1a02a83abc21fe4b0ba60
child 66245 0ebb56d5d83ef27e60784c7f3c64639d6ce30f53
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs565471
Bug 565471 - HelperAppDialog.js shouldn't do delayed registration [r=mfinkle]
mobile/components/HelperAppDialog.js
--- a/mobile/components/HelperAppDialog.js
+++ b/mobile/components/HelperAppDialog.js
@@ -212,57 +212,11 @@ HelperAppLauncherDialog.prototype = {
     }
   },
 
   isUsableDirectory: function hald_isUsableDirectory(aDirectory) {
     return aDirectory.exists() && aDirectory.isDirectory() && aDirectory.isWritable();
   }
 };
 
-// The toolkit helper service uses a delayed registration, so we can't use XPCOMUtils
-// since it doesn't support delayed registration yet.
-
-//function NSGetModule(aCompMgr, aFileSpec) {
-//  return XPCOMUtils.generateModule([HelperAppLauncherDialog]);
-//}
-
-var module = {
-  firstTime: true,
-
-  registerSelf: function(compMgr, fileSpec, location, type) {
-    if (this.firstTime) {
-      this.firstTime = false;
-      throw Components.results.NS_ERROR_FACTORY_REGISTER_AGAIN;
-    }
-    compMgr = compMgr.QueryInterface(Ci.nsIComponentRegistrar);
-    compMgr.registerFactoryLocation(this.classID, this.classDescription, this.contractID, fileSpec, location, type);
-  },
-
-  getClassObject: function(compMgr, cid, iid) {
-    if (!cid.equals(this.classID))
-      throw Components.results.NS_ERROR_NO_INTERFACE;
-
-    if (!iid.equals(Ci.nsIFactory))
-      throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-
-    return this.factory;
-  },
-
-  classDescription: "HelperApp Launcher Dialog",
-  contractID: "@mozilla.org/helperapplauncherdialog;1",
-  classID: Components.ID("{e9d277a0-268a-4ec2-bb8c-10fdf3e44611}"),
-
-  factory: {
-    createInstance: function(outer, iid) {
-      if (outer != null)
-        throw Components.results.NS_ERROR_NO_AGGREGATION;
-      return (new HelperAppLauncherDialog()).QueryInterface(iid);
-    }
-  },
-
-  canUnload: function(compMgr) {
-    return true;
-  }
-};
-
-function NSGetModule(compMgr, fileSpec) {
-  return module;
+function NSGetModule(aCompMgr, aFileSpec) {
+  return XPCOMUtils.generateModule([HelperAppLauncherDialog]);
 }