rv = mNextListener->OnStopRequest(aChannel, aContext, aStatus, aMsg);
nsDocLoaderImpl::OnStopRequest(nsIRequest *aRequest,                                nsISupports *aCtxt,                                nsresult aStatus){  nsresult rv = NS_OK;#ifdef PR_LOGGING  if (PR_LOG_TEST(gDocLoaderLog, PR_LOG_DEBUG)) {    nsXPIDLString name;    aRequest->GetName(getter_Copies(name));    PRUint32 count = 0;    if (mLoadGroup)      mLoadGroup->GetActiveCount(&count);    PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,           ("DocLoader:%p: OnStopRequest[%p](%s) status=%x mIsLoadingDocument=%s, %u active URLs",           this, aRequest, NS_ConvertUCS2toUTF8(name).get(),           aStatus, (mIsLoadingDocument ? "true" : "false"),           count));  }#endif  //  // Only fire the OnEndDocumentLoad(...) if the document loader   // has initiated a load...  //  if (mIsLoadingDocument) {    PRUint32 count;    //    // Set the Maximum progress to the same value as the current progress.    // Since the URI has finished loading, all the data is there.  Also,    // this will allow a more accurate estimation of the max progress (in case    // the old value was unknown ie. -1)    //    nsRequestInfo *info;    info = GetRequestInfo(aRequest);    if (info) {      PRInt32 oldMax = info->mMaxProgress;      info->mMaxProgress = info->mCurrentProgress;      //      // If a request whose content-length was previously unknown has just      // finished loading, then use this new data to try to calculate a      // mMaxSelfProgress...      //      if ((oldMax < 0) && (mMaxSelfProgress < 0)) {        CalculateMaxProgress(&mMaxSelfProgress);      }    }    //    // Fire the OnStateChange(...) notification for stop request    //    doStopURLLoad(aRequest, aStatus);        rv = mLoadGroup->GetActiveCount(&count);    if (NS_FAILED(rv)) return rv;    //    // The load group for this DocumentLoader is idle...    //    if (0 == count) {      DocLoaderIsEmpty();    }  }  else {    doStopURLLoad(aRequest, aStatus);   }    return NS_OK;}