nsHttpChannel::GetCallback(const nsIID &aIID, void **aResult) { nsresult rv; NS_ASSERTION(aResult, "Invalid argument in GetCallback!"); *aResult = nsnull; NS_ENSURE_TRUE(mCallbacks, NS_ERROR_NOT_INITIALIZED); rv = mCallbacks->GetInterface(aIID, aResult); if (NS_FAILED(rv)) { if (mLoadGroup) { nsCOMPtr<nsIInterfaceRequestor> cbs; rv = mLoadGroup->GetNotificationCallbacks(getter_AddRefs(cbs)); if (NS_SUCCEEDED(rv)) rv = cbs->GetInterface(aIID, aResult); }
void GetCallback(nsCOMPtr<T> &aResult) { NS_QueryNotificationCallbacks(mCallbacks, mLoadGroup, NS_GET_IID(T), getter_AddRefs(aResult));
nsHttpChannel::GetCallback(const nsIID &aIID, void **aResult){    nsresult rv;    NS_ASSERTION(aResult, "Invalid argument in GetCallback!");    *aResult = nsnull;    NS_ENSURE_TRUE(mCallbacks, NS_ERROR_NOT_INITIALIZED);    rv = mCallbacks->GetInterface(aIID, aResult);    if (NS_FAILED(rv)) {        if (mLoadGroup) {            nsCOMPtr<nsIInterfaceRequestor> cbs;            rv = mLoadGroup->GetNotificationCallbacks(getter_AddRefs(cbs));            if (NS_SUCCEEDED(rv))                rv = cbs->GetInterface(aIID, aResult);        }    }    // defend against bad nsIInterfaceRequestor implementations.    if (NS_SUCCEEDED(rv) && !*aResult)        return NS_ERROR_NO_INTERFACE;    return rv;}