Fixed wacky sync/async code in webbrowser persist b=69828, r=dougt@netscape.com

This commit is contained in:
locka%iol.ie 2001-03-13 13:55:30 +00:00
Родитель e76b4fd565
Коммит 3187316f0a
2 изменённых файлов: 1 добавлений и 32 удалений

Просмотреть файл

@ -75,12 +75,7 @@ nsWebBrowserPersist::~nsWebBrowserPersist()
}
void nsWebBrowserPersist::CleanUp()
{ if (mInputStream)
{
mInputStream->Close();
mInputStream = nsnull;
}
mInputChannel = nsnull;
{
if (mOutputStream)
{
mOutputStream->Close();
@ -195,8 +190,6 @@ NS_IMETHODIMP nsWebBrowserPersist::SaveURI(nsIURI *aURI, nsIInputStream *aPostDa
mOutputTransport = outputChannel;
//dougt wtf?! why both a async and sync read?
// Read from the input channel
rv = inputChannel->AsyncOpen(this, nsnull);
if (NS_FAILED(rv))
@ -204,28 +197,6 @@ NS_IMETHODIMP nsWebBrowserPersist::SaveURI(nsIURI *aURI, nsIInputStream *aPostDa
OnEndDownload();
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIInputStream> inStream;
rv = inputChannel->Open(getter_AddRefs(inStream));
if (NS_FAILED(rv))
{
OnEndDownload();
return NS_ERROR_FAILURE;
}
mInputChannel = inputChannel;
mInputStream = inStream;
// Get the output channel ready for writing
nsCOMPtr<nsIRequest> writeRequest;
rv = NS_AsyncWriteFromStream(getter_AddRefs(writeRequest),
outputChannel, inStream, 0, 0, 0,
NS_STATIC_CAST(nsIStreamObserver*, this), nsnull);
if (NS_FAILED(rv))
{
OnEndDownload();
return NS_ERROR_FAILURE;
}
return NS_OK;
}

Просмотреть файл

@ -93,8 +93,6 @@ private:
static PRBool PR_CALLBACK CleanupURIMap(nsHashKey *aKey, void *aData, void* closure);
nsCOMPtr<nsIMIMEService> mMIMEService;
nsCOMPtr<nsIChannel> mInputChannel;
nsCOMPtr<nsIInputStream> mInputStream;
nsCOMPtr<nsITransport> mOutputTransport;
nsCOMPtr<nsIOutputStream> mOutputStream;
nsCOMPtr<nsIURI> mBaseURI;