fact = mParserFactory; } else if (aClass.Equals(kLoggingSinkCID)) { if (!mLoggingSinkFactory) { rv = NS_NewGenericFactory(getter_AddRefs(mLoggingSinkFactory), &nsLoggingSinkConstructor); } fact = mLoggingSinkFactory; } else if (aClass.Equals(kWellFormedDTDCID)) { if (!mWellFormedDTDFactory) { rv = NS_NewGenericFactory(getter_AddRefs(mWellFormedDTDFactory), &CWellFormedDTDConstructor); } fact = mWellFormedDTDFactory; } else if (aClass.Equals(kNavDTDCID)) { if (!mNavHTMLDTDFactory) { rv = NS_NewGenericFactory(getter_AddRefs(mNavHTMLDTDFactory), &CNavDTDConstructor); } fact = mNavHTMLDTDFactory; } else if (aClass.Equals(kCOtherDTDCID)) { if (!mOtherHTMLDTDFactory) { rv = NS_NewGenericFactory(getter_AddRefs(mOtherHTMLDTDFactory), &COtherDTDConstructor); } fact = mOtherHTMLDTDFactory; } else if (aClass.Equals(kCTransitionalDTDCID)) { if (!mTransitionalHTMLDTDFactory) { rv = NS_NewGenericFactory(getter_AddRefs(mTransitionalHTMLDTDFactory), &CTransitionalDTDConstructor); } fact = mTransitionalHTMLDTDFactory; } else if (aClass.Equals(kViewSourceDTDCID)) { if (!mViewSourceHTMLDTDFactory) { rv = NS_NewGenericFactory(getter_AddRefs(mViewSourceHTMLDTDFactory), &CViewSourceHTMLConstructor); } fact = mViewSourceHTMLDTDFactory; } else if (aClass.Equals(kHTMLContentSinkStreamCID)) { if (!mHTMLContentSinkStreamFactory) { rv = NS_NewGenericFactory(getter_AddRefs(mHTMLContentSinkStreamFactory), &nsHTMLContentSinkStreamConstructor); } fact = mHTMLContentSinkStreamFactory; } else if (aClass.Equals(kParserServiceCID)) { if (!mParserServiceFactory) { rv = NS_NewGenericFactory(getter_AddRefs(mParserServiceFactory), &nsParserServiceConstructor); } fact = mParserServiceFactory; } else { rv = NS_ERROR_FACTORY_NOT_REGISTERED;
nsParserModule::GetClassObject(nsIComponentManager *aCompMgr,                               const nsCID& aClass,                               const nsIID& aIID,                               void** r_classObj){  nsresult rv=NS_OK;  if (!mInitialized) {    rv = Initialize();    if (NS_FAILED(rv)) {      return rv;    }    mInitialized = PR_TRUE;  }  nsCOMPtr<nsIGenericFactory> fact;  if (aClass.Equals(kParserCID)) {    if (!mParserFactory) {      rv = NS_NewGenericFactory(getter_AddRefs(mParserFactory),                                 &nsParserConstructor);    }    fact = mParserFactory;  }  else if (aClass.Equals(kLoggingSinkCID)) {    if (!mLoggingSinkFactory) {      rv = NS_NewGenericFactory(getter_AddRefs(mLoggingSinkFactory),                                 &nsLoggingSinkConstructor);    }    fact = mLoggingSinkFactory;  }  else if (aClass.Equals(kWellFormedDTDCID)) {    if (!mWellFormedDTDFactory) {      rv = NS_NewGenericFactory(getter_AddRefs(mWellFormedDTDFactory),                                 &CWellFormedDTDConstructor);    }    fact = mWellFormedDTDFactory;  }  else if (aClass.Equals(kNavDTDCID)) {    if (!mNavHTMLDTDFactory) {      rv = NS_NewGenericFactory(getter_AddRefs(mNavHTMLDTDFactory),                                 &CNavDTDConstructor);    }    fact = mNavHTMLDTDFactory;  }  else if (aClass.Equals(kCOtherDTDCID)) {    if (!mOtherHTMLDTDFactory) {      rv = NS_NewGenericFactory(getter_AddRefs(mOtherHTMLDTDFactory),                                 &COtherDTDConstructor);    }    fact = mOtherHTMLDTDFactory;  }  else if (aClass.Equals(kCTransitionalDTDCID)) {    if (!mTransitionalHTMLDTDFactory) {      rv = NS_NewGenericFactory(getter_AddRefs(mTransitionalHTMLDTDFactory),                                 &CTransitionalDTDConstructor);    }    fact = mTransitionalHTMLDTDFactory;  }  else if (aClass.Equals(kViewSourceDTDCID)) {    if (!mViewSourceHTMLDTDFactory) {      rv = NS_NewGenericFactory(getter_AddRefs(mViewSourceHTMLDTDFactory),                                 &CViewSourceHTMLConstructor);    }    fact = mViewSourceHTMLDTDFactory;  }  else if (aClass.Equals(kHTMLContentSinkStreamCID)) {    if (!mHTMLContentSinkStreamFactory) {      rv = NS_NewGenericFactory(getter_AddRefs(mHTMLContentSinkStreamFactory),                                 &nsHTMLContentSinkStreamConstructor);    }    fact = mHTMLContentSinkStreamFactory;  }  else if (aClass.Equals(kParserServiceCID)) {    if (!mParserServiceFactory) {      rv = NS_NewGenericFactory(getter_AddRefs(mParserServiceFactory),                                 &nsParserServiceConstructor);    }    fact = mParserServiceFactory;  }  else {		rv = NS_ERROR_FACTORY_NOT_REGISTERED;  }  if (fact) {    rv = fact->QueryInterface(aIID, r_classObj);  }  return rv;}