if (NS_SUCCEEDED(rv)) mFactory = do_QueryInterface(*aFactory); return rv;
if (NS_FAILED(rv)) return rv;  NS_ASSERTION(*aFactory, "Loader says it succeeded; got null factory!"); mFactory = do_QueryInterface(*aFactory); if (!mFactory) return NS_ERROR_NO_INTERFACE;  return NS_OK;
    nsresult GetFactory(nsIFactory **aFactory,                         nsComponentManagerImpl * mgr) {        if (mFactory) {            *aFactory = mFactory.get();            NS_ADDREF(*aFactory);            return NS_OK;        }        if (mTypeIndex < 0)            return NS_ERROR_FAILURE;        nsresult rv;        nsCOMPtr<nsIComponentLoader> loader;        rv = mgr->GetLoaderForType(mTypeIndex, getter_AddRefs(loader));        if(NS_FAILED(rv))            return rv;        rv = loader->GetFactory(mCid, mLocation, mgr->mLoaderData[mTypeIndex].type, aFactory);        if (NS_SUCCEEDED(rv))            mFactory = do_QueryInterface(*aFactory);        return rv;    }