else { nsCOMPtr<nsIComponentRegistrar> reg = do_QueryInterface(mServiceManager); NS_ASSERTION(reg, "Service Manager doesn't QI to Registrar.");  reg->RegisterFactory(kAppInfoCID, "nsXULAppInfo", XULAPPINFO_SERVICE_CONTRACTID, NS_CONST_CAST(nsXULAppInfo*,&kAppInfo)); }
ScopedXPCOMStartup::Initialize(){  NS_ASSERTION(gDirServiceProvider, "Should not get here!");  nsresult rv;  rv = NS_InitXPCOM2(&mServiceManager, gDirServiceProvider->GetAppDir(),                     gDirServiceProvider);  if (NS_FAILED(rv)) {    NS_ERROR("Couldn't start xpcom!");    mServiceManager = nsnull;  }  return rv;}