rv = newLoader->SetDocLoaderParent(this); if (NS_SUCCEEDED(rv)) {    rv = mChildList->AppendElement((nsIDocumentLoader*)newLoader) ? NS_OK : NS_ERROR_FAILURE; }  rv = newLoader->QueryInterface(NS_GET_IID(nsIDocumentLoader), (void **) anInstance); NS_RELEASE(newLoader); return rv;
NS_NEWXPCOM(newLoader, nsDocLoaderImpl); if (nsnull == newLoader) { *anInstance = nsnull; rv = NS_ERROR_OUT_OF_MEMORY; goto done; }  rv = newLoader->QueryInterface(kIDocumentLoaderIID, (void**)anInstance); if (NS_SUCCEEDED(rv)) {  rv = newLoader->Init(); if (NS_SUCCEEDED(rv)) { AddChildGroup(newLoader); newLoader->SetParent(this); } }  done: return rv;
nsDocLoaderImpl::CreateDocumentLoader(nsIDocumentLoader** anInstance){  nsresult rv = NS_OK;  nsDocLoaderImpl * newLoader = new nsDocLoaderImpl();  NS_ENSURE_TRUE(newLoader, NS_ERROR_OUT_OF_MEMORY);    NS_ADDREF(newLoader);  newLoader->Init();  // Initialize now that we have a reference  rv = newLoader->SetDocLoaderParent(this);  if (NS_SUCCEEDED(rv)) {    //    // XXX this method incorrectly returns a bool        //    rv = mChildList->AppendElement((nsIDocumentLoader*)newLoader)        ? NS_OK : NS_ERROR_FAILURE;  }    rv = newLoader->QueryInterface(NS_GET_IID(nsIDocumentLoader), (void **) anInstance);  NS_RELEASE(newLoader);  return rv;}