NS_ENSURE_TRUE(mDocument, NS_ERROR_FAILURE);
ImageListener::OnStopRequest(nsIRequest* request, nsISupports *ctxt,                             nsresult status){  nsImageDocument *imgDoc = (nsImageDocument*)mDocument.get();  imgDoc->UpdateTitle();    nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(imgDoc->mImageElement);  NS_ENSURE_TRUE(imageLoader, NS_ERROR_UNEXPECTED);  imageLoader->RemoveObserver(imgDoc);  return nsMediaDocumentStreamListener::OnStopRequest(request, ctxt, status);}