if (NULL == aInstancePtr) { return NS_ERROR_NULL_POINTER; } if (aIID.Equals(kIDocumentLoaderIID)) { *aInstancePtr = (void*)(nsIDocumentLoader*)this; NS_ADDREF_THIS(); return NS_OK; }
NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer"); if (nsnull == aInstancePtrResult) { return NS_ERROR_NULL_POINTER; }  *aInstancePtrResult = NULL;  if (aIID.Equals(kIStreamObserverIID)) { *aInstancePtrResult = (void*) ((nsIStreamObserver*)this); NS_ADDREF_THIS(); return NS_OK; } if (aIID.Equals(kIStreamListenerIID)) { *aInstancePtrResult = (void*) ((nsIStreamListener*)this); NS_ADDREF_THIS(); return NS_OK; } if (aIID.Equals(kDocumentBindInfoIID)) { *aInstancePtrResult = (void*) this; NS_ADDREF_THIS(); return NS_OK; }
nsDocLoaderImpl::QueryInterface(REFNSIID aIID, void** aInstancePtr){    if (NULL == aInstancePtr) {        return NS_ERROR_NULL_POINTER;    }    if (aIID.Equals(kIDocumentLoaderIID)) {        *aInstancePtr = (void*)(nsIDocumentLoader*)this;        NS_ADDREF_THIS();        return NS_OK;    }#ifndef NECKO    if (aIID.Equals(kILoadGroupIID)) {        *aInstancePtr = (void*)(nsILoadGroup*)this;        NS_ADDREF_THIS();        return NS_OK;    }#endif // NECKO    return NS_NOINTERFACE;}