NS_ENSURE_TRUE(mDocument, NS_ERROR_FAILURE);
ImageListener::OnStartRequest(nsIRequest* request, nsISupports *ctxt){  nsImageDocument *imgDoc = (nsImageDocument*)mDocument.get();  nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);  if (!channel) {    return NS_ERROR_FAILURE;  }  nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(imgDoc->mImageElement);  NS_ENSURE_TRUE(imageLoader, NS_ERROR_UNEXPECTED);  imageLoader->AddObserver(imgDoc);  imageLoader->LoadImageWithChannel(channel, getter_AddRefs(mNextStream));  return nsMediaDocumentStreamListener::OnStartRequest(request, ctxt);}