From 424a7bd5f9af35d866c0365ae1731333142dfa72 Mon Sep 17 00:00:00 2001 From: "darin%netscape.com" Date: Wed, 14 Nov 2001 06:45:27 +0000 Subject: [PATCH] patch for bug 107789 "deprecate nsIRandomAccessStore (superceded by nsISeekableStream)" r=dougt, sr=rpotts git-svn-id: svn://10.0.0.236/trunk@108026 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 8 ++--- mozilla/docshell/base/nsWebShell.cpp | 6 ++-- .../src/nsWebBrowserPersist.cpp | 4 +-- mozilla/mailnews/base/util/nsMsgDBFolder.cpp | 30 +++++++++---------- .../mailnews/imap/src/nsImapMailFolder.cpp | 20 ++++++------- mozilla/mailnews/imap/src/nsImapService.cpp | 8 ++--- .../plugin/base/src/nsPluginHostImpl.cpp | 10 +++---- .../protocol/http/src/nsHttpChannel.cpp | 7 ----- .../protocol/http/src/nsHttpTransaction.cpp | 14 ++++----- mozilla/xpcom/io/nsFileStream.h | 2 +- mozilla/xpcom/io/nsIFileStream.cpp | 24 ++++++++++----- mozilla/xpcom/io/nsIFileStream.h | 5 ++-- mozilla/xpcom/io/nsIStringStream.cpp | 22 +++++++++----- .../components/xfer/src/nsStreamTransfer.cpp | 4 +-- 14 files changed, 87 insertions(+), 77 deletions(-) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 9ecc1c94023..fd5be156c11 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -4172,10 +4172,10 @@ nsresult nsDocShell::DoURILoad(nsIURI * aURI, // XXX it's a bit of a hack to rewind the postdata stream here but // it has to be done in case the post data is being reused multiple // times. - nsCOMPtr - postDataRandomAccess(do_QueryInterface(aPostData)); - if (postDataRandomAccess) { - postDataRandomAccess->Seek(PR_SEEK_SET, 0); + nsCOMPtr + postDataSeekable(do_QueryInterface(aPostData)); + if (postDataSeekable) { + postDataSeekable->Seek(nsISeekableStream::NS_SEEK_SET, 0); } nsCOMPtr uploadChannel(do_QueryInterface(httpChannel)); diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index b5466d39972..be8c5378cfe 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -1188,10 +1188,10 @@ nsresult nsWebShell::EndPageLoad(nsIWebProgress *aProgress, httpChannel->GetUploadStream(getter_AddRefs(inputStream)); } } - nsCOMPtr postDataRandomAccess(do_QueryInterface(inputStream)); - if (postDataRandomAccess) + nsCOMPtr postDataSeekable(do_QueryInterface(inputStream)); + if (postDataSeekable) { - postDataRandomAccess->Seek(PR_SEEK_SET, 0); + postDataSeekable->Seek(nsISeekableStream::NS_SEEK_SET, 0); } InternalLoad(url, // URI referrer, // Refering URI diff --git a/mozilla/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp b/mozilla/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp index d60a9739c76..68b37e1cee9 100644 --- a/mozilla/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp +++ b/mozilla/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp @@ -493,11 +493,11 @@ nsresult nsWebBrowserPersist::SaveURIInternal( nsCOMPtr httpChannel(do_QueryInterface(inputChannel)); if (httpChannel) { - nsCOMPtr stream(do_QueryInterface(aPostData)); + nsCOMPtr stream(do_QueryInterface(aPostData)); if (stream) { // Rewind the postdata stream - stream->Seek(PR_SEEK_SET, 0); + stream->Seek(nsISeekableStream::NS_SEEK_SET, 0); nsCOMPtr uploadChannel(do_QueryInterface(httpChannel)); NS_ASSERTION(uploadChannel, "http must support nsIUploadChannel"); // Attach the postdata to the http channel diff --git a/mozilla/mailnews/base/util/nsMsgDBFolder.cpp b/mozilla/mailnews/base/util/nsMsgDBFolder.cpp index 8ca019d7c84..5043bbb72bf 100644 --- a/mozilla/mailnews/base/util/nsMsgDBFolder.cpp +++ b/mozilla/mailnews/base/util/nsMsgDBFolder.cpp @@ -589,9 +589,9 @@ NS_IMETHODIMP nsMsgDBFolder::GetOfflineStoreOutputStream(nsIOutputStream **outpu rv = NS_NewIOFileStream(getter_AddRefs(supports), fileSpec, PR_WRONLY | PR_CREATE_FILE, 00700); supports->QueryInterface(NS_GET_IID(nsIOutputStream), (void **) outputStream); - nsCOMPtr randomStore = do_QueryInterface(supports); - if (randomStore) - randomStore->Seek(PR_SEEK_END, 0); + nsCOMPtr seekable = do_QueryInterface(supports); + if (seekable) + seekable->Seek(nsISeekableStream::NS_SEEK_END, 0); } return rv; } @@ -1301,23 +1301,23 @@ nsresult nsMsgDBFolder::WriteStartOfNewLocalMessage() result += ct; result += MSG_LINEBREAK; - nsCOMPtr randomStore; - PRInt32 curStorePos; + nsCOMPtr seekable; + PRUint32 curStorePos; if (m_offlineHeader) - randomStore = do_QueryInterface(m_tempMessageStream); + seekable = do_QueryInterface(m_tempMessageStream); - if (randomStore) + if (seekable) { - randomStore->Tell(&curStorePos); + seekable->Tell(&curStorePos); m_offlineHeader->SetMessageOffset(curStorePos); } m_tempMessageStream->Write(result.get(), result.Length(), &writeCount); - if (randomStore) + if (seekable) { m_tempMessageStream->Flush(); - randomStore->Tell(&curStorePos); + seekable->Tell(&curStorePos); m_offlineHeader->SetStatusOffset(curStorePos); } @@ -1342,21 +1342,21 @@ nsresult nsMsgDBFolder::StartNewOfflineMessage() nsresult nsMsgDBFolder::EndNewOfflineMessage() { - nsCOMPtr randomStore; - PRInt32 curStorePos; + nsCOMPtr seekable; + PRUint32 curStorePos; PRUint32 messageOffset; nsMsgKey messageKey; m_offlineHeader->GetMessageKey(&messageKey); if (m_tempMessageStream) - randomStore = do_QueryInterface(m_tempMessageStream); + seekable = do_QueryInterface(m_tempMessageStream); mDatabase->MarkOffline(messageKey, PR_TRUE, nsnull); - if (randomStore) + if (seekable) { m_tempMessageStream->Flush(); - randomStore->Tell(&curStorePos); + seekable->Tell(&curStorePos); m_offlineHeader->GetMessageOffset(&messageOffset); m_offlineHeader->SetOfflineMessageSize(curStorePos - messageOffset); m_offlineHeader->SetLineCount(m_numOfflineMsgLines); diff --git a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp index 7f61d715867..c4a9c45f51c 100644 --- a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp @@ -4854,29 +4854,29 @@ nsresult nsImapMailFolder::CopyOfflineMsgBody(nsIMsgFolder *srcFolder, nsIMsgDBH { nsCOMPtr outputStream; nsresult rv = GetOfflineStoreOutputStream(getter_AddRefs(outputStream)); - nsCOMPtr randomStore; - PRInt32 curStorePos; + nsCOMPtr seekable; + PRUint32 curStorePos; - randomStore = do_QueryInterface(outputStream); + seekable = do_QueryInterface(outputStream); - if (randomStore) + if (seekable) { nsMsgKey messageOffset; PRUint32 messageSize; origHdr->GetMessageOffset(&messageOffset); origHdr->GetOfflineMessageSize(&messageSize); - randomStore->Tell(&curStorePos); + seekable->Tell(&curStorePos); destHdr->SetMessageOffset(curStorePos); nsCOMPtr offlineStoreInputStream; rv = srcFolder->GetOfflineStoreInputStream(getter_AddRefs(offlineStoreInputStream)); if (NS_SUCCEEDED(rv) && offlineStoreInputStream) { - nsCOMPtr seekStream = do_QueryInterface(offlineStoreInputStream); + nsCOMPtr seekStream = do_QueryInterface(offlineStoreInputStream); NS_ASSERTION(seekStream, "non seekable stream - can't read from offline msg"); if (seekStream) { - rv = seekStream->Seek(PR_SEEK_SET, messageOffset); + rv = seekStream->Seek(nsISeekableStream::NS_SEEK_SET, messageOffset); if (NS_SUCCEEDED(rv)) { // now, copy the dest folder offline store msg to the temp file @@ -5665,9 +5665,9 @@ nsresult nsImapMailFolder::GetOfflineStoreOutputStream(nsIOutputStream **outputS rv = NS_NewIOFileStream(getter_AddRefs(supports), fileSpec, PR_WRONLY | PR_CREATE_FILE, 00700); supports->QueryInterface(NS_GET_IID(nsIOutputStream), (void **) outputStream); - nsCOMPtr randomStore = do_QueryInterface(supports); - if (randomStore) - randomStore->Seek(PR_SEEK_END, 0); + nsCOMPtr seekable = do_QueryInterface(supports); + if (seekable) + seekable->Seek(nsISeekableStream::NS_SEEK_END, 0); } return rv; } diff --git a/mozilla/mailnews/imap/src/nsImapService.cpp b/mozilla/mailnews/imap/src/nsImapService.cpp index d9e67ccee58..0ea3dab7a51 100644 --- a/mozilla/mailnews/imap/src/nsImapService.cpp +++ b/mozilla/mailnews/imap/src/nsImapService.cpp @@ -2141,10 +2141,10 @@ nsresult nsImapService::OfflineAppendFromFile(nsIFileSpec* aFileSpec, if (NS_SUCCEEDED(rv) && offlineStore) { - PRInt32 curOfflineStorePos = 0; - nsCOMPtr randomStore = do_QueryInterface(offlineStore); - if (randomStore) - randomStore->Tell(&curOfflineStorePos); + PRUint32 curOfflineStorePos = 0; + nsCOMPtr seekable = do_QueryInterface(offlineStore); + if (seekable) + seekable->Tell(&curOfflineStorePos); else { NS_ASSERTION(PR_FALSE, "needs to be a random store!"); diff --git a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp index e91980feb74..a19257881fb 100644 --- a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -76,7 +76,7 @@ #include "nsIIOService.h" #include "nsIURL.h" #include "nsIChannel.h" -#include "nsIFileStream.h" // for nsIRandomAccessStore +#include "nsIFileStream.h" // for nsISeekableStream #include "nsNetUtil.h" #include "nsIProgressEventSink.h" #include "nsIDocument.h" @@ -5344,10 +5344,10 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL, // XXX it's a bit of a hack to rewind the postdata stream // here but it has to be done in case the post data is // being reused multiple times. - nsCOMPtr - postDataRandomAccess(do_QueryInterface(postDataStream)); - if (postDataRandomAccess) - postDataRandomAccess->Seek(PR_SEEK_SET, 0); + nsCOMPtr + postDataSeekable(do_QueryInterface(postDataStream)); + if (postDataSeekable) + postDataSeekable->Seek(nsISeekableStream::NS_SEEK_SET, 0); nsCOMPtr uploadChannel(do_QueryInterface(httpChannel)); NS_ASSERTION(uploadChannel, "http must support nsIUploadChannel"); diff --git a/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp b/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp index bad2e5c26c5..786b5e0b60c 100644 --- a/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp @@ -32,7 +32,6 @@ #include "nsIAuthPrompt.h" #include "nsIStringBundle.h" #include "nsISupportsPrimitives.h" -#include "nsIFileStream.h" #include "nsCExternalHandlerService.h" #include "nsIMIMEService.h" #include "nsMimeTypes.h" @@ -1297,12 +1296,6 @@ nsHttpChannel::ProcessAuthentication(PRUint32 httpStatus) nsCOMPtr seekable = do_QueryInterface(mUploadStream); if (seekable) seekable->Seek(nsISeekableStream::NS_SEEK_SET, 0); - else { - // try nsIRandomAccessStore - nsCOMPtr ras = do_QueryInterface(mUploadStream); - if (ras) - ras->Seek(PR_SEEK_SET, 0); - } } rv = nsHttpHandler::get()->InitiateTransaction(mTransaction, mConnectionInfo); diff --git a/mozilla/netwerk/protocol/http/src/nsHttpTransaction.cpp b/mozilla/netwerk/protocol/http/src/nsHttpTransaction.cpp index 0d284d35d62..d36690edffe 100644 --- a/mozilla/netwerk/protocol/http/src/nsHttpTransaction.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHttpTransaction.cpp @@ -29,7 +29,7 @@ #include "nsHttpResponseHead.h" #include "nsHttpChunkedDecoder.h" #include "nsIStringStream.h" -#include "nsIFileStream.h" +#include "nsISeekableStream.h" #include "nsISocketTransportService.h" #include "pratom.h" #include "plevent.h" @@ -312,12 +312,12 @@ nsHttpTransaction::Restart() LOG(("restarting transaction @%x\n", this)); // rewind streams in case we already wrote out the request - nsCOMPtr ras = do_QueryInterface(mReqHeaderStream); - if (ras) - ras->Seek(PR_SEEK_SET, 0); - ras = do_QueryInterface(mReqUploadStream); - if (ras) - ras->Seek(PR_SEEK_SET, 0); + nsCOMPtr seekable = do_QueryInterface(mReqHeaderStream); + if (seekable) + seekable->Seek(nsISeekableStream::NS_SEEK_SET, 0); + seekable = do_QueryInterface(mReqUploadStream); + if (seekable) + seekable->Seek(nsISeekableStream::NS_SEEK_SET, 0); // just in case the connection is holding the last reference to us... NS_ADDREF_THIS(); diff --git a/mozilla/xpcom/io/nsFileStream.h b/mozilla/xpcom/io/nsFileStream.h index 882a7a8c02a..32901ea4a30 100644 --- a/mozilla/xpcom/io/nsFileStream.h +++ b/mozilla/xpcom/io/nsFileStream.h @@ -403,7 +403,7 @@ public: { PRIntn result = -1; if (mStore) - mResult = mStore->Tell(&result); + mResult = mStore->Tell((PRUint32 *)&result); return result; } diff --git a/mozilla/xpcom/io/nsIFileStream.cpp b/mozilla/xpcom/io/nsIFileStream.cpp index c57e87fa2c1..963320ce172 100644 --- a/mozilla/xpcom/io/nsIFileStream.cpp +++ b/mozilla/xpcom/io/nsIFileStream.cpp @@ -74,9 +74,7 @@ class FileImpl // nsIOpenFile interface NS_IMETHOD Open(const nsFileSpec& inFile, int nsprMode, PRIntn accessMode); NS_IMETHOD Close(); - NS_IMETHOD Seek(PRSeekWhence whence, PRInt32 offset); NS_IMETHOD GetIsOpen(PRBool* outOpen); - NS_IMETHOD Tell(PRIntn* outWhere); // nsIInputStream interface NS_IMETHOD Available(PRUint32 *aLength); @@ -94,6 +92,9 @@ class FileImpl NS_IMETHOD SetNonBlocking(PRBool aNonBlocking); NS_IMETHOD GetObserver(nsIOutputStreamObserver * *aObserver); NS_IMETHOD SetObserver(nsIOutputStreamObserver * aObserver); + + // nsIRandomAccessStore interface + NS_DECL_NSISEEKABLESTREAM NS_IMETHOD GetAtEOF(PRBool* outAtEOF); NS_IMETHOD SetAtEOF(PRBool inAtEOF); @@ -124,6 +125,7 @@ NS_IMPL_ADDREF(FileImpl) NS_IMPL_QUERY_HEAD(FileImpl) NS_IMPL_QUERY_BODY(nsIOpenFile) + NS_IMPL_QUERY_BODY(nsISeekableStream) NS_IMPL_QUERY_BODY(nsIRandomAccessStore) NS_IMPL_QUERY_BODY(nsIOutputStream) NS_IMPL_QUERY_BODY(nsIInputStream) @@ -321,7 +323,7 @@ NS_IMETHODIMP FileImpl::GetIsOpen(PRBool* outOpen) } //---------------------------------------------------------------------------------------- -NS_IMETHODIMP FileImpl::Seek(PRSeekWhence whence, PRInt32 offset) +NS_IMETHODIMP FileImpl::Seek(PRInt32 whence, PRInt32 offset) //---------------------------------------------------------------------------------------- { if (mFileDesc==PR_STDIN || mFileDesc==PR_STDOUT || mFileDesc==PR_STDERR || !mFileDesc) @@ -338,9 +340,9 @@ NS_IMETHODIMP FileImpl::Seek(PRSeekWhence whence, PRInt32 offset) PRInt32 newPosition = 0; switch (whence) { - case PR_SEEK_CUR: newPosition = position + offset; break; - case PR_SEEK_SET: newPosition = offset; break; - case PR_SEEK_END: newPosition = fileSize + offset; break; + case NS_SEEK_CUR: newPosition = position + offset; break; + case NS_SEEK_SET: newPosition = offset; break; + case NS_SEEK_END: newPosition = fileSize + offset; break; } if (newPosition < 0) { @@ -530,7 +532,7 @@ FileImpl::SetObserver(nsIOutputStreamObserver * aObserver) } //---------------------------------------------------------------------------------------- -NS_IMETHODIMP FileImpl::Tell(PRIntn* outWhere) +NS_IMETHODIMP FileImpl::Tell(PRUint32* outWhere) //---------------------------------------------------------------------------------------- { if (mFileDesc==PR_STDIN || mFileDesc==PR_STDOUT || mFileDesc==PR_STDERR || !mFileDesc) @@ -620,6 +622,14 @@ NS_IMETHODIMP FileImpl::SetAtEOF(PRBool inAtEOF) return NS_OK; } +//---------------------------------------------------------------------------------------- +NS_IMETHODIMP FileImpl::SetEOF() +//---------------------------------------------------------------------------------------- +{ + NS_NOTYETIMPLEMENTED("FileImpl::SetEOF"); + return NS_ERROR_NOT_IMPLEMENTED; +} + //---------------------------------------------------------------------------------------- nsresult FileImpl::AllocateBuffers(PRUint32 segmentSize, PRUint32 maxBufSize) //---------------------------------------------------------------------------------------- diff --git a/mozilla/xpcom/io/nsIFileStream.h b/mozilla/xpcom/io/nsIFileStream.h index 23f6fe95b12..4771699389e 100644 --- a/mozilla/xpcom/io/nsIFileStream.h +++ b/mozilla/xpcom/io/nsIFileStream.h @@ -39,6 +39,7 @@ #include "nsIInputStream.h" #include "nsIOutputStream.h" +#include "nsISeekableStream.h" #include "prio.h" class nsFileSpec; @@ -76,12 +77,10 @@ public: class nsIRandomAccessStore // Supports Seek, Tell etc. //======================================================================================== -: public nsISupports +: public nsISeekableStream { public: static const nsIID& GetIID() { static nsIID iid = NS_IRANDOMACCESS_IID; return iid; } - NS_IMETHOD Seek(PRSeekWhence whence, PRInt32 offset) = 0; - NS_IMETHOD Tell(PRIntn* outWhere) = 0; /* "PROTECTED" */ NS_IMETHOD GetAtEOF(PRBool* outAtEOF) = 0; diff --git a/mozilla/xpcom/io/nsIStringStream.cpp b/mozilla/xpcom/io/nsIStringStream.cpp index fe3af079d8b..c33820d8339 100644 --- a/mozilla/xpcom/io/nsIStringStream.cpp +++ b/mozilla/xpcom/io/nsIStringStream.cpp @@ -54,8 +54,7 @@ class BasicStringImpl BasicStringImpl(); virtual ~BasicStringImpl(); - NS_IMETHOD Seek(PRSeekWhence whence, PRInt32 offset); - NS_IMETHOD Tell(PRIntn* outWhere); + NS_DECL_NSISEEKABLESTREAM NS_IMETHOD GetAtEOF(PRBool* outAtEOF); NS_IMETHOD SetAtEOF(PRBool inAtEOF); NS_IMETHOD Available(PRUint32 *aLength); @@ -123,7 +122,7 @@ BasicStringImpl::~BasicStringImpl() } //---------------------------------------------------------------------------------------- -NS_IMETHODIMP BasicStringImpl::Seek(PRSeekWhence whence, PRInt32 offset) +NS_IMETHODIMP BasicStringImpl::Seek(PRInt32 whence, PRInt32 offset) //---------------------------------------------------------------------------------------- { mLastResult = NS_OK; // reset on a seek. @@ -132,9 +131,9 @@ NS_IMETHODIMP BasicStringImpl::Seek(PRSeekWhence whence, PRInt32 offset) PRInt32 newPosition=-1; switch (whence) { - case PR_SEEK_CUR: newPosition = mOffset + offset; break; - case PR_SEEK_SET: newPosition = offset; break; - case PR_SEEK_END: newPosition = fileSize + offset; break; + case NS_SEEK_CUR: newPosition = mOffset + offset; break; + case NS_SEEK_SET: newPosition = offset; break; + case NS_SEEK_END: newPosition = fileSize + offset; break; } if (newPosition < 0) { @@ -151,13 +150,21 @@ NS_IMETHODIMP BasicStringImpl::Seek(PRSeekWhence whence, PRInt32 offset) } // StringImpl::Seek //---------------------------------------------------------------------------------------- -NS_IMETHODIMP BasicStringImpl::Tell(PRIntn* outWhere) +NS_IMETHODIMP BasicStringImpl::Tell(PRUint32* outWhere) //---------------------------------------------------------------------------------------- { *outWhere = mOffset; return NS_OK; } +//---------------------------------------------------------------------------------------- +NS_IMETHODIMP BasicStringImpl::SetEOF() +//---------------------------------------------------------------------------------------- +{ + NS_NOTYETIMPLEMENTED("BasicStringImpl::SetEOF"); + return NS_ERROR_NOT_IMPLEMENTED; +} + //---------------------------------------------------------------------------------------- NS_IMETHODIMP BasicStringImpl::GetAtEOF(PRBool* outAtEOF) //---------------------------------------------------------------------------------------- @@ -495,6 +502,7 @@ NS_IMPL_THREADSAFE_ADDREF(BasicStringImpl) NS_IMPL_THREADSAFE_RELEASE(BasicStringImpl) NS_IMPL_QUERY_HEAD(BasicStringImpl) + NS_IMPL_QUERY_BODY(nsISeekableStream) NS_IMPL_QUERY_BODY(nsIRandomAccessStore) NS_IMPL_QUERY_BODY(nsIOutputStream) NS_IMPL_QUERY_BODY(nsIInputStream) diff --git a/mozilla/xpfe/components/xfer/src/nsStreamTransfer.cpp b/mozilla/xpfe/components/xfer/src/nsStreamTransfer.cpp index 99e156061cc..7464af5dc5f 100644 --- a/mozilla/xpfe/components/xfer/src/nsStreamTransfer.cpp +++ b/mozilla/xpfe/components/xfer/src/nsStreamTransfer.cpp @@ -210,9 +210,9 @@ nsStreamTransfer::SelectFileAndTransferLocationSpec( char const *aURL, nsCOMPtr httpChannel( do_QueryInterface( channel ) ); if ( httpChannel ) { // Rewind stream and attach to channel. - nsCOMPtr stream( do_QueryInterface( postData ) ); + nsCOMPtr stream( do_QueryInterface( postData ) ); if ( stream ) { - stream->Seek( PR_SEEK_SET, 0 ); + stream->Seek( nsISeekableStream::NS_SEEK_SET, 0 ); nsCOMPtr uploadChannel(do_QueryInterface(httpChannel)); NS_ASSERTION(uploadChannel, "http must support nsIUploadChannel");