зеркало из https://github.com/mozilla/pjs.git
Added sourceOffset parameter to OnDataAvailable.
This commit is contained in:
Родитель
eabb0554b5
Коммит
09ee7c3d28
|
@ -104,8 +104,6 @@ nsresult nsNetFactory::LockFactory(PRBool aLock)
|
|||
extern "C" PR_IMPLEMENT(nsresult)
|
||||
NSGetFactory(nsISupports* aServMgr,
|
||||
const nsCID &aClass,
|
||||
const char *aClassName,
|
||||
const char *aProgID,
|
||||
nsIFactory **aFactory)
|
||||
{
|
||||
if (aFactory == nsnull)
|
||||
|
|
|
@ -117,9 +117,11 @@ nsFtpOnDataAvailableEvent::~nsFtpOnDataAvailableEvent()
|
|||
}
|
||||
|
||||
nsresult
|
||||
nsFtpOnDataAvailableEvent::Init(nsIInputStream* aIStream, PRUint32 aLength)
|
||||
nsFtpOnDataAvailableEvent::Init(nsIInputStream* aIStream,
|
||||
PRUint32 aSourceOffset, PRUint32 aLength)
|
||||
{
|
||||
mLength = aLength;
|
||||
mSourceOffset = aSourceOffset;
|
||||
mIStream = aIStream;
|
||||
NS_ADDREF(mIStream);
|
||||
return NS_OK;
|
||||
|
@ -129,12 +131,13 @@ NS_IMETHODIMP
|
|||
nsFtpOnDataAvailableEvent::HandleEvent()
|
||||
{
|
||||
nsIStreamListener* receiver = (nsIStreamListener*)mListener;
|
||||
return receiver->OnDataAvailable(mContext, mIStream, mLength);
|
||||
return receiver->OnDataAvailable(mContext, mIStream, mSourceOffset, mLength);
|
||||
}
|
||||
/*
|
||||
NS_IMETHODIMP
|
||||
nsMarshalingStreamListener::OnDataAvailable(nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength)
|
||||
{
|
||||
nsresult rv = GetStatus();
|
||||
|
@ -145,7 +148,7 @@ nsMarshalingStreamListener::OnDataAvailable(nsISupports* context,
|
|||
if (event == nsnull)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
rv = event->Init(aIStream, aLength);
|
||||
rv = event->Init(aIStream, aSourceOffset, aLength);
|
||||
if (NS_FAILED(rv)) goto failed;
|
||||
rv = event->Fire(mEventQueue);
|
||||
if (NS_FAILED(rv)) goto failed;
|
||||
|
|
|
@ -60,11 +60,12 @@ public:
|
|||
mIStream(nsnull), mLength(0) {}
|
||||
virtual ~nsFtpOnDataAvailableEvent();
|
||||
|
||||
nsresult Init(nsIInputStream* aIStream, PRUint32 aLength);
|
||||
nsresult Init(nsIInputStream* aIStream, PRUint32 aSourceOffset, PRUint32 aLength);
|
||||
NS_IMETHOD HandleEvent();
|
||||
|
||||
protected:
|
||||
nsIInputStream* mIStream;
|
||||
PRUint32 mSourceOffset;
|
||||
PRUint32 mLength;
|
||||
};
|
||||
|
||||
|
@ -85,4 +86,4 @@ protected:
|
|||
nsIString* mMessage;
|
||||
};
|
||||
|
||||
#endif // ___nsftpstreamlistener_h__
|
||||
#endif // ___nsftpstreamlistener_h__
|
||||
|
|
Загрузка…
Ссылка в новой задаче