FireOnEndDocumentLoad((nsIDocumentLoader *) this, aStatus);
FireOnEndDocumentLoad((nsIDocumentLoader *) this, #ifdef NECKO channel, #endif aStatus);
nsresult nsDocLoaderImpl::LoadURLComplete(nsIURI* aURL, nsISupports* aBindInfo, PRInt32 aStatus)#endif{    /*     * If the entry is not found in the list, then it must have been cancelled     * via Stop(...). So ignore just it...      */#ifdef NECKO#if defined(DEBUG)    nsCOMPtr<nsIURI> uri;    nsresult rv = channel->GetURI(getter_AddRefs(uri));    if (NS_SUCCEEDED(rv)) {        char* buffer;        rv = uri->GetSpec(&buffer);        if (NS_SUCCEEDED(rv)) {            PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,                    ("DocLoader:%p: LoadURLComplete(...) called for %s\n",                     this, buffer));            nsCRT::free(buffer);        }    }#endif /* DEBUG */#else // !NECKO    PRBool isForegroundURL = PR_FALSE;    PRBool removed = m_LoadingDocsList->RemoveElement(aBindInfo);    if (removed) {        nsILoadAttribs* loadAttributes;        nsURLLoadType loadType = nsURLLoadNormal;        nsresult rv = aURL->GetLoadAttribs(&loadAttributes);        if (NS_SUCCEEDED(rv) && loadAttributes) {            rv = loadAttributes->GetLoadType(&loadType);            if (NS_FAILED(rv)) {                loadType = nsURLLoadNormal;            }            NS_RELEASE(loadAttributes);        }        if (nsURLLoadBackground != loadType) {            mForegroundURLs--;            isForegroundURL = PR_TRUE;        }        mTotalURLs -= 1;        NS_ASSERTION(mTotalURLs >= mForegroundURLs,                     "Foreground URL count is wrong.");#if defined(DEBUG)        const char* buffer;        aURL->GetSpec(&buffer);        PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,                ("DocLoader:%p: LoadURLComplete(...) called for %s; Foreground URLs: %d; Total URLs: %d\n",                 this, buffer, mForegroundURLs, mTotalURLs));#endif /* DEBUG */    }#endif // !NECKO    /*     * Fire the OnEndURLLoad notification to any observers...     */#ifdef NECKO    FireOnEndURLLoad((nsIDocumentLoader *) this, channel, aStatus);#else    FireOnEndURLLoad((nsIDocumentLoader *) this, aURL, aStatus);#endif#ifdef NECKO    return GetLoadGroup()->RemoveChannel(channel, ctxt, aStatus, aMsg);#else    /*     * Fire the OnEndDocumentLoad notification to any observers...     */    PRBool busy;    IsBusy(busy);    if (isForegroundURL && !busy) {#if defined(DEBUG)        const char* buffer;        nsIURI* uri = mDocumentUrl;        uri->GetSpec(&buffer);        PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,                ("DocLoader:%p: OnEndDocumentLoad(...) called for %s.\n",                this, buffer));#endif /* DEBUG */        FireOnEndDocumentLoad((nsIDocumentLoader *) this, aStatus);    }    return NS_OK;#endif}