else if (aClass.Equals(kCIMimeURLUtilsCID)) { if (!mMimeURLUtilsFactory) rv = NS_NewGenericFactory(getter_AddRefs(mMimeURLUtilsFactory), &nsMimeURLUtilsConstructor); fact = mMimeURLUtilsFactory; }
NS_IMETHODIMP nsMimeModule::GetClassObject(nsIComponentManager *aCompMgr,                               const nsCID& aClass,                               const nsIID& aIID,                               void** r_classObj){    nsresult rv;    // Defensive programming: Initialize *r_classObj in case of error below    if (!r_classObj)        return NS_ERROR_INVALID_POINTER;    *r_classObj = NULL;    // Do one-time-only initialization if necessary    if (!mInitialized)     {        rv = Initialize();        if (NS_FAILED(rv)) // Initialization failed! yikes!            return rv;    }    // Choose the appropriate factory, based on the desired instance    // class type (aClass).    nsCOMPtr<nsIGenericFactory> fact;    if (aClass.Equals(kCMimeMimeObjectClassAccessCID))    {        if (!mObjectClassAccessFactory)            rv = NS_NewGenericFactory(getter_AddRefs(mObjectClassAccessFactory), &nsMimeObjectClassAccessConstructor);        fact = mObjectClassAccessFactory;    }    else if (aClass.Equals(kCMimeConverterCID))    {        if (!mMimeConverterFactory)            rv = NS_NewGenericFactory(getter_AddRefs(mMimeConverterFactory), &nsMimeConverterConstructor);        fact = mMimeConverterFactory;    }    else if (aClass.Equals(kCStreamConverterCID))     {        if (!mStreamConverterFactory)            rv = NS_NewGenericFactory(getter_AddRefs(mStreamConverterFactory), &nsStreamConverterConstructor);        fact = mStreamConverterFactory;    }    else if (aClass.Equals(kCMsgHeaderParserCID))     {        if (!mMsgHeaderParserFactory)            rv = NS_NewGenericFactory(getter_AddRefs(mMsgHeaderParserFactory), &nsMsgHeaderParserConstructor);        fact = mMsgHeaderParserFactory;    }    else if (aClass.Equals(kCIMimeURLUtilsCID))     {        if (!mMimeURLUtilsFactory)            rv = NS_NewGenericFactory(getter_AddRefs(mMimeURLUtilsFactory), &nsMimeURLUtilsConstructor);        fact = mMimeURLUtilsFactory;    }    else if (aClass.Equals(kCIMimeHeadersCID))     {        if (!mMimeHeadersFactory)            rv = NS_NewGenericFactory(getter_AddRefs(mMimeHeadersFactory), &nsMimeHeadersConstructor);        fact = mMimeHeadersFactory;    }        if (fact)        rv = fact->QueryInterface(aIID, r_classObj);    return rv;}