NS_IMETHODIMP imgRequest::OnStopRequest(nsIRequest *aRequest, nsISupports *ctxt, nsresult status)
NS_IMETHODIMP imgCacheValidator::OnStopRequest(nsIRequest *aRequest, nsISupports *ctxt, nsresult status)
NS_IMETHODIMP imgRequest::OnStopRequest(nsIRequest *aRequest, nsISupports *ctxt, nsresult status){  LOG_FUNC(gImgLog, "imgRequest::OnStopRequest");  mState |= onStopRequest;  /* set our loading flag to false */  mLoading = PR_FALSE;  /* set our processing flag to false */  mProcessing = PR_FALSE;  if (mChannel) {    mChannel->GetOriginalURI(getter_AddRefs(mURI));    mChannel = nsnull; // we no longer need the channel  }  // If mImage is still null, we didn't properly load the image.  if (NS_FAILED(status) || !mImage) {    this->Cancel(status); // sets status, stops animations, removes from cache  } else {    mImageStatus |= imgIRequest::STATUS_LOAD_COMPLETE;  }  if (mDecoder) {    mDecoder->Flush();    mDecoder->Close();    mDecoder = nsnull; // release the decoder so that it can rest peacefully ;)  }  // if there was an error loading the image, (mState & onStopDecode) won't be true.  // Send an onStopDecode message  if (!(mState & onStopDecode)) {    this->OnStopDecode(nsnull, status, nsnull);  }  /* notify the kids */  PRInt32 count = mObservers.Count();  for (PRInt32 i = count-1; i>=0; i--) {    imgRequestProxy *proxy = NS_STATIC_CAST(imgRequestProxy*, mObservers[i]);    /* calling OnStopRequest may result in the death of |proxy| so don't use the       pointer after this call.     */    if (proxy) proxy->OnStopRequest(aRequest, ctxt, status);  }  return NS_OK;}