factory = *aFactory;
factory = do_QueryInterface(*aFactory);
    nsresult GetFactory(nsIFactory **aFactory) {        if (factory) {            *aFactory = factory.get();            NS_ADDREF(*aFactory);            return NS_OK;        }        nsresult rv = loader->GetFactory(cid, location, type, aFactory);        if (NS_SUCCEEDED(rv))            factory = *aFactory;        return rv;    }