nsresult rv;
nsresult rv = NS_ERROR_UNEXPECTED;
nsUConvModule::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;  if (!mInitialized) {    rv = Initialize();    if (NS_FAILED(rv)) {      return rv;    }    mInitialized = PR_TRUE;  }  nsCOMPtr<nsIGenericFactory> fact;  if (aClass.Equals(kCharsetConverterManagerCID)) {    rv = NS_NewGenericFactory(getter_AddRefs(fact), NS_NewCharsetConverterManager);  }  else if (aClass.Equals(kUnicodeDecodeHelperCID)) {    rv = NS_NewGenericFactory(getter_AddRefs(fact), NS_NewUnicodeDecodeHelper);  }  else if (aClass.Equals(kUnicodeEncodeHelperCID)) {    rv = NS_NewGenericFactory(getter_AddRefs(fact), NS_NewUnicodeEncodeHelper);  }  else if (aClass.Equals(kPlatformCharsetCID)) {    rv = NS_NewGenericFactory(getter_AddRefs(fact), NS_NewPlatformCharset);  }  else if (aClass.Equals(kCharsetAliasCID)) {    rv = NS_NewGenericFactory(getter_AddRefs(fact), NS_NewCharsetAlias);  }  else if (aClass.Equals(kCharsetMenuCID)) {    rv = NS_NewGenericFactory(getter_AddRefs(fact), NS_NewCharsetMenu);  }  else if (aClass.Equals(kTextToSubURICID)) {    rv = NS_NewGenericFactory(getter_AddRefs(fact), NS_NewTextToSubURI);  }  else if (aClass.Equals(kISO88591ToUnicodeCID)) {    rv = NS_NewGenericFactory(getter_AddRefs(fact), NS_NewISO88591ToUnicode);  }  else if (aClass.Equals(kCP1252ToUnicodeCID)) {    rv = NS_NewGenericFactory(getter_AddRefs(fact), NS_NewCP1252ToUnicode);  }  else if (aClass.Equals(kMacRomanToUnicodeCID)) {    rv = NS_NewGenericFactory(getter_AddRefs(fact), NS_NewMacRomanToUnicode);  }  else if (aClass.Equals(kUTF8ToUnicodeCID)) {    rv = NS_NewGenericFactory(getter_AddRefs(fact), NS_NewUTF8ToUnicode);  }  else if (aClass.Equals(kUnicodeToISO88591CID)) {    rv = NS_NewGenericFactory(getter_AddRefs(fact), NS_NewUnicodeToISO88591);  }  else if (aClass.Equals(kUnicodeToCP1252CID)) {    rv = NS_NewGenericFactory(getter_AddRefs(fact), NS_NewUnicodeToCP1252);  }  else if (aClass.Equals(kUnicodeToMacRomanCID)) {    rv = NS_NewGenericFactory(getter_AddRefs(fact), NS_NewUnicodeToMacRoman);  }  else if (aClass.Equals(kUnicodeToUTF8CID)) {    rv = NS_NewGenericFactory(getter_AddRefs(fact), NS_NewUnicodeToUTF8);  }  else {		return NS_ERROR_FACTORY_NOT_REGISTERED;  }  if (fact) {    rv = fact->QueryInterface(aIID, r_classObj);  }  return rv;}