rv = tr->Init(url, outputURI, nsnull, mimeinfo, timeDownloadStarted, nsnull);
rv = tr->Init(url, outputURI, EmptyString(), mimeinfo, timeDownloadStarted, this);
nsresult nsSaveMsgListener::InitializeDownload(nsIRequest * aRequest, PRInt32 aBytesDownloaded){  nsresult rv = NS_OK;  mInitialized = PR_TRUE;  nsCOMPtr<nsIChannel> channel (do_QueryInterface(aRequest));  if (!channel)    return rv;  // Set content length if we haven't already got it.  if (mContentLength == -1)      channel->GetContentLength(&mContentLength);  if (!m_contentType.IsEmpty())  {      nsCOMPtr<nsIMIMEService> mimeService (do_GetService(NS_MIMESERVICE_CONTRACTID));      nsCOMPtr<nsIMIMEInfo> mimeinfo;      mimeService->GetFromTypeAndExtension(m_contentType, EmptyCString(), getter_AddRefs(mimeinfo));       nsFileSpec realSpec;      m_fileSpec->GetFileSpec(&realSpec);      // Create nsILocalFile from a nsFileSpec.      nsCOMPtr<nsILocalFile> outputFile;      NS_FileSpecToIFile(&realSpec, getter_AddRefs(outputFile));       // create a download progress window      // XXX: we don't want to show the progress dialog if the download is really small.      // but what is a small download? Well that's kind of arbitrary      // so make an arbitrary decision based on the content length of the attachment      if (mContentLength != -1 && mContentLength > aBytesDownloaded * 2)      {        nsCOMPtr<nsITransfer> tr = do_CreateInstance(NS_TRANSFER_CONTRACTID, &rv);        if (tr && outputFile)        {          PRTime timeDownloadStarted = PR_Now();          nsCOMPtr<nsIURI> outputURI;          NS_NewFileURI(getter_AddRefs(outputURI), outputFile);          nsCOMPtr<nsIURI> url;          channel->GetURI(getter_AddRefs(url));          rv = tr->Init(url, outputURI, nsnull, mimeinfo, timeDownloadStarted, nsnull);          tr->SetObserver(this);          // now store the web progresslistener           mTransfer = tr;        }      }#if defined(XP_MAC) || defined(XP_MACOSX)      /* if we are saving an appledouble or applesingle attachment, we need to use an Apple File Decoder */      if ((nsCRT::strcasecmp(m_contentType.get(), APPLICATION_APPLEFILE) == 0) ||          (nsCRT::strcasecmp(m_contentType.get(), MULTIPART_APPLEDOUBLE) == 0))      {                nsCOMPtr<nsIAppleFileDecoder> appleFileDecoder = do_CreateInstance(NS_IAPPLEFILEDECODER_CONTRACTID, &rv);        if (NS_SUCCEEDED(rv) && appleFileDecoder)        {          rv = appleFileDecoder->Initialize(m_outputStream, outputFile);          if (NS_SUCCEEDED(rv))            m_outputStream = do_QueryInterface(appleFileDecoder, &rv);        }      }      else      {          if (mimeinfo)          {            PRUint32 aMacType;            PRUint32 aMacCreator;            if (NS_SUCCEEDED(mimeinfo->GetMacType(&aMacType)) && NS_SUCCEEDED(mimeinfo->GetMacCreator(&aMacCreator)))            {              nsCOMPtr<nsILocalFileMac> macFile =  do_QueryInterface(outputFile, &rv);              if (NS_SUCCEEDED(rv) && macFile)              {                macFile->SetFileCreator((OSType)aMacCreator);                macFile->SetFileType((OSType)aMacType);              }            }          }      }#endif // XP_MACOSX  }  return rv;}