NS_IMETHODIMP nsDocLoaderImpl::OnProgress(nsIRequest *aRequest, nsISupports* ctxt, PRUint32 aProgress, PRUint32 aProgressMax)
NS_METHOD nsDocumentBindInfo::OnProgress(nsIURL* aURL, PRInt32 aProgress, PRInt32 aProgressMax)
NS_IMETHODIMP nsDocLoaderImpl::OnProgress(nsIRequest *aRequest, nsISupports* ctxt,                                           PRUint32 aProgress, PRUint32 aProgressMax){  nsRequestInfo *info;  PRInt32 progressDelta = 0;  //  // Update the RequestInfo entry with the new progress data  //  info = GetRequestInfo(aRequest);  if (info) {    // suppress sending STATE_TRANSFERRING if this is upload progress (see bug 240053)    if (!info->mUploading && (0 == info->mCurrentProgress) && (0 == info->mMaxProgress)) {      //      // If we receive an OnProgress event from a toplevel channel that the URI Loader      // has not yet targeted, then we must suppress the event.  This is necessary to      // ensure that webprogresslisteners do not get confused when the channel is      // finally targeted.  See bug 257308.      //      nsLoadFlags lf = 0;      aRequest->GetLoadFlags(&lf);      if ((lf & nsIChannel::LOAD_DOCUMENT_URI) && !(lf & nsIChannel::LOAD_TARGETED)) {        PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,             ("DocLoader:%p Ignoring OnProgress while load is not targeted\n", this));        return NS_OK;      }      //      // This is the first progress notification for the entry.  If      // (aMaxProgress > 0) then the content-length of the data is known,      // so update mMaxSelfProgress...  Otherwise, set it to -1 to indicate      // that the content-length is no longer known.      //      if (aProgressMax != (PRUint32)-1) {        mMaxSelfProgress  += aProgressMax;        info->mMaxProgress = aProgressMax;      } else {        mMaxSelfProgress   = -1;        info->mMaxProgress = -1;      }      // Send a STATE_TRANSFERRING notification for the request.      PRInt32 flags;          flags = nsIWebProgressListener::STATE_TRANSFERRING |               nsIWebProgressListener::STATE_IS_REQUEST;      //      // Move the WebProgress into the STATE_TRANSFERRING state if necessary...      //      if (mProgressStateFlags & nsIWebProgressListener::STATE_START) {        mProgressStateFlags = nsIWebProgressListener::STATE_TRANSFERRING;        // Send STATE_TRANSFERRING for the document too...        flags |= nsIWebProgressListener::STATE_IS_DOCUMENT;      }      FireOnStateChange(this, aRequest, flags, NS_OK);    }    // Update the current progress count...    progressDelta = aProgress - info->mCurrentProgress;    mCurrentSelfProgress += progressDelta;    info->mCurrentProgress = aProgress;  }   //  // The request is not part of the load group, so ignore its progress  // information...  //  else {#if defined(DEBUG)    nsCAutoString buffer;    GetURIStringFromRequest(aRequest, buffer);    PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,            ("DocLoader:%p OOPS - No Request Info for: %s\n",            this, buffer.get()));#endif /* DEBUG */    return NS_OK;  }  //  // Fire progress notifications out to any registered nsIWebProgressListeners  //  FireOnProgressChange(this, aRequest, aProgress, aProgressMax, progressDelta,                       mCurrentTotalProgress, mMaxTotalProgress);  return NS_OK;}