NS_NEWXPCOM(newLoader, nsDocLoaderImpl); if (nsnull == newLoader) { *anInstance = nsnull; rv = NS_ERROR_OUT_OF_MEMORY; goto done; } rv = newLoader->Init(); if (NS_FAILED(rv)) return rv;  rv = newLoader->QueryInterface(kIDocumentLoaderIID, (void**)anInstance); if (NS_SUCCEEDED(rv)) { #ifdef NECKO AddChildGroup(newLoader->GetLoadGroup()); #else AddChildGroup(newLoader); #endif newLoader->SetParent(this); }  done: return rv;
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;
nsDocLoaderImpl::CreateDocumentLoader(nsIDocumentLoader** anInstance){    nsDocLoaderImpl* newLoader = nsnull;    nsresult rv = NS_OK;    /* Check for initial error conditions... */    if (nsnull == anInstance) {        rv = NS_ERROR_NULL_POINTER;        goto done;    }    NS_NEWXPCOM(newLoader, nsDocLoaderImpl);    if (nsnull == newLoader) {        *anInstance = nsnull;        rv = NS_ERROR_OUT_OF_MEMORY;        goto done;    }    rv = newLoader->Init();    if (NS_FAILED(rv)) return rv;    rv = newLoader->QueryInterface(kIDocumentLoaderIID, (void**)anInstance);    if (NS_SUCCEEDED(rv)) {#ifdef NECKO        AddChildGroup(newLoader->GetLoadGroup());#else        AddChildGroup(newLoader);#endif        newLoader->SetParent(this);    }  done:    return rv;}