mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-24 05:44:10 +00:00
Added channel argument to nsIStreamObserver/nsIStreamListener/nsIProgressEventSink methods.
This commit is contained in:
parent
9fd93518a9
commit
9975942bdb
@ -91,10 +91,10 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
#else
|
||||
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
|
||||
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
@ -127,16 +127,13 @@ NS_IMPL_ISUPPORTS(ImageListener, kIStreamListenerIID)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
ImageListener::OnStartRequest(nsISupports *ctxt)
|
||||
ImageListener::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
#else
|
||||
ImageListener::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
#endif
|
||||
{
|
||||
#ifdef NECKO
|
||||
nsresult rv;
|
||||
nsIChannel* channel;
|
||||
rv = ctxt->QueryInterface(nsIChannel::GetIID(), (void**)&channel);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsIURI* uri;
|
||||
rv = channel->GetURI(&uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -151,7 +148,7 @@ ImageListener::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#ifdef NECKO
|
||||
return mNextStream->OnStartRequest(ctxt);
|
||||
return mNextStream->OnStartRequest(channel, ctxt);
|
||||
#else
|
||||
return mNextStream->OnStartRequest(aURL, aContentType);
|
||||
#endif
|
||||
@ -180,8 +177,8 @@ ImageListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
ImageListener::OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg)
|
||||
ImageListener::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg)
|
||||
#else
|
||||
ImageListener::OnStopRequest(nsIURI* aURL, nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
@ -192,7 +189,7 @@ ImageListener::OnStopRequest(nsIURI* aURL, nsresult aStatus,
|
||||
}
|
||||
#ifdef NECKO
|
||||
mDocument->EndLayout(ctxt, status, errorMsg);
|
||||
return mNextStream->OnStopRequest(ctxt, status, errorMsg);
|
||||
return mNextStream->OnStopRequest(channel, ctxt, status, errorMsg);
|
||||
#else
|
||||
mDocument->EndLayout(aURL, aStatus, aMsg);
|
||||
return mNextStream->OnStopRequest(aURL, aStatus, aMsg);
|
||||
@ -212,8 +209,8 @@ ImageListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
ImageListener::OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr,
|
||||
PRUint32 sourceOffset, PRUint32 count)
|
||||
ImageListener::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count)
|
||||
#else
|
||||
ImageListener::OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
|
||||
PRUint32 aCount)
|
||||
@ -223,7 +220,7 @@ ImageListener::OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#ifdef NECKO
|
||||
return mNextStream->OnDataAvailable(ctxt, inStr, sourceOffset, count);
|
||||
return mNextStream->OnDataAvailable(channel, ctxt, inStr, sourceOffset, count);
|
||||
#else
|
||||
return mNextStream->OnDataAvailable(aURL, aStream, aCount);
|
||||
#endif
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "nsIURL.h"
|
||||
#ifdef NECKO
|
||||
#include "nsILoadGroup.h"
|
||||
#include "nsIChannel.h"
|
||||
#else
|
||||
#include "nsIURLGroup.h"
|
||||
#endif
|
||||
@ -110,10 +111,19 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
|
||||
void SetKeepPumpingData(nsIChannel* channel, nsISupports* context) {
|
||||
NS_IF_RELEASE(mChannel);
|
||||
mChannel = channel;
|
||||
NS_ADDREF(mChannel);
|
||||
NS_IF_RELEASE(mUserContext);
|
||||
mUserContext = context;
|
||||
NS_ADDREF(mUserContext);
|
||||
}
|
||||
#else
|
||||
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
|
||||
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 Progress, PRUint32 ProgressMax);
|
||||
@ -132,15 +142,15 @@ protected:
|
||||
ilIURL *mURL;
|
||||
PRBool mInterrupted;
|
||||
ImageNetContextImpl *mContext;
|
||||
#ifdef NECKO
|
||||
nsIInputStream *mStream;
|
||||
#else
|
||||
nsIInputStream *mStream;
|
||||
#endif
|
||||
nsITimer *mTimer;
|
||||
PRBool mFirstRead;
|
||||
char *mBuffer;
|
||||
PRInt32 mStatus;
|
||||
#ifdef NECKO
|
||||
nsIChannel* mChannel;
|
||||
nsISupports* mUserContext;
|
||||
#endif
|
||||
};
|
||||
|
||||
ImageConsumer::ImageConsumer(ilIURL *aURL, ImageNetContextImpl *aContext)
|
||||
@ -156,6 +166,10 @@ ImageConsumer::ImageConsumer(ilIURL *aURL, ImageNetContextImpl *aContext)
|
||||
mTimer = nsnull;
|
||||
mBuffer = nsnull;
|
||||
mStatus = 0;
|
||||
#ifdef NECKO
|
||||
mChannel = nsnull;
|
||||
mUserContext = nsnull;
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_DEFINE_IID(kIStreamNotificationIID, NS_ISTREAMLISTENER_IID);
|
||||
@ -183,7 +197,7 @@ ImageConsumer::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
ImageConsumer::OnStartRequest(nsISupports* aContext)
|
||||
ImageConsumer::OnStartRequest(nsIChannel* channel, nsISupports* aContext)
|
||||
#else
|
||||
ImageConsumer::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
#endif
|
||||
@ -216,7 +230,7 @@ ImageConsumer::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
ImageConsumer::OnDataAvailable(nsISupports* aContext, nsIInputStream *pIStream,
|
||||
ImageConsumer::OnDataAvailable(nsIChannel* channel, nsISupports* aContext, nsIInputStream *pIStream,
|
||||
PRUint32 offset, PRUint32 length)
|
||||
#else
|
||||
ImageConsumer::OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUint32 length)
|
||||
@ -309,14 +323,19 @@ ImageConsumer::KeepPumpingStream(nsITimer *aTimer, void *aClosure)
|
||||
if (consumer->mURL) {
|
||||
consumer->mURL->QueryInterface(kIURLIID, (void**)&url);
|
||||
}
|
||||
#ifdef NECKO
|
||||
consumer->OnStopRequest(consumer->mChannel, consumer->mUserContext,
|
||||
NS_BINDING_SUCCEEDED, status.GetUnicode());
|
||||
#else
|
||||
consumer->OnStopRequest(url, NS_BINDING_SUCCEEDED, status.GetUnicode());
|
||||
#endif
|
||||
|
||||
NS_IF_RELEASE(url);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
ImageConsumer::OnStopRequest(nsISupports* aContext, nsresult status, const PRUnichar* aMsg)
|
||||
ImageConsumer::OnStopRequest(nsIChannel* channel, nsISupports* aContext, nsresult status, const PRUnichar* aMsg)
|
||||
#else
|
||||
ImageConsumer::OnStopRequest(nsIURI* aURL, nsresult status, const PRUnichar* aMsg)
|
||||
#endif
|
||||
@ -336,7 +355,8 @@ ImageConsumer::OnStopRequest(nsIURI* aURL, nsresult status, const PRUnichar* aMs
|
||||
nsresult err = mStream->GetLength(&str_length);
|
||||
if (err == NS_OK) {
|
||||
#ifdef NECKO
|
||||
err = OnDataAvailable(aContext, mStream, 0, str_length); // XXX fix offset
|
||||
err = OnDataAvailable(channel, aContext, mStream, 0, str_length); // XXX fix offset
|
||||
SetKeepPumpingData(channel, aContext);
|
||||
#else
|
||||
err = OnDataAvailable(aURL, mStream, str_length);
|
||||
#endif
|
||||
@ -392,6 +412,10 @@ ImageConsumer::~ImageConsumer()
|
||||
if (mBuffer != nsnull) {
|
||||
PR_DELETE(mBuffer);
|
||||
}
|
||||
#ifdef NECKO
|
||||
NS_IF_RELEASE(mChannel);
|
||||
NS_IF_RELEASE(mUserContext);
|
||||
#endif
|
||||
}
|
||||
|
||||
ImageNetContextImpl::ImageNetContextImpl(NET_ReloadMethod aReloadPolicy,
|
||||
|
@ -134,8 +134,8 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt) { return NS_OK; }
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt) { return NS_OK; }
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
#else
|
||||
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 Progress, PRUint32 ProgressMax) { return NS_OK; }
|
||||
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg) { return NS_OK; }
|
||||
@ -145,7 +145,8 @@ public:
|
||||
};
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP CStreamListener::OnStopRequest(nsISupports* aContext, nsresult status, const PRUnichar* aMsg)
|
||||
NS_IMETHODIMP CStreamListener::OnStopRequest(nsIChannel* channel, nsISupports* aContext,
|
||||
nsresult status, const PRUnichar* aMsg)
|
||||
#else
|
||||
NS_IMETHODIMP CStreamListener::OnStopRequest(nsIURI* aURL, nsresult status, const PRUnichar* aMsg)
|
||||
#endif
|
||||
|
@ -970,7 +970,7 @@ nsresult nsParser::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo){
|
||||
*/
|
||||
nsresult
|
||||
#ifdef NECKO
|
||||
nsParser::OnProgress(nsISupports* aContext, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
nsParser::OnProgress(nsIChannel* channel, nsISupports* aContext, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#else
|
||||
nsParser::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#endif
|
||||
@ -978,7 +978,7 @@ nsParser::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
nsresult result=0;
|
||||
#ifdef NECKO
|
||||
if (nsnull != mProgressEventSink) {
|
||||
mProgressEventSink->OnProgress(aContext, aProgress, aProgressMax);
|
||||
mProgressEventSink->OnProgress(channel, aContext, aProgress, aProgressMax);
|
||||
}
|
||||
#else
|
||||
if (nsnull != mObserver) {
|
||||
@ -997,7 +997,7 @@ nsParser::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
*/
|
||||
nsresult
|
||||
#ifdef NECKO
|
||||
nsParser::OnStatus(nsISupports* aContext, const PRUnichar* aMsg)
|
||||
nsParser::OnStatus(nsIChannel* channel, nsISupports* aContext, const PRUnichar* aMsg)
|
||||
#else
|
||||
nsParser::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
#endif
|
||||
@ -1005,7 +1005,7 @@ nsParser::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
nsresult result=0;
|
||||
#ifdef NECKO
|
||||
if (nsnull != mProgressEventSink) {
|
||||
mProgressEventSink->OnStatus(aContext, aMsg);
|
||||
mProgressEventSink->OnStatus(channel, aContext, aMsg);
|
||||
}
|
||||
#else
|
||||
if (nsnull != mObserver) {
|
||||
@ -1028,7 +1028,7 @@ nsParser::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
* @return error code -- 0 if ok, non-zero if error.
|
||||
*/
|
||||
#ifdef NECKO
|
||||
nsresult nsParser::OnStartRequest(nsISupports* aContext)
|
||||
nsresult nsParser::OnStartRequest(nsIChannel* channel, nsISupports* aContext)
|
||||
#else
|
||||
nsresult nsParser::OnStartRequest(nsIURI* aURL, const char *aSourceType)
|
||||
#endif
|
||||
@ -1037,7 +1037,7 @@ nsresult nsParser::OnStartRequest(nsIURI* aURL, const char *aSourceType)
|
||||
|
||||
if (nsnull != mObserver) {
|
||||
#ifdef NECKO
|
||||
mObserver->OnStartRequest(aContext);
|
||||
mObserver->OnStartRequest(channel, aContext);
|
||||
#else
|
||||
mObserver->OnStartRequest(aURL, aSourceType);
|
||||
#endif
|
||||
@ -1047,18 +1047,13 @@ nsresult nsParser::OnStartRequest(nsIURI* aURL, const char *aSourceType)
|
||||
mParserContext->mDTD=0;
|
||||
#ifdef NECKO
|
||||
nsresult rv;
|
||||
nsIChannel* channel;
|
||||
rv = aContext->QueryInterface(nsIChannel::GetIID(), (void**)&channel);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
char* contentType;
|
||||
rv = channel->GetContentType(&contentType);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_ASSERTION(contentType, "parser needs a content type to find a dtd");
|
||||
}
|
||||
mParserContext->mSourceType = contentType;
|
||||
nsCRT::free(contentType);
|
||||
NS_RELEASE(channel);
|
||||
char* contentType;
|
||||
rv = channel->GetContentType(&contentType);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_ASSERTION(contentType, "parser needs a content type to find a dtd");
|
||||
}
|
||||
mParserContext->mSourceType = contentType;
|
||||
nsCRT::free(contentType);
|
||||
#else
|
||||
mParserContext->mSourceType=aSourceType;
|
||||
#endif
|
||||
@ -1079,7 +1074,8 @@ nsresult nsParser::OnStartRequest(nsIURI* aURL, const char *aSourceType)
|
||||
* @return error code (usually 0)
|
||||
*/
|
||||
#ifdef NECKO
|
||||
nsresult nsParser::OnDataAvailable(nsISupports* aContext, nsIInputStream *pIStream, PRUint32 sourceOffset, PRUint32 aLength)
|
||||
nsresult nsParser::OnDataAvailable(nsIChannel* channel, nsISupports* aContext,
|
||||
nsIInputStream *pIStream, PRUint32 sourceOffset, PRUint32 aLength)
|
||||
#else
|
||||
nsresult nsParser::OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUint32 aLength)
|
||||
#endif
|
||||
@ -1152,7 +1148,8 @@ nsresult nsParser::OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUin
|
||||
* @return
|
||||
*/
|
||||
#ifdef NECKO
|
||||
nsresult nsParser::OnStopRequest(nsISupports* aContext, nsresult status, const PRUnichar* aMsg)
|
||||
nsresult nsParser::OnStopRequest(nsIChannel* channel, nsISupports* aContext,
|
||||
nsresult status, const PRUnichar* aMsg)
|
||||
#else
|
||||
nsresult nsParser::OnStopRequest(nsIURI* aURL, nsresult status, const PRUnichar* aMsg)
|
||||
#endif
|
||||
@ -1172,7 +1169,7 @@ nsresult nsParser::OnStopRequest(nsIURI* aURL, nsresult status, const PRUnichar*
|
||||
// parser isn't yet enabled?
|
||||
if (nsnull != mObserver) {
|
||||
#ifdef NECKO
|
||||
mObserver->OnStopRequest(aContext, status, aMsg);
|
||||
mObserver->OnStopRequest(channel, aContext, status, aMsg);
|
||||
#else
|
||||
mObserver->OnStopRequest(aURL, status, aMsg);
|
||||
#endif
|
||||
|
@ -241,13 +241,13 @@ friend class CTokenHandler;
|
||||
//*********************************************
|
||||
#ifdef NECKO
|
||||
// nsIProgressEventSink methods:
|
||||
NS_IMETHOD OnProgress(nsISupports* context, PRUint32 Progress, PRUint32 ProgressMax);
|
||||
NS_IMETHOD OnStatus(nsISupports* context, const PRUnichar* aMmsg);
|
||||
NS_IMETHOD OnProgress(nsIChannel* channel, nsISupports* context, PRUint32 Progress, PRUint32 ProgressMax);
|
||||
NS_IMETHOD OnStatus(nsIChannel* channel, nsISupports* context, const PRUnichar* aMmsg);
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
#else
|
||||
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
|
||||
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 Progress, PRUint32 ProgressMax);
|
||||
|
@ -64,10 +64,10 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
#else
|
||||
// nsIStreamListener
|
||||
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
|
||||
@ -605,18 +605,15 @@ NS_IMPL_ISUPPORTS(PluginListener, kIStreamListenerIID)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
PluginListener::OnStartRequest(nsISupports *ctxt)
|
||||
PluginListener::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
#else
|
||||
PluginListener::OnStartRequest(nsIURI* aURL, const char *contentType)
|
||||
#endif
|
||||
{
|
||||
#ifdef NECKO
|
||||
nsresult rv;
|
||||
nsIChannel* channel;
|
||||
char* contentType = nsnull;
|
||||
|
||||
rv = ctxt->QueryInterface(nsIChannel::GetIID(), (void**)&channel);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = channel->GetContentType(&contentType);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(channel);
|
||||
@ -632,7 +629,7 @@ PluginListener::OnStartRequest(nsIURI* aURL, const char *contentType)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#ifdef NECKO
|
||||
return mNextStream->OnStartRequest(ctxt);
|
||||
return mNextStream->OnStartRequest(channel, ctxt);
|
||||
#else
|
||||
return mNextStream->OnStartRequest(aURL, contentType);
|
||||
#endif
|
||||
@ -661,7 +658,8 @@ PluginListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
PluginListener::OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg)
|
||||
PluginListener::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg)
|
||||
#else
|
||||
PluginListener::OnStopRequest(nsIURI* aURL, nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
@ -671,7 +669,7 @@ PluginListener::OnStopRequest(nsIURI* aURL, nsresult aStatus,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#ifdef NECKO
|
||||
return mNextStream->OnStopRequest(ctxt, status, errorMsg);
|
||||
return mNextStream->OnStopRequest(channel, ctxt, status, errorMsg);
|
||||
#else
|
||||
return mNextStream->OnStopRequest(aURL, aStatus, aMsg);
|
||||
#endif
|
||||
@ -690,7 +688,8 @@ PluginListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
PluginListener::OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count)
|
||||
PluginListener::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count)
|
||||
#else
|
||||
PluginListener::OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
|
||||
PRUint32 aCount)
|
||||
@ -700,7 +699,7 @@ PluginListener::OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#ifdef NECKO
|
||||
return mNextStream->OnDataAvailable(ctxt, inStr, sourceOffset, count);
|
||||
return mNextStream->OnDataAvailable(channel, ctxt, inStr, sourceOffset, count);
|
||||
#else
|
||||
return mNextStream->OnDataAvailable(aURL, aStream, aCount);
|
||||
#endif
|
||||
|
@ -27,10 +27,7 @@
|
||||
#include "nsIStreamListener.h"
|
||||
#include "nsIURL.h"
|
||||
#ifdef NECKO
|
||||
#include "nsIIOService.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIServiceManager.h"
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
#include "nsNeckoUtil.h"
|
||||
#endif // NECKO
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIView.h"
|
||||
@ -77,8 +74,8 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
#else
|
||||
// nsIStreamObserver
|
||||
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
|
||||
@ -710,22 +707,8 @@ void TempMakeAbsURL(nsIContent* aContent, nsString& aRelURL, nsString& aAbsURL)
|
||||
#ifndef NECKO
|
||||
NS_MakeAbsoluteURL(baseURL, empty, aRelURL, aAbsURL);
|
||||
#else
|
||||
nsresult result;
|
||||
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &result);
|
||||
if (NS_FAILED(result)) return;
|
||||
|
||||
nsIURI *baseUri = nsnull;
|
||||
result = baseURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
|
||||
if (NS_FAILED(result)) return;
|
||||
|
||||
char *absUrlStr = nsnull;
|
||||
char *urlSpec = aRelURL.ToNewCString();
|
||||
if (!urlSpec) return NS_ERROR_OUT_OF_MEMORY;
|
||||
result = service->MakeAbsolute(urlSpec, baseUri, &absUrlStr);
|
||||
NS_RELEASE(baseUri);
|
||||
aAbsURL= absUrlStr;
|
||||
nsCRT::free(urlSpec);
|
||||
delete [] absUrlStr;
|
||||
nsresult rv = NS_MakeAbsoluteURI(aRelURL, baseURL, aAbsURL);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "XXX make this function return an nsresult, like it should!");
|
||||
#endif // NECKO
|
||||
NS_IF_RELEASE(baseURL);
|
||||
}
|
||||
@ -1111,7 +1094,7 @@ TempObserver::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
TempObserver::OnStartRequest(nsISupports *ctxt)
|
||||
TempObserver::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
#else
|
||||
TempObserver::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
#endif
|
||||
@ -1126,7 +1109,8 @@ TempObserver::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
TempObserver::OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg)
|
||||
TempObserver::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg)
|
||||
#else
|
||||
TempObserver::OnStopRequest(nsIURI* aURL, nsresult status, const PRUnichar* aMsg)
|
||||
#endif
|
||||
|
@ -20,10 +20,7 @@
|
||||
#include "nsFrame.h"
|
||||
#include "nsIURL.h"
|
||||
#ifdef NECKO
|
||||
#include "nsIIOService.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIServiceManager.h"
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
#include "nsNeckoUtil.h"
|
||||
#endif // NECKO
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -85,21 +82,7 @@ nsHTMLImageLoader::SetURL(const nsString& aNewSpec)
|
||||
#ifndef NECKO
|
||||
rv = NS_MakeAbsoluteURL(mBaseURL, empty, mURLSpec, mURL);
|
||||
#else
|
||||
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) return;
|
||||
|
||||
nsIURI *baseUri = nsnull;
|
||||
rv = mBaseURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
|
||||
if (NS_FAILED(rv)) return;
|
||||
|
||||
char *absUrl = nsnull;
|
||||
char *urlSpec = mURLSpec.ToNewCString();
|
||||
if (!urlSpec) return NS_ERROR_OUT_OF_MEMORY;
|
||||
rv = service->MakeAbsolute(urlSpec, baseUri, &absUrl);
|
||||
NS_RELEASE(baseUri);
|
||||
nsCRT::free(urlSpec);
|
||||
mURL = absUrl;
|
||||
delete [] absUrl;
|
||||
rv = NS_MakeAbsoluteURI(mURLSpec, mBaseURL, mURL);
|
||||
#endif // NECKO
|
||||
if (NS_FAILED(rv)) {
|
||||
mURL = mURLSpec;
|
||||
|
@ -27,10 +27,7 @@
|
||||
#include "nsIStreamListener.h"
|
||||
#include "nsIURL.h"
|
||||
#ifdef NECKO
|
||||
#include "nsIIOService.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIServiceManager.h"
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
#include "nsNeckoUtil.h"
|
||||
#endif // NECKO
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIView.h"
|
||||
@ -77,8 +74,8 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
#else
|
||||
// nsIStreamObserver
|
||||
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
|
||||
@ -710,22 +707,8 @@ void TempMakeAbsURL(nsIContent* aContent, nsString& aRelURL, nsString& aAbsURL)
|
||||
#ifndef NECKO
|
||||
NS_MakeAbsoluteURL(baseURL, empty, aRelURL, aAbsURL);
|
||||
#else
|
||||
nsresult result;
|
||||
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &result);
|
||||
if (NS_FAILED(result)) return;
|
||||
|
||||
nsIURI *baseUri = nsnull;
|
||||
result = baseURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
|
||||
if (NS_FAILED(result)) return;
|
||||
|
||||
char *absUrlStr = nsnull;
|
||||
char *urlSpec = aRelURL.ToNewCString();
|
||||
if (!urlSpec) return NS_ERROR_OUT_OF_MEMORY;
|
||||
result = service->MakeAbsolute(urlSpec, baseUri, &absUrlStr);
|
||||
NS_RELEASE(baseUri);
|
||||
aAbsURL= absUrlStr;
|
||||
nsCRT::free(urlSpec);
|
||||
delete [] absUrlStr;
|
||||
nsresult rv = NS_MakeAbsoluteURI(aRelURL, baseURL, aAbsURL);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "XXX make this function return an nsresult, like it should!");
|
||||
#endif // NECKO
|
||||
NS_IF_RELEASE(baseURL);
|
||||
}
|
||||
@ -1111,7 +1094,7 @@ TempObserver::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
TempObserver::OnStartRequest(nsISupports *ctxt)
|
||||
TempObserver::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
#else
|
||||
TempObserver::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
#endif
|
||||
@ -1126,7 +1109,8 @@ TempObserver::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
TempObserver::OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg)
|
||||
TempObserver::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg)
|
||||
#else
|
||||
TempObserver::OnStopRequest(nsIURI* aURL, nsresult status, const PRUnichar* aMsg)
|
||||
#endif
|
||||
|
@ -91,10 +91,10 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
#else
|
||||
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
|
||||
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
@ -127,16 +127,13 @@ NS_IMPL_ISUPPORTS(ImageListener, kIStreamListenerIID)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
ImageListener::OnStartRequest(nsISupports *ctxt)
|
||||
ImageListener::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
#else
|
||||
ImageListener::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
#endif
|
||||
{
|
||||
#ifdef NECKO
|
||||
nsresult rv;
|
||||
nsIChannel* channel;
|
||||
rv = ctxt->QueryInterface(nsIChannel::GetIID(), (void**)&channel);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsIURI* uri;
|
||||
rv = channel->GetURI(&uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -151,7 +148,7 @@ ImageListener::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#ifdef NECKO
|
||||
return mNextStream->OnStartRequest(ctxt);
|
||||
return mNextStream->OnStartRequest(channel, ctxt);
|
||||
#else
|
||||
return mNextStream->OnStartRequest(aURL, aContentType);
|
||||
#endif
|
||||
@ -180,8 +177,8 @@ ImageListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
ImageListener::OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg)
|
||||
ImageListener::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg)
|
||||
#else
|
||||
ImageListener::OnStopRequest(nsIURI* aURL, nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
@ -192,7 +189,7 @@ ImageListener::OnStopRequest(nsIURI* aURL, nsresult aStatus,
|
||||
}
|
||||
#ifdef NECKO
|
||||
mDocument->EndLayout(ctxt, status, errorMsg);
|
||||
return mNextStream->OnStopRequest(ctxt, status, errorMsg);
|
||||
return mNextStream->OnStopRequest(channel, ctxt, status, errorMsg);
|
||||
#else
|
||||
mDocument->EndLayout(aURL, aStatus, aMsg);
|
||||
return mNextStream->OnStopRequest(aURL, aStatus, aMsg);
|
||||
@ -212,8 +209,8 @@ ImageListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
ImageListener::OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr,
|
||||
PRUint32 sourceOffset, PRUint32 count)
|
||||
ImageListener::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count)
|
||||
#else
|
||||
ImageListener::OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
|
||||
PRUint32 aCount)
|
||||
@ -223,7 +220,7 @@ ImageListener::OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#ifdef NECKO
|
||||
return mNextStream->OnDataAvailable(ctxt, inStr, sourceOffset, count);
|
||||
return mNextStream->OnDataAvailable(channel, ctxt, inStr, sourceOffset, count);
|
||||
#else
|
||||
return mNextStream->OnDataAvailable(aURL, aStream, aCount);
|
||||
#endif
|
||||
|
@ -1596,7 +1596,7 @@ NS_IMPL_RELEASE(EnderTempObserver);
|
||||
|
||||
nsresult
|
||||
EnderTempObserver::QueryInterface(const nsIID& aIID,
|
||||
void** aInstancePtrResult)
|
||||
void** aInstancePtrResult)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null pointer");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
@ -1632,7 +1632,7 @@ EnderTempObserver::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
EnderTempObserver::OnStartRequest(nsISupports *ctxt)
|
||||
EnderTempObserver::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
#else
|
||||
EnderTempObserver::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
#endif
|
||||
@ -1642,7 +1642,7 @@ EnderTempObserver::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
EnderTempObserver::OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
EnderTempObserver::OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg)
|
||||
#else
|
||||
EnderTempObserver::OnStopRequest(nsIURI* aURL, nsresult status, const PRUnichar* aMsg)
|
||||
|
@ -55,8 +55,8 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
#else
|
||||
// nsIStreamObserver
|
||||
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "nsIChannel.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsNeckoUtil.h"
|
||||
#include "nsIProgressEventSink.h"
|
||||
#endif // NECKO
|
||||
|
||||
#include "nsIServiceManager.h"
|
||||
@ -380,6 +381,9 @@ nsPluginStreamInfo::SetURL(const char* url)
|
||||
class nsPluginCacheListener;
|
||||
|
||||
class nsPluginStreamListenerPeer : public nsIStreamListener
|
||||
#ifdef NECKO
|
||||
, public nsIProgressEventSink
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
nsPluginStreamListenerPeer();
|
||||
@ -389,13 +393,17 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIProgressEventSink methods:
|
||||
NS_IMETHOD OnProgress(nsISupports* context, PRUint32 Progress, PRUint32 ProgressMax);
|
||||
NS_IMETHOD OnStatus(nsISupports* context, const PRUnichar* aMmsg);
|
||||
NS_IMETHOD OnProgress(nsIChannel* channel, nsISupports* context,
|
||||
PRUint32 Progress, PRUint32 ProgressMax);
|
||||
NS_IMETHOD OnStatus(nsIChannel* channel, nsISupports* context,
|
||||
const PRUnichar* aMmsg);
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg);
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
|
||||
#else
|
||||
//nsIStreamObserver interface
|
||||
@ -472,18 +480,13 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIProgressEventSink methods
|
||||
NS_IMETHOD OnProgress(nsISupports* context, PRUint32 progress,
|
||||
PRUint32 maxProgress);
|
||||
NS_IMETHOD OnStatus(nsISupports* context, const PRUnichar* aMsg);
|
||||
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg);
|
||||
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr,
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt, nsIInputStream *inStr,
|
||||
PRUint32 sourceOffset, PRUint32 count);
|
||||
|
||||
#else
|
||||
@ -559,19 +562,15 @@ NS_IMPL_ISUPPORTS(nsPluginCacheListener, kIStreamListenerIID);
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP
|
||||
nsPluginCacheListener::OnStartRequest(nsISupports* ctxt)
|
||||
nsPluginCacheListener::OnStartRequest(nsIChannel* channel, nsISupports* ctxt)
|
||||
{
|
||||
char* aContentType = nsnull;
|
||||
nsIURI* aURL = nsnull;
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<nsIChannel> channel(do_QueryInterface(ctxt));
|
||||
if (channel)
|
||||
{
|
||||
rv = channel->GetContentType(&aContentType);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = channel->GetURI(&aURL);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
rv = channel->GetContentType(&aContentType);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = channel->GetURI(&aURL);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
// I have delibrately left out the remaining processing.
|
||||
// which should just be copied over from the other version of
|
||||
// OnStartRequest.
|
||||
@ -647,23 +646,21 @@ nsPluginCacheListener::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
}
|
||||
#endif // NECKO
|
||||
|
||||
#ifndef NECKO
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsPluginCacheListener::OnProgress(nsISupports* ctxt, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#else
|
||||
nsPluginCacheListener::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#endif
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsPluginCacheListener::OnDataAvailable(nsISupports* ctxt,
|
||||
nsIInputStream* aIStream,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 aLength)
|
||||
nsPluginCacheListener::OnDataAvailable(nsIChannel* channel, nsISupports* ctxt,
|
||||
nsIInputStream* aIStream,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 aLength)
|
||||
#else
|
||||
nsPluginCacheListener::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, PRUint32 aLength)
|
||||
#endif
|
||||
@ -692,9 +689,8 @@ nsPluginCacheListener::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, P
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsPluginCacheListener::OnStopRequest(nsISupports* aContext,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
nsPluginCacheListener::OnStopRequest(nsIChannel* channel, nsISupports* aContext,
|
||||
nsresult aStatus, const PRUnichar* aMsg)
|
||||
#else
|
||||
nsPluginCacheListener::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
|
||||
#endif // NECKO
|
||||
@ -740,18 +736,14 @@ nsPluginCacheListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
|
||||
// not used
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsPluginCacheListener::OnStatus(nsISupports* aContext, const PRUnichar* aMsg)
|
||||
#else
|
||||
nsPluginCacheListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
#endif // NECKO
|
||||
{
|
||||
// not used
|
||||
return NS_OK;
|
||||
}
|
||||
#endif // !NECKO
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -930,7 +922,8 @@ nsresult nsPluginStreamListenerPeer::InitializeFullPage(nsIPluginInstance *aInst
|
||||
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartRequest(nsISupports* aContext)
|
||||
NS_IMETHODIMP
|
||||
nsPluginStreamListenerPeer::OnStartRequest(nsIChannel* channel, nsISupports* aContext)
|
||||
#else
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
#endif
|
||||
@ -938,9 +931,6 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartRequest(nsIURI* aURL, const cha
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aContext));
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
|
||||
char* aContentType = nsnull;
|
||||
rv = channel->GetContentType(&aContentType);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -997,10 +987,10 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartRequest(nsIURI* aURL, const cha
|
||||
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnProgress(
|
||||
nsISupports* aContext,
|
||||
PRUint32 aProgress,
|
||||
PRUint32 aProgressMax)
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnProgress(nsIChannel* channel,
|
||||
nsISupports* aContext,
|
||||
PRUint32 aProgress,
|
||||
PRUint32 aProgressMax)
|
||||
#else
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#endif
|
||||
@ -1008,28 +998,22 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnProgress(nsIURI* aURL, PRUint32 aPro
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel (do_QueryInterface(aContext));
|
||||
if (channel)
|
||||
{
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
mPluginStreamInfo->SetLength(aProgressMax);
|
||||
if(mOnStartRequest == PR_TRUE && mSetUpListener == PR_FALSE)
|
||||
rv = SetUpStreamListener(aURL);
|
||||
|
||||
mGotProgress = PR_TRUE;
|
||||
#ifdef NECKO
|
||||
}
|
||||
#endif
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStatus(
|
||||
nsISupports* aContext, const PRUnichar* aMsg)
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStatus(nsIChannel* channel,
|
||||
nsISupports* aContext, const PRUnichar* aMsg)
|
||||
#else
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
#endif
|
||||
@ -1046,11 +1030,11 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::GetBindInfo(nsIURI* aURL, nsStreamBind
|
||||
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(
|
||||
nsISupports* aContext,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 aLength)
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIChannel* channel,
|
||||
nsISupports* aContext,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 aLength)
|
||||
#else
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream,
|
||||
PRUint32 aLength)
|
||||
@ -1058,9 +1042,6 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInput
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel (do_QueryInterface(aContext));
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -1102,22 +1083,19 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInput
|
||||
}
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(
|
||||
nsISupports* aContext,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIChannel* channel,
|
||||
nsISupports* aContext,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
#else
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
|
||||
#endif // NECKO
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aContext));
|
||||
if (channel)
|
||||
{
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif // NECKO
|
||||
nsPluginReason reason = nsPluginReason_NoReason;
|
||||
|
||||
@ -1142,9 +1120,6 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIURI* aURL, nsresult a
|
||||
}
|
||||
|
||||
mOnStopRequest = PR_TRUE;
|
||||
#ifdef NECKO
|
||||
}
|
||||
#endif
|
||||
return rv;
|
||||
|
||||
}
|
||||
|
@ -64,10 +64,10 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
#else
|
||||
// nsIStreamListener
|
||||
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
|
||||
@ -605,18 +605,15 @@ NS_IMPL_ISUPPORTS(PluginListener, kIStreamListenerIID)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
PluginListener::OnStartRequest(nsISupports *ctxt)
|
||||
PluginListener::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
#else
|
||||
PluginListener::OnStartRequest(nsIURI* aURL, const char *contentType)
|
||||
#endif
|
||||
{
|
||||
#ifdef NECKO
|
||||
nsresult rv;
|
||||
nsIChannel* channel;
|
||||
char* contentType = nsnull;
|
||||
|
||||
rv = ctxt->QueryInterface(nsIChannel::GetIID(), (void**)&channel);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = channel->GetContentType(&contentType);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(channel);
|
||||
@ -632,7 +629,7 @@ PluginListener::OnStartRequest(nsIURI* aURL, const char *contentType)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#ifdef NECKO
|
||||
return mNextStream->OnStartRequest(ctxt);
|
||||
return mNextStream->OnStartRequest(channel, ctxt);
|
||||
#else
|
||||
return mNextStream->OnStartRequest(aURL, contentType);
|
||||
#endif
|
||||
@ -661,7 +658,8 @@ PluginListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
PluginListener::OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg)
|
||||
PluginListener::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg)
|
||||
#else
|
||||
PluginListener::OnStopRequest(nsIURI* aURL, nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
@ -671,7 +669,7 @@ PluginListener::OnStopRequest(nsIURI* aURL, nsresult aStatus,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#ifdef NECKO
|
||||
return mNextStream->OnStopRequest(ctxt, status, errorMsg);
|
||||
return mNextStream->OnStopRequest(channel, ctxt, status, errorMsg);
|
||||
#else
|
||||
return mNextStream->OnStopRequest(aURL, aStatus, aMsg);
|
||||
#endif
|
||||
@ -690,7 +688,8 @@ PluginListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
PluginListener::OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count)
|
||||
PluginListener::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count)
|
||||
#else
|
||||
PluginListener::OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
|
||||
PRUint32 aCount)
|
||||
@ -700,7 +699,7 @@ PluginListener::OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#ifdef NECKO
|
||||
return mNextStream->OnDataAvailable(ctxt, inStr, sourceOffset, count);
|
||||
return mNextStream->OnDataAvailable(channel, ctxt, inStr, sourceOffset, count);
|
||||
#else
|
||||
return mNextStream->OnDataAvailable(aURL, aStream, aCount);
|
||||
#endif
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "nsIChannel.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsNeckoUtil.h"
|
||||
#include "nsIProgressEventSink.h"
|
||||
#endif // NECKO
|
||||
|
||||
#include "nsIServiceManager.h"
|
||||
@ -380,6 +381,9 @@ nsPluginStreamInfo::SetURL(const char* url)
|
||||
class nsPluginCacheListener;
|
||||
|
||||
class nsPluginStreamListenerPeer : public nsIStreamListener
|
||||
#ifdef NECKO
|
||||
, public nsIProgressEventSink
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
nsPluginStreamListenerPeer();
|
||||
@ -389,13 +393,17 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIProgressEventSink methods:
|
||||
NS_IMETHOD OnProgress(nsISupports* context, PRUint32 Progress, PRUint32 ProgressMax);
|
||||
NS_IMETHOD OnStatus(nsISupports* context, const PRUnichar* aMmsg);
|
||||
NS_IMETHOD OnProgress(nsIChannel* channel, nsISupports* context,
|
||||
PRUint32 Progress, PRUint32 ProgressMax);
|
||||
NS_IMETHOD OnStatus(nsIChannel* channel, nsISupports* context,
|
||||
const PRUnichar* aMmsg);
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg);
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
|
||||
#else
|
||||
//nsIStreamObserver interface
|
||||
@ -472,18 +480,13 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIProgressEventSink methods
|
||||
NS_IMETHOD OnProgress(nsISupports* context, PRUint32 progress,
|
||||
PRUint32 maxProgress);
|
||||
NS_IMETHOD OnStatus(nsISupports* context, const PRUnichar* aMsg);
|
||||
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg);
|
||||
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr,
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt, nsIInputStream *inStr,
|
||||
PRUint32 sourceOffset, PRUint32 count);
|
||||
|
||||
#else
|
||||
@ -559,19 +562,15 @@ NS_IMPL_ISUPPORTS(nsPluginCacheListener, kIStreamListenerIID);
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP
|
||||
nsPluginCacheListener::OnStartRequest(nsISupports* ctxt)
|
||||
nsPluginCacheListener::OnStartRequest(nsIChannel* channel, nsISupports* ctxt)
|
||||
{
|
||||
char* aContentType = nsnull;
|
||||
nsIURI* aURL = nsnull;
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<nsIChannel> channel(do_QueryInterface(ctxt));
|
||||
if (channel)
|
||||
{
|
||||
rv = channel->GetContentType(&aContentType);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = channel->GetURI(&aURL);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
rv = channel->GetContentType(&aContentType);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = channel->GetURI(&aURL);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
// I have delibrately left out the remaining processing.
|
||||
// which should just be copied over from the other version of
|
||||
// OnStartRequest.
|
||||
@ -647,23 +646,21 @@ nsPluginCacheListener::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
}
|
||||
#endif // NECKO
|
||||
|
||||
#ifndef NECKO
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsPluginCacheListener::OnProgress(nsISupports* ctxt, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#else
|
||||
nsPluginCacheListener::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#endif
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsPluginCacheListener::OnDataAvailable(nsISupports* ctxt,
|
||||
nsIInputStream* aIStream,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 aLength)
|
||||
nsPluginCacheListener::OnDataAvailable(nsIChannel* channel, nsISupports* ctxt,
|
||||
nsIInputStream* aIStream,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 aLength)
|
||||
#else
|
||||
nsPluginCacheListener::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, PRUint32 aLength)
|
||||
#endif
|
||||
@ -692,9 +689,8 @@ nsPluginCacheListener::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, P
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsPluginCacheListener::OnStopRequest(nsISupports* aContext,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
nsPluginCacheListener::OnStopRequest(nsIChannel* channel, nsISupports* aContext,
|
||||
nsresult aStatus, const PRUnichar* aMsg)
|
||||
#else
|
||||
nsPluginCacheListener::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
|
||||
#endif // NECKO
|
||||
@ -740,18 +736,14 @@ nsPluginCacheListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
|
||||
// not used
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsPluginCacheListener::OnStatus(nsISupports* aContext, const PRUnichar* aMsg)
|
||||
#else
|
||||
nsPluginCacheListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
#endif // NECKO
|
||||
{
|
||||
// not used
|
||||
return NS_OK;
|
||||
}
|
||||
#endif // !NECKO
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -930,7 +922,8 @@ nsresult nsPluginStreamListenerPeer::InitializeFullPage(nsIPluginInstance *aInst
|
||||
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartRequest(nsISupports* aContext)
|
||||
NS_IMETHODIMP
|
||||
nsPluginStreamListenerPeer::OnStartRequest(nsIChannel* channel, nsISupports* aContext)
|
||||
#else
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
#endif
|
||||
@ -938,9 +931,6 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartRequest(nsIURI* aURL, const cha
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aContext));
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
|
||||
char* aContentType = nsnull;
|
||||
rv = channel->GetContentType(&aContentType);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -997,10 +987,10 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartRequest(nsIURI* aURL, const cha
|
||||
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnProgress(
|
||||
nsISupports* aContext,
|
||||
PRUint32 aProgress,
|
||||
PRUint32 aProgressMax)
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnProgress(nsIChannel* channel,
|
||||
nsISupports* aContext,
|
||||
PRUint32 aProgress,
|
||||
PRUint32 aProgressMax)
|
||||
#else
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#endif
|
||||
@ -1008,28 +998,22 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnProgress(nsIURI* aURL, PRUint32 aPro
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel (do_QueryInterface(aContext));
|
||||
if (channel)
|
||||
{
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
mPluginStreamInfo->SetLength(aProgressMax);
|
||||
if(mOnStartRequest == PR_TRUE && mSetUpListener == PR_FALSE)
|
||||
rv = SetUpStreamListener(aURL);
|
||||
|
||||
mGotProgress = PR_TRUE;
|
||||
#ifdef NECKO
|
||||
}
|
||||
#endif
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStatus(
|
||||
nsISupports* aContext, const PRUnichar* aMsg)
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStatus(nsIChannel* channel,
|
||||
nsISupports* aContext, const PRUnichar* aMsg)
|
||||
#else
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
#endif
|
||||
@ -1046,11 +1030,11 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::GetBindInfo(nsIURI* aURL, nsStreamBind
|
||||
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(
|
||||
nsISupports* aContext,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 aLength)
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIChannel* channel,
|
||||
nsISupports* aContext,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 aLength)
|
||||
#else
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream,
|
||||
PRUint32 aLength)
|
||||
@ -1058,9 +1042,6 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInput
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel (do_QueryInterface(aContext));
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -1102,22 +1083,19 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInput
|
||||
}
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(
|
||||
nsISupports* aContext,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIChannel* channel,
|
||||
nsISupports* aContext,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
#else
|
||||
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
|
||||
#endif // NECKO
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aContext));
|
||||
if (channel)
|
||||
{
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif // NECKO
|
||||
nsPluginReason reason = nsPluginReason_NoReason;
|
||||
|
||||
@ -1142,9 +1120,6 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIURI* aURL, nsresult a
|
||||
}
|
||||
|
||||
mOnStopRequest = PR_TRUE;
|
||||
#ifdef NECKO
|
||||
}
|
||||
#endif
|
||||
return rv;
|
||||
|
||||
}
|
||||
|
@ -64,10 +64,10 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
#else
|
||||
// nsIStreamListener
|
||||
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
|
||||
@ -605,18 +605,15 @@ NS_IMPL_ISUPPORTS(PluginListener, kIStreamListenerIID)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
PluginListener::OnStartRequest(nsISupports *ctxt)
|
||||
PluginListener::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
#else
|
||||
PluginListener::OnStartRequest(nsIURI* aURL, const char *contentType)
|
||||
#endif
|
||||
{
|
||||
#ifdef NECKO
|
||||
nsresult rv;
|
||||
nsIChannel* channel;
|
||||
char* contentType = nsnull;
|
||||
|
||||
rv = ctxt->QueryInterface(nsIChannel::GetIID(), (void**)&channel);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = channel->GetContentType(&contentType);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(channel);
|
||||
@ -632,7 +629,7 @@ PluginListener::OnStartRequest(nsIURI* aURL, const char *contentType)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#ifdef NECKO
|
||||
return mNextStream->OnStartRequest(ctxt);
|
||||
return mNextStream->OnStartRequest(channel, ctxt);
|
||||
#else
|
||||
return mNextStream->OnStartRequest(aURL, contentType);
|
||||
#endif
|
||||
@ -661,7 +658,8 @@ PluginListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
PluginListener::OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg)
|
||||
PluginListener::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg)
|
||||
#else
|
||||
PluginListener::OnStopRequest(nsIURI* aURL, nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
@ -671,7 +669,7 @@ PluginListener::OnStopRequest(nsIURI* aURL, nsresult aStatus,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#ifdef NECKO
|
||||
return mNextStream->OnStopRequest(ctxt, status, errorMsg);
|
||||
return mNextStream->OnStopRequest(channel, ctxt, status, errorMsg);
|
||||
#else
|
||||
return mNextStream->OnStopRequest(aURL, aStatus, aMsg);
|
||||
#endif
|
||||
@ -690,7 +688,8 @@ PluginListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
PluginListener::OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count)
|
||||
PluginListener::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count)
|
||||
#else
|
||||
PluginListener::OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
|
||||
PRUint32 aCount)
|
||||
@ -700,7 +699,7 @@ PluginListener::OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#ifdef NECKO
|
||||
return mNextStream->OnDataAvailable(ctxt, inStr, sourceOffset, count);
|
||||
return mNextStream->OnDataAvailable(channel, ctxt, inStr, sourceOffset, count);
|
||||
#else
|
||||
return mNextStream->OnDataAvailable(aURL, aStream, aCount);
|
||||
#endif
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIURI;
|
||||
interface nsIChannel;
|
||||
|
||||
/**
|
||||
* An instance of nsIFfpEventSink should be passed as the eventSink
|
||||
@ -31,13 +32,16 @@ interface nsIProgressEventSink : nsISupports
|
||||
/**
|
||||
* Notify the EventSink that progress as occurred for the URL load.<BR>
|
||||
*/
|
||||
void OnProgress(in nsISupports ctxt,
|
||||
void OnProgress(in nsIChannel channel,
|
||||
in nsISupports ctxt,
|
||||
in unsigned long aProgress,
|
||||
in unsigned long aProgressMax);
|
||||
|
||||
/**
|
||||
* Notify the EventSink with a status message for the URL load.<BR>
|
||||
*/
|
||||
void OnStatus(in nsISupports ctxt, in wstring aMsg);
|
||||
void OnStatus(in nsIChannel channel,
|
||||
in nsISupports ctxt,
|
||||
in wstring aMsg);
|
||||
|
||||
};
|
||||
|
@ -26,7 +26,8 @@ interface nsIEventQueue;
|
||||
[scriptable, uuid(1a637020-1482-11d3-9333-00104ba0fd40)]
|
||||
interface nsIStreamListener : nsIStreamObserver
|
||||
{
|
||||
void OnDataAvailable(in nsISupports ctxt,
|
||||
void OnDataAvailable(in nsIChannel channel,
|
||||
in nsISupports ctxt,
|
||||
in nsIInputStream inStr,
|
||||
in unsigned long sourceOffset,
|
||||
in unsigned long count);
|
||||
|
@ -19,13 +19,16 @@
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIEventQueue;
|
||||
interface nsIChannel;
|
||||
|
||||
[scriptable, uuid(fd91e2e0-1481-11d3-9333-00104ba0fd40)]
|
||||
interface nsIStreamObserver : nsISupports
|
||||
{
|
||||
void OnStartRequest(in nsISupports ctxt);
|
||||
void OnStartRequest(in nsIChannel channel,
|
||||
in nsISupports ctxt);
|
||||
|
||||
void OnStopRequest(in nsISupports ctxt,
|
||||
void OnStopRequest(in nsIChannel channel,
|
||||
in nsISupports ctxt,
|
||||
in nsresult status,
|
||||
in wstring errorMsg);
|
||||
};
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsIEventQueue.h"
|
||||
#include "nsIChannel.h"
|
||||
|
||||
class nsAsyncStreamObserver : public nsIStreamObserver
|
||||
{
|
||||
@ -29,8 +30,10 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports* context);
|
||||
NS_IMETHOD OnStopRequest(nsISupports* context,
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel,
|
||||
nsISupports* context);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel,
|
||||
nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg);
|
||||
|
||||
@ -68,19 +71,21 @@ public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports* context)
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel,
|
||||
nsISupports* context)
|
||||
{
|
||||
return nsAsyncStreamObserver::OnStartRequest(context);
|
||||
return nsAsyncStreamObserver::OnStartRequest(channel, context);
|
||||
}
|
||||
|
||||
NS_IMETHOD OnStopRequest(nsISupports* context,
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel,
|
||||
nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
{
|
||||
return nsAsyncStreamObserver::OnStopRequest(context, aStatus, aMsg);
|
||||
return nsAsyncStreamObserver::OnStopRequest(channel, context, aStatus, aMsg);
|
||||
}
|
||||
|
||||
NS_IMETHOD OnDataAvailable(nsISupports* context,
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength);
|
||||
@ -101,7 +106,7 @@ class nsStreamListenerEvent : public PLEvent
|
||||
{
|
||||
public:
|
||||
nsStreamListenerEvent(nsAsyncStreamObserver* listener,
|
||||
nsISupports* context);
|
||||
nsIChannel* channel, nsISupports* context);
|
||||
virtual ~nsStreamListenerEvent();
|
||||
|
||||
nsresult Fire(nsIEventQueue* aEventQ);
|
||||
@ -113,22 +118,25 @@ protected:
|
||||
static void PR_CALLBACK DestroyPLEvent(PLEvent* aEvent);
|
||||
|
||||
nsAsyncStreamObserver* mListener;
|
||||
nsISupports* mContext;
|
||||
nsIChannel* mChannel;
|
||||
nsISupports* mContext;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsStreamListenerEvent::nsStreamListenerEvent(nsAsyncStreamObserver* listener,
|
||||
nsISupports* context)
|
||||
: mListener(listener), mContext(context)
|
||||
nsIChannel* channel, nsISupports* context)
|
||||
: mListener(listener), mChannel(channel), mContext(context)
|
||||
{
|
||||
NS_ADDREF(mListener);
|
||||
NS_ADDREF(mChannel);
|
||||
NS_IF_ADDREF(mContext);
|
||||
}
|
||||
|
||||
nsStreamListenerEvent::~nsStreamListenerEvent()
|
||||
{
|
||||
NS_RELEASE(mListener);
|
||||
NS_RELEASE(mChannel);
|
||||
NS_IF_RELEASE(mContext);
|
||||
}
|
||||
|
||||
@ -188,8 +196,9 @@ class nsOnStartRequestEvent : public nsStreamListenerEvent
|
||||
{
|
||||
public:
|
||||
nsOnStartRequestEvent(nsAsyncStreamObserver* listener,
|
||||
nsISupports* context)
|
||||
: nsStreamListenerEvent(listener, context), mContentType(nsnull) {}
|
||||
nsIChannel* channel, nsISupports* context)
|
||||
: nsStreamListenerEvent(listener, channel, context),
|
||||
mContentType(nsnull) {}
|
||||
virtual ~nsOnStartRequestEvent();
|
||||
|
||||
NS_IMETHOD HandleEvent();
|
||||
@ -208,17 +217,17 @@ NS_IMETHODIMP
|
||||
nsOnStartRequestEvent::HandleEvent()
|
||||
{
|
||||
nsIStreamObserver* receiver = (nsIStreamObserver*)mListener->GetReceiver();
|
||||
return receiver->OnStartRequest(mContext);
|
||||
return receiver->OnStartRequest(mChannel, mContext);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAsyncStreamObserver::OnStartRequest(nsISupports* context)
|
||||
nsAsyncStreamObserver::OnStartRequest(nsIChannel* channel, nsISupports* context)
|
||||
{
|
||||
nsresult rv = GetStatus();
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsOnStartRequestEvent* event =
|
||||
new nsOnStartRequestEvent(this, context);
|
||||
new nsOnStartRequestEvent(this, channel, context);
|
||||
if (event == nsnull)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
@ -241,8 +250,8 @@ class nsOnStopRequestEvent : public nsStreamListenerEvent
|
||||
{
|
||||
public:
|
||||
nsOnStopRequestEvent(nsAsyncStreamObserver* listener,
|
||||
nsISupports* context)
|
||||
: nsStreamListenerEvent(listener, context),
|
||||
nsISupports* context, nsIChannel* channel)
|
||||
: nsStreamListenerEvent(listener, channel, context),
|
||||
mStatus(NS_OK), mMessage(nsnull) {}
|
||||
virtual ~nsOnStopRequestEvent();
|
||||
|
||||
@ -270,19 +279,19 @@ NS_IMETHODIMP
|
||||
nsOnStopRequestEvent::HandleEvent()
|
||||
{
|
||||
nsIStreamObserver* receiver = (nsIStreamObserver*)mListener->GetReceiver();
|
||||
return receiver->OnStopRequest(mContext, mStatus, mMessage);
|
||||
return receiver->OnStopRequest(mChannel, mContext, mStatus, mMessage);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAsyncStreamObserver::OnStopRequest(nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
nsAsyncStreamObserver::OnStopRequest(nsIChannel* channel, nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
{
|
||||
nsresult rv = GetStatus();
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsOnStopRequestEvent* event =
|
||||
new nsOnStopRequestEvent(this, context);
|
||||
new nsOnStopRequestEvent(this, context, channel);
|
||||
if (event == nsnull)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
@ -307,8 +316,8 @@ class nsOnDataAvailableEvent : public nsStreamListenerEvent
|
||||
{
|
||||
public:
|
||||
nsOnDataAvailableEvent(nsAsyncStreamObserver* listener,
|
||||
nsISupports* context)
|
||||
: nsStreamListenerEvent(listener, context),
|
||||
nsIChannel* channel, nsISupports* context)
|
||||
: nsStreamListenerEvent(listener, channel, context),
|
||||
mIStream(nsnull), mLength(0) {}
|
||||
virtual ~nsOnDataAvailableEvent();
|
||||
|
||||
@ -342,11 +351,12 @@ NS_IMETHODIMP
|
||||
nsOnDataAvailableEvent::HandleEvent()
|
||||
{
|
||||
nsIStreamListener* receiver = (nsIStreamListener*)mListener->GetReceiver();
|
||||
return receiver->OnDataAvailable(mContext, mIStream, mSourceOffset, mLength);
|
||||
return receiver->OnDataAvailable(mChannel, mContext,
|
||||
mIStream, mSourceOffset, mLength);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAsyncStreamListener::OnDataAvailable(nsISupports* context,
|
||||
nsAsyncStreamListener::OnDataAvailable(nsIChannel* channel, nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength)
|
||||
@ -355,7 +365,7 @@ nsAsyncStreamListener::OnDataAvailable(nsISupports* context,
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsOnDataAvailableEvent* event =
|
||||
new nsOnDataAvailableEvent(this, context);
|
||||
new nsOnDataAvailableEvent(this, channel, context);
|
||||
if (event == nsnull)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
|
@ -132,7 +132,7 @@ nsInputStreamChannel::AsyncRead(PRUint32 startPosition, PRInt32 readCount,
|
||||
// the listener prematurely.
|
||||
nsCOMPtr<nsIStreamListener> l(listener);
|
||||
|
||||
rv = listener->OnStartRequest(ctxt);
|
||||
rv = listener->OnStartRequest(this, ctxt);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
PRUint32 amt;
|
||||
@ -147,11 +147,11 @@ nsInputStreamChannel::AsyncRead(PRUint32 startPosition, PRInt32 readCount,
|
||||
amt = PR_MIN((PRUint32)readCount, amt);
|
||||
if (amt == 0)
|
||||
break;
|
||||
rv = listener->OnDataAvailable(ctxt, mInputStream, 0, amt);
|
||||
rv = listener->OnDataAvailable(this, ctxt, mInputStream, 0, amt);
|
||||
if (NS_FAILED(rv)) break;
|
||||
}
|
||||
|
||||
rv = listener->OnStopRequest(ctxt, rv, nsnull); // XXX error message
|
||||
rv = listener->OnStopRequest(this, ctxt, rv, nsnull); // XXX error message
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
return NS_OK;
|
||||
|
@ -338,20 +338,29 @@ nsLoadGroup::PropagateUp(PropagateUpFun fun, void* closure)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
struct OnStartRequestArgs {
|
||||
nsIChannel* channel;
|
||||
nsISupports* context;
|
||||
};
|
||||
|
||||
static nsresult
|
||||
OnStartRequestFun(nsIStreamObserver* obs, void* closure)
|
||||
{
|
||||
nsISupports* ctxt = (nsISupports*)closure;
|
||||
return obs->OnStartRequest(ctxt);
|
||||
OnStartRequestArgs* args = (OnStartRequestArgs*)closure;
|
||||
return obs->OnStartRequest(args->channel, args->context);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLoadGroup::OnStartRequest(nsISupports *ctxt)
|
||||
nsLoadGroup::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
{
|
||||
return PropagateUp(OnStartRequestFun, ctxt);
|
||||
OnStartRequestArgs args;
|
||||
args.channel = channel;
|
||||
args.context = ctxt;
|
||||
return PropagateUp(OnStartRequestFun, &args);
|
||||
}
|
||||
|
||||
struct OnStopRequestArgs {
|
||||
nsIChannel* channel;
|
||||
nsISupports* ctxt;
|
||||
nsresult status;
|
||||
const PRUnichar* errorMsg;
|
||||
@ -361,14 +370,16 @@ static nsresult
|
||||
OnStopRequestFun(nsIStreamObserver* obs, void* closure)
|
||||
{
|
||||
OnStopRequestArgs* args = (OnStopRequestArgs*)closure;
|
||||
return obs->OnStopRequest(args->ctxt, args->status, args->errorMsg);
|
||||
return obs->OnStopRequest(args->channel, args->ctxt,
|
||||
args->status, args->errorMsg);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLoadGroup::OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg)
|
||||
nsLoadGroup::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg)
|
||||
{
|
||||
OnStopRequestArgs args;
|
||||
args.channel = channel;
|
||||
args.ctxt = ctxt;
|
||||
args.status = status;
|
||||
args.errorMsg = errorMsg;
|
||||
@ -379,6 +390,7 @@ nsLoadGroup::OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
// nsIStreamListener methods:
|
||||
|
||||
struct OnDataAvailableArgs {
|
||||
nsIChannel* channel;
|
||||
nsISupports* ctxt;
|
||||
nsIInputStream *inStr;
|
||||
PRUint32 sourceOffset;
|
||||
@ -390,17 +402,18 @@ OnDataAvailableFun(nsIStreamObserver* obs, void* closure)
|
||||
{
|
||||
OnDataAvailableArgs* args = (OnDataAvailableArgs*)closure;
|
||||
nsIStreamListener* l = NS_STATIC_CAST(nsIStreamListener*, obs);
|
||||
return l->OnDataAvailable(args->ctxt, args->inStr,
|
||||
return l->OnDataAvailable(args->channel, args->ctxt, args->inStr,
|
||||
args->sourceOffset, args->count);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLoadGroup::OnDataAvailable(nsISupports *ctxt,
|
||||
nsLoadGroup::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *inStr,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 count)
|
||||
{
|
||||
OnDataAvailableArgs args;
|
||||
args.channel = channel;
|
||||
args.ctxt = ctxt;
|
||||
args.inStr = inStr;
|
||||
args.sourceOffset = sourceOffset;
|
||||
|
@ -85,13 +85,14 @@ public:
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// nsIStreamObserver methods:
|
||||
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// nsIStreamListener methods:
|
||||
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt,
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *inStr,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 count);
|
||||
|
@ -294,11 +294,11 @@ nsresult nsSocketTransport::Process(PRInt16 aSelectFlags)
|
||||
case eSocketState_Connected:
|
||||
// Fire a notification for read...
|
||||
if (mReadListener) {
|
||||
mReadListener->OnStartRequest(mReadContext);
|
||||
mReadListener->OnStartRequest(this, mReadContext);
|
||||
}
|
||||
// Fire a notification for write...
|
||||
if (mWriteObserver) {
|
||||
mWriteObserver->OnStartRequest(mWriteContext);
|
||||
mWriteObserver->OnStartRequest(this, mWriteContext);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -312,7 +312,7 @@ nsresult nsSocketTransport::Process(PRInt16 aSelectFlags)
|
||||
// Fire a notification that the read has finished...
|
||||
if (eSocketState_DoneWrite != mCurrentState) {
|
||||
if (mReadListener) {
|
||||
mReadListener->OnStopRequest(mReadContext, rv, nsnull);
|
||||
mReadListener->OnStopRequest(this, mReadContext, rv, nsnull);
|
||||
NS_RELEASE(mReadListener);
|
||||
NS_IF_RELEASE(mReadContext);
|
||||
}
|
||||
@ -324,7 +324,7 @@ nsresult nsSocketTransport::Process(PRInt16 aSelectFlags)
|
||||
// Fire a notification that the write has finished...
|
||||
if (eSocketState_DoneRead != mCurrentState) {
|
||||
if (mWriteObserver) {
|
||||
mWriteObserver->OnStopRequest(mWriteContext, rv, nsnull);
|
||||
mWriteObserver->OnStopRequest(this, mWriteContext, rv, nsnull);
|
||||
NS_RELEASE(mWriteObserver);
|
||||
NS_IF_RELEASE(mWriteContext);
|
||||
}
|
||||
@ -726,7 +726,7 @@ nsresult nsSocketTransport::doRead(PRInt16 aSelectFlags)
|
||||
if (totalBytesWritten && mReadListener) {
|
||||
nsresult rv1;
|
||||
|
||||
rv1 = mReadListener->OnDataAvailable(mReadContext, mReadStream, mSourceOffset,
|
||||
rv1 = mReadListener->OnDataAvailable(this, mReadContext, mReadStream, mSourceOffset,
|
||||
totalBytesWritten);
|
||||
//
|
||||
// If the consumer returns failure, then cancel the operation...
|
||||
|
@ -30,13 +30,13 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports* context);
|
||||
NS_IMETHOD OnStopRequest(nsISupports* context,
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports* context);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg);
|
||||
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports* context,
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength);
|
||||
@ -98,13 +98,13 @@ nsSyncStreamListener::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSyncStreamListener::OnStartRequest(nsISupports* context)
|
||||
nsSyncStreamListener::OnStartRequest(nsIChannel* channel, nsISupports* context)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSyncStreamListener::OnStopRequest(nsISupports* context,
|
||||
nsSyncStreamListener::OnStopRequest(nsIChannel* channel, nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
{
|
||||
@ -113,7 +113,8 @@ nsSyncStreamListener::OnStopRequest(nsISupports* context,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSyncStreamListener::OnDataAvailable(nsISupports* context,
|
||||
nsSyncStreamListener::OnDataAvailable(nsIChannel* channel,
|
||||
nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength)
|
||||
|
@ -210,7 +210,7 @@ public:
|
||||
nsresult rv;
|
||||
rv = mOutputStream->Write(buf, count, writeCount);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = mListener->OnDataAvailable(mContext, mInputStream, mOffset, *writeCount);
|
||||
rv = mListener->OnDataAvailable(mChannel, mContext, mInputStream, mOffset, *writeCount);
|
||||
mOffset += *writeCount;
|
||||
return rv;
|
||||
}
|
||||
@ -229,7 +229,7 @@ public:
|
||||
nsresult rv;
|
||||
rv = mOutputStream->WriteFrom(inStr, count, writeCount);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = mListener->OnDataAvailable(mContext, mInputStream, mOffset, *writeCount);
|
||||
rv = mListener->OnDataAvailable(mChannel, mContext, mInputStream, mOffset, *writeCount);
|
||||
mOffset += *writeCount;
|
||||
return rv;
|
||||
}
|
||||
@ -241,13 +241,15 @@ public:
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
|
||||
nsresult Init(nsISupports* context, nsIStreamListener* listener,
|
||||
nsresult Init(nsIChannel* channel, nsISupports* context, nsIStreamListener* listener,
|
||||
PRUint32 growBySize, PRUint32 maxSize) {
|
||||
nsresult rv;
|
||||
rv = NS_NewPipe(&mInputStream, &mOutputStream,
|
||||
growBySize, maxSize, PR_TRUE, nsnull);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
mChannel = channel;
|
||||
NS_ADDREF(mChannel);
|
||||
mContext = context;
|
||||
NS_IF_ADDREF(mContext);
|
||||
mListener = listener;
|
||||
@ -256,6 +258,7 @@ public:
|
||||
}
|
||||
|
||||
virtual ~nsAsyncOutputStream() {
|
||||
NS_IF_RELEASE(mChannel);
|
||||
NS_IF_RELEASE(mContext);
|
||||
NS_IF_RELEASE(mListener);
|
||||
NS_IF_RELEASE(mInputStream);
|
||||
@ -264,13 +267,14 @@ public:
|
||||
|
||||
static NS_METHOD Create(nsIBufferInputStream* *inStr,
|
||||
nsIBufferOutputStream* *outStr,
|
||||
nsISupports* context, nsIStreamListener* listener,
|
||||
nsIChannel* channel, nsISupports* context,
|
||||
nsIStreamListener* listener,
|
||||
PRUint32 growBySize, PRUint32 maxSize) {
|
||||
nsAsyncOutputStream* str = new nsAsyncOutputStream();
|
||||
if (str == nsnull)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(str);
|
||||
nsresult rv = str->Init(context, listener, growBySize, maxSize);
|
||||
nsresult rv = str->Init(channel, context, listener, growBySize, maxSize);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(str);
|
||||
return rv;
|
||||
@ -282,6 +286,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
nsIChannel* mChannel;
|
||||
nsISupports* mContext;
|
||||
nsIStreamListener* mListener;
|
||||
nsIBufferInputStream* mInputStream;
|
||||
@ -406,7 +411,7 @@ nsFileChannel::AsyncRead(PRUint32 startPosition, PRInt32 readCount,
|
||||
|
||||
rv = nsAsyncOutputStream::Create(&mBufferInputStream,
|
||||
&mBufferOutputStream,
|
||||
ctxt, mListener,
|
||||
this, ctxt, mListener,
|
||||
NS_FILE_TRANSPORT_SEGMENT_SIZE,
|
||||
NS_FILE_TRANSPORT_BUFFER_SIZE);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -527,7 +532,7 @@ nsFileChannel::Process(void)
|
||||
NS_ASSERTION(mSourceOffset == 0, "implement seek");
|
||||
|
||||
if (mListener) {
|
||||
mStatus = mListener->OnStartRequest(mContext); // always send the start notification
|
||||
mStatus = mListener->OnStartRequest(this, mContext); // always send the start notification
|
||||
if (NS_FAILED(mStatus)) goto error;
|
||||
}
|
||||
|
||||
@ -556,7 +561,7 @@ nsFileChannel::Process(void)
|
||||
|
||||
// and feed the buffer to the application via the buffer stream:
|
||||
if (mListener) {
|
||||
mStatus = mListener->OnDataAvailable(mContext, mBufferInputStream, mSourceOffset, amt);
|
||||
mStatus = mListener->OnDataAvailable(this, mContext, mBufferInputStream, mSourceOffset, amt);
|
||||
if (NS_FAILED(mStatus)) goto error;
|
||||
}
|
||||
|
||||
@ -569,7 +574,7 @@ nsFileChannel::Process(void)
|
||||
nsISupports* fs;
|
||||
|
||||
if (mListener) {
|
||||
mStatus = mListener->OnStartRequest(mContext); // always send the start notification
|
||||
mStatus = mListener->OnStartRequest(this, mContext); // always send the start notification
|
||||
if (NS_FAILED(mStatus)) goto error;
|
||||
}
|
||||
|
||||
@ -603,7 +608,7 @@ nsFileChannel::Process(void)
|
||||
mBufferOutputStream->Flush();
|
||||
if (mListener) {
|
||||
// XXX where do we get the error message?
|
||||
(void)mListener->OnStopRequest(mContext, mStatus, nsnull);
|
||||
(void)mListener->OnStopRequest(this, mContext, mStatus, nsnull);
|
||||
}
|
||||
|
||||
NS_IF_RELEASE(mBufferOutputStream);
|
||||
|
@ -221,7 +221,7 @@ nsFTPChannel::Get(void) {
|
||||
nsresult rv;
|
||||
nsIThread* workerThread = nsnull;
|
||||
nsFtpConnectionThread* protocolInterpreter =
|
||||
new nsFtpConnectionThread(mEventQueue, this);
|
||||
new nsFtpConnectionThread(mEventQueue, this, this, nsnull);
|
||||
NS_ASSERTION(protocolInterpreter, "ftp protocol interpreter alloc failed");
|
||||
NS_ADDREF(protocolInterpreter);
|
||||
|
||||
@ -244,7 +244,7 @@ nsFTPChannel::Put(void) {
|
||||
nsresult rv;
|
||||
nsIThread* workerThread = nsnull;
|
||||
nsFtpConnectionThread* protocolInterpreter =
|
||||
new nsFtpConnectionThread(mEventQueue, this);
|
||||
new nsFtpConnectionThread(mEventQueue, this, this, nsnull);
|
||||
NS_ASSERTION(protocolInterpreter, "ftp protocol interpreter alloc failed");
|
||||
NS_ADDREF(protocolInterpreter);
|
||||
|
||||
@ -274,12 +274,12 @@ nsFTPChannel::SetStreamListener(nsIStreamListener *aListener) {
|
||||
// nsIStreamObserver methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFTPChannel::OnStartRequest(nsISupports* context) {
|
||||
nsFTPChannel::OnStartRequest(nsIChannel* channel, nsISupports* context) {
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFTPChannel::OnStopRequest(nsISupports* context,
|
||||
nsFTPChannel::OnStopRequest(nsIChannel* channel, nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg) {
|
||||
// Release the lock so the user get's the data stream
|
||||
@ -290,7 +290,7 @@ nsFTPChannel::OnStopRequest(nsISupports* context,
|
||||
// nsIStreamListener methods:
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFTPChannel::OnDataAvailable(nsISupports* context,
|
||||
nsFTPChannel::OnDataAvailable(nsIChannel* channel, nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength) {
|
||||
|
@ -64,13 +64,13 @@ public:
|
||||
NS_IMETHOD SetStreamListener(nsIStreamListener* aListener);
|
||||
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports* context);
|
||||
NS_IMETHOD OnStopRequest(nsISupports* context,
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports* context);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg);
|
||||
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports* context,
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength);
|
||||
|
@ -54,7 +54,8 @@ nsFtpConnectionThread::QueryInterface(const nsIID& aIID, void** aInstancePtr) {
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsFtpConnectionThread::nsFtpConnectionThread(nsIEventQueue* aEventQ, nsIStreamListener* aListener) {
|
||||
nsFtpConnectionThread::nsFtpConnectionThread(nsIEventQueue* aEventQ, nsIStreamListener* aListener,
|
||||
nsIChannel* channel, nsISupports* context) {
|
||||
NS_INIT_REFCNT();
|
||||
|
||||
mEventQueue = aEventQ; // whoever creates us must provide an event queue
|
||||
@ -68,12 +69,18 @@ nsFtpConnectionThread::nsFtpConnectionThread(nsIEventQueue* aEventQ, nsIStreamLi
|
||||
mAscii = PR_TRUE;
|
||||
mLength = 0;
|
||||
mConnected = PR_FALSE;
|
||||
mChannel = channel;
|
||||
NS_ADDREF(channel);
|
||||
mContext = context;
|
||||
NS_IF_ADDREF(context);
|
||||
|
||||
mLock = PR_NewLock();
|
||||
}
|
||||
|
||||
nsFtpConnectionThread::~nsFtpConnectionThread() {
|
||||
NS_IF_RELEASE(mListener);
|
||||
NS_RELEASE(mListener);
|
||||
NS_RELEASE(mChannel);
|
||||
NS_IF_RELEASE(mContext);
|
||||
NS_IF_RELEASE(mEventQueue);
|
||||
PR_DestroyLock(mLock);
|
||||
}
|
||||
@ -146,7 +153,7 @@ nsFtpConnectionThread::Run() {
|
||||
|
||||
// tell the user that we've begun the transaction.
|
||||
nsFtpOnStartRequestEvent* event =
|
||||
new nsFtpOnStartRequestEvent(mListener, nsnull);
|
||||
new nsFtpOnStartRequestEvent(mListener, mChannel, mContext);
|
||||
if (event == nsnull)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
@ -198,7 +205,7 @@ nsFtpConnectionThread::Run() {
|
||||
// We have error'd out. Stop binding and pass the error back to the user.
|
||||
PRUnichar* errorMsg = nsnull;
|
||||
nsFtpOnStopRequestEvent* event =
|
||||
new nsFtpOnStopRequestEvent(mListener, nsnull);
|
||||
new nsFtpOnStopRequestEvent(mListener, mChannel, mContext);
|
||||
if (!event)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
@ -863,8 +870,8 @@ nsFtpConnectionThread::Run() {
|
||||
|
||||
// tell the user about the data.
|
||||
nsFtpOnDataAvailableEvent* event =
|
||||
new nsFtpOnDataAvailableEvent(mListener, nsnull); // XXX the destroy event method
|
||||
// XXX needs to clean up this new.
|
||||
new nsFtpOnDataAvailableEvent(mListener, mChannel, mContext); // XXX the destroy event method
|
||||
// XXX needs to clean up this new.
|
||||
if (!event) {
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
mState = FTP_ERROR;
|
||||
@ -979,8 +986,8 @@ nsFtpConnectionThread::Run() {
|
||||
|
||||
// tell the user about the data.
|
||||
nsFtpOnDataAvailableEvent* event =
|
||||
new nsFtpOnDataAvailableEvent(mListener, nsnull); // XXX the destroy event method
|
||||
// XXX needs to clean up this new.
|
||||
new nsFtpOnDataAvailableEvent(mListener, mChannel, mContext); // XXX the destroy event method
|
||||
// XXX needs to clean up this new.
|
||||
if (!event) {
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
mState = FTP_ERROR;
|
||||
|
@ -110,7 +110,8 @@ class nsFtpConnectionThread : public nsIRunnable {
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
nsFtpConnectionThread(nsIEventQueue* aEventQ, nsIStreamListener *aListener);
|
||||
nsFtpConnectionThread(nsIEventQueue* aEventQ, nsIStreamListener *aListener,
|
||||
nsIChannel* channel, nsISupports* ctxt);
|
||||
virtual ~nsFtpConnectionThread();
|
||||
|
||||
// nsIRunnable method
|
||||
@ -173,6 +174,8 @@ private:
|
||||
|
||||
nsIStreamListener* mListener; // the listener we want to call
|
||||
// during our event firing.
|
||||
nsIChannel* mChannel;
|
||||
nsISupports* mContext;
|
||||
|
||||
PRLock *mLock;
|
||||
PRThread *mThread;
|
||||
|
@ -19,19 +19,22 @@
|
||||
#include "nsFtpStreamListenerEvent.h"
|
||||
#include "nsIBufferInputStream.h"
|
||||
#include "nscore.h"
|
||||
|
||||
#include "nsIChannel.h"
|
||||
|
||||
nsFtpStreamListenerEvent::nsFtpStreamListenerEvent(nsIStreamListener* listener,
|
||||
nsISupports* context)
|
||||
: mListener(listener), mContext(context)
|
||||
nsIChannel* channel,
|
||||
nsISupports* context)
|
||||
: mListener(listener), mChannel(channel), mContext(context)
|
||||
{
|
||||
NS_IF_ADDREF(mListener);
|
||||
NS_ADDREF(mListener);
|
||||
NS_ADDREF(mChannel);
|
||||
NS_IF_ADDREF(mContext);
|
||||
}
|
||||
|
||||
nsFtpStreamListenerEvent::~nsFtpStreamListenerEvent()
|
||||
{
|
||||
NS_IF_RELEASE(mListener);
|
||||
NS_RELEASE(mListener);
|
||||
NS_RELEASE(mChannel);
|
||||
NS_IF_RELEASE(mContext);
|
||||
}
|
||||
|
||||
@ -80,7 +83,7 @@ NS_IMETHODIMP
|
||||
nsFtpOnStartRequestEvent::HandleEvent()
|
||||
{
|
||||
nsIStreamObserver* receiver = (nsIStreamObserver*)mListener;
|
||||
return receiver->OnStartRequest(mContext);
|
||||
return receiver->OnStartRequest(mChannel, mContext);
|
||||
}
|
||||
/*
|
||||
NS_IMETHODIMP
|
||||
@ -129,7 +132,7 @@ NS_IMETHODIMP
|
||||
nsFtpOnDataAvailableEvent::HandleEvent()
|
||||
{
|
||||
nsIStreamListener* receiver = (nsIStreamListener*)mListener;
|
||||
return receiver->OnDataAvailable(mContext, mIStream, mSourceOffset, mLength);
|
||||
return receiver->OnDataAvailable(mChannel, mContext, mIStream, mSourceOffset, mLength);
|
||||
}
|
||||
/*
|
||||
NS_IMETHODIMP
|
||||
@ -179,7 +182,7 @@ NS_IMETHODIMP
|
||||
nsFtpOnStopRequestEvent::HandleEvent()
|
||||
{
|
||||
nsIStreamObserver* receiver = (nsIStreamObserver*)mListener;
|
||||
return receiver->OnStopRequest(mContext, mStatus, mMessage);
|
||||
return receiver->OnStopRequest(mChannel, mContext, mStatus, mMessage);
|
||||
}
|
||||
/*
|
||||
NS_IMETHODIMP
|
||||
|
@ -27,7 +27,8 @@
|
||||
|
||||
class nsFtpStreamListenerEvent : public PLEvent {
|
||||
public:
|
||||
nsFtpStreamListenerEvent(nsIStreamListener* listener, nsISupports* context);
|
||||
nsFtpStreamListenerEvent(nsIStreamListener* listener,
|
||||
nsIChannel* channel, nsISupports* context);
|
||||
virtual ~nsFtpStreamListenerEvent();
|
||||
|
||||
nsresult Fire(nsIEventQueue* aEventQ);
|
||||
@ -38,15 +39,17 @@ protected:
|
||||
static void PR_CALLBACK HandlePLEvent(PLEvent* aEvent);
|
||||
static void PR_CALLBACK DestroyPLEvent(PLEvent* aEvent);
|
||||
|
||||
nsIStreamListener* mListener;
|
||||
nsISupports* mContext;
|
||||
nsIStreamListener* mListener;
|
||||
nsIChannel* mChannel;
|
||||
nsISupports* mContext;
|
||||
};
|
||||
|
||||
class nsFtpOnStartRequestEvent : public nsFtpStreamListenerEvent
|
||||
{
|
||||
public:
|
||||
nsFtpOnStartRequestEvent(nsIStreamListener* listener, nsISupports* context)
|
||||
: nsFtpStreamListenerEvent(listener, context) {}
|
||||
nsFtpOnStartRequestEvent(nsIStreamListener* listener,
|
||||
nsIChannel* channel, nsISupports* context)
|
||||
: nsFtpStreamListenerEvent(listener, channel, context) {}
|
||||
virtual ~nsFtpOnStartRequestEvent() {}
|
||||
|
||||
NS_IMETHOD HandleEvent();
|
||||
@ -56,8 +59,9 @@ public:
|
||||
class nsFtpOnDataAvailableEvent : public nsFtpStreamListenerEvent
|
||||
{
|
||||
public:
|
||||
nsFtpOnDataAvailableEvent(nsIStreamListener* listener, nsISupports* context)
|
||||
: nsFtpStreamListenerEvent(listener, context),
|
||||
nsFtpOnDataAvailableEvent(nsIStreamListener* listener,
|
||||
nsIChannel* channel, nsISupports* context)
|
||||
: nsFtpStreamListenerEvent(listener, channel, context),
|
||||
mIStream(nsnull), mLength(0) {}
|
||||
virtual ~nsFtpOnDataAvailableEvent();
|
||||
|
||||
@ -74,8 +78,9 @@ protected:
|
||||
class nsFtpOnStopRequestEvent : public nsFtpStreamListenerEvent
|
||||
{
|
||||
public:
|
||||
nsFtpOnStopRequestEvent(nsIStreamListener* listener, nsISupports* context)
|
||||
: nsFtpStreamListenerEvent(listener, context),
|
||||
nsFtpOnStopRequestEvent(nsIStreamListener* listener,
|
||||
nsIChannel* channel, nsISupports* context)
|
||||
: nsFtpStreamListenerEvent(listener, channel, context),
|
||||
mStatus(NS_OK), mMessage(nsnull) {}
|
||||
virtual ~nsFtpOnStopRequestEvent();
|
||||
|
||||
|
@ -922,7 +922,7 @@ nsHTTPRequest::GetInputStream(nsIInputStream* *o_Stream)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTTPRequest::OnStartRequest(nsISupports* i_pContext)
|
||||
nsHTTPRequest::OnStartRequest(nsIChannel* channel, nsISupports* i_pContext)
|
||||
{
|
||||
PR_LOG(gHTTPLog, PR_LOG_DEBUG,
|
||||
("nsHTTPRequest [this=%x]. Starting to write request to server.\n",
|
||||
@ -932,9 +932,9 @@ nsHTTPRequest::OnStartRequest(nsISupports* i_pContext)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTTPRequest::OnStopRequest(nsISupports* i_pContext,
|
||||
nsresult iStatus,
|
||||
const PRUnichar* i_pMsg)
|
||||
nsHTTPRequest::OnStopRequest(nsIChannel* channel, nsISupports* i_pContext,
|
||||
nsresult iStatus,
|
||||
const PRUnichar* i_pMsg)
|
||||
{
|
||||
nsresult rv = iStatus;
|
||||
|
||||
@ -975,7 +975,7 @@ nsHTTPRequest::OnStopRequest(nsISupports* i_pContext,
|
||||
(void) m_pConnection->GetResponseContext(getter_AddRefs(consumerContext));
|
||||
rv = m_pConnection->GetResponseDataListener(getter_AddRefs(consumer));
|
||||
if (consumer) {
|
||||
consumer->OnStopRequest(consumerContext, iStatus, i_pMsg);
|
||||
consumer->OnStopRequest(m_pConnection, consumerContext, iStatus, i_pMsg);
|
||||
}
|
||||
|
||||
rv = iStatus;
|
||||
|
@ -239,8 +239,8 @@ public:
|
||||
NS_IMETHOD GetUserAgent(char* *o_Value);
|
||||
|
||||
// nsIStreamObserver functions
|
||||
NS_IMETHOD OnStartRequest(nsISupports* context);
|
||||
NS_IMETHOD OnStopRequest(nsISupports* context,
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports* context);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg);
|
||||
|
||||
|
@ -53,7 +53,8 @@ nsHTTPResponseListener::nsHTTPResponseListener():
|
||||
m_ReadLength(0),
|
||||
m_bHeadersDone(PR_FALSE),
|
||||
m_HeaderBuffer(eOneByte),
|
||||
m_ResponseContext(nsnull)
|
||||
m_ResponseContext(nsnull),
|
||||
m_Channel(nsnull)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
|
||||
@ -79,7 +80,8 @@ static NS_DEFINE_CID(kEventQueueService, NS_EVENTQUEUESERVICE_CID);
|
||||
static NS_DEFINE_CID(kNetModuleMgrCID, NS_NETMODULEMGR_CID);
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTTPResponseListener::OnDataAvailable(nsISupports* context,
|
||||
nsHTTPResponseListener::OnDataAvailable(nsIChannel* channel,
|
||||
nsISupports* context,
|
||||
nsIInputStream *i_pStream,
|
||||
PRUint32 i_SourceOffset,
|
||||
PRUint32 i_Length)
|
||||
@ -144,7 +146,7 @@ nsHTTPResponseListener::OnDataAvailable(nsISupports* context,
|
||||
("\tOnDataAvailable [this=%x]. Calling consumer "
|
||||
"OnDataAvailable.\tlength:%d\n", this, i_Length));
|
||||
|
||||
rv = m_pConsumer->OnDataAvailable(m_ResponseContext, i_pStream, 0,
|
||||
rv = m_pConsumer->OnDataAvailable(channel, m_ResponseContext, i_pStream, 0,
|
||||
i_Length);
|
||||
}
|
||||
} else {
|
||||
@ -157,7 +159,7 @@ nsHTTPResponseListener::OnDataAvailable(nsISupports* context,
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTTPResponseListener::OnStartRequest(nsISupports* i_pContext)
|
||||
nsHTTPResponseListener::OnStartRequest(nsIChannel* channel, nsISupports* i_pContext)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
@ -191,7 +193,7 @@ nsHTTPResponseListener::OnStartRequest(nsISupports* i_pContext)
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Pass the notification out to the consumer...
|
||||
if (m_pConsumer) {
|
||||
rv = m_pConsumer->OnStartRequest(m_ResponseContext);
|
||||
rv = m_pConsumer->OnStartRequest(m_Channel, m_ResponseContext);
|
||||
} else {
|
||||
NS_ERROR("No Stream Listener...");
|
||||
rv = NS_ERROR_NULL_POINTER;
|
||||
@ -202,9 +204,10 @@ nsHTTPResponseListener::OnStartRequest(nsISupports* i_pContext)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTTPResponseListener::OnStopRequest(nsISupports* i_pContext,
|
||||
nsresult i_Status,
|
||||
const PRUnichar* i_pMsg)
|
||||
nsHTTPResponseListener::OnStopRequest(nsIChannel* channel,
|
||||
nsISupports* i_pContext,
|
||||
nsresult i_Status,
|
||||
const PRUnichar* i_pMsg)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
@ -213,7 +216,7 @@ nsHTTPResponseListener::OnStopRequest(nsISupports* i_pContext,
|
||||
|
||||
// Pass the notification out to the consumer...
|
||||
if (m_pConsumer) {
|
||||
rv = m_pConsumer->OnStopRequest(m_ResponseContext, i_Status, i_pMsg);
|
||||
rv = m_pConsumer->OnStopRequest(channel, m_ResponseContext, i_Status, i_pMsg);
|
||||
} else {
|
||||
NS_ERROR("No Stream Listener...");
|
||||
rv = NS_ERROR_NULL_POINTER;
|
||||
|
@ -56,15 +56,15 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIStreamListener functions
|
||||
NS_IMETHOD OnDataAvailable(nsISupports* context,
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength);
|
||||
|
||||
|
||||
NS_IMETHOD OnStartRequest(nsISupports* context);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports* context);
|
||||
|
||||
NS_IMETHOD OnStopRequest(nsISupports* context,
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg);
|
||||
|
||||
@ -90,6 +90,7 @@ protected:
|
||||
nsString m_HeaderBuffer;
|
||||
|
||||
nsCOMPtr<nsISupports> m_ResponseContext;
|
||||
nsCOMPtr<nsIChannel> m_Channel;
|
||||
};
|
||||
|
||||
#endif /* _nsHTTPResponseListener_h_ */
|
||||
|
@ -102,7 +102,8 @@ public:
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHOD OnStartRequest(nsISupports* context) {
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel,
|
||||
nsISupports* context) {
|
||||
PR_EnterMonitor(mMonitor);
|
||||
printf("start binding\n");
|
||||
mStartTime = PR_IntervalNow();
|
||||
@ -110,7 +111,8 @@ public:
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHOD OnDataAvailable(nsISupports* context,
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel,
|
||||
nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength) {
|
||||
@ -128,7 +130,8 @@ public:
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHOD OnStopRequest(nsISupports* context,
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel,
|
||||
nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg) {
|
||||
nsresult rv;
|
||||
@ -192,7 +195,7 @@ Simulated_nsFileTransport_Run(nsReader* reader, const char* path)
|
||||
nsFileSpec spec(path);
|
||||
PRUint32 sourceOffset = 0;
|
||||
|
||||
rv = reader->OnStartRequest(nsnull);
|
||||
rv = reader->OnStartRequest(nsnull, nsnull);
|
||||
if (NS_FAILED(rv)) goto done; // XXX should this abort the transfer?
|
||||
|
||||
rv = NS_NewTypicalInputFileStream(&fs, spec);
|
||||
@ -222,7 +225,7 @@ Simulated_nsFileTransport_Run(nsReader* reader, const char* path)
|
||||
}
|
||||
if (NS_FAILED(rv)) break;
|
||||
|
||||
rv = reader->OnDataAvailable(nsnull, bufStr, sourceOffset, amt);
|
||||
rv = reader->OnDataAvailable(nsnull, nsnull, bufStr, sourceOffset, amt);
|
||||
if (NS_FAILED(rv)) break;
|
||||
|
||||
sourceOffset += amt;
|
||||
@ -232,7 +235,7 @@ Simulated_nsFileTransport_Run(nsReader* reader, const char* path)
|
||||
NS_IF_RELEASE(bufStr);
|
||||
NS_IF_RELEASE(fileStr);
|
||||
|
||||
rv = reader->OnStopRequest(nsnull, rv, nsnull);
|
||||
rv = reader->OnStopRequest(nsnull, nsnull, rv, nsnull);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -180,14 +180,14 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// IStreamListener interface...
|
||||
NS_IMETHOD OnStartRequest(nsISupports* context);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports* context);
|
||||
|
||||
NS_IMETHOD OnDataAvailable(nsISupports* context,
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength);
|
||||
|
||||
NS_IMETHOD OnStopRequest(nsISupports* context,
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg);
|
||||
};
|
||||
@ -207,7 +207,7 @@ NS_IMPL_ISUPPORTS(InputTestConsumer,nsCOMTypeInfo<nsIStreamListener>::GetIID());
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
InputTestConsumer::OnStartRequest(nsISupports* context)
|
||||
InputTestConsumer::OnStartRequest(nsIChannel* channel, nsISupports* context)
|
||||
{
|
||||
URLLoadInfo* info = (URLLoadInfo*)context;
|
||||
if (info) {
|
||||
@ -235,7 +235,8 @@ InputTestConsumer::OnStartRequest(nsISupports* context)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
InputTestConsumer::OnDataAvailable(nsISupports* context,
|
||||
InputTestConsumer::OnDataAvailable(nsIChannel* channel,
|
||||
nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength)
|
||||
@ -263,7 +264,8 @@ InputTestConsumer::OnDataAvailable(nsISupports* context,
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
InputTestConsumer::OnStopRequest(nsISupports* context,
|
||||
InputTestConsumer::OnStopRequest(nsIChannel* channel,
|
||||
nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
{
|
||||
|
@ -52,14 +52,14 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// IStreamListener interface...
|
||||
NS_IMETHOD OnStartRequest(nsISupports* context);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports* context);
|
||||
|
||||
NS_IMETHOD OnDataAvailable(nsISupports* context,
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength);
|
||||
|
||||
NS_IMETHOD OnStopRequest(nsISupports* context,
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg);
|
||||
|
||||
@ -81,7 +81,7 @@ NS_IMPL_ISUPPORTS(InputTestConsumer,kIStreamListenerIID);
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
InputTestConsumer::OnStartRequest(nsISupports* context)
|
||||
InputTestConsumer::OnStartRequest(nsIChannel* channel, nsISupports* context)
|
||||
{
|
||||
printf("\n+++ InputTestConsumer::OnStartRequest +++\n");
|
||||
return NS_OK;
|
||||
@ -89,7 +89,8 @@ InputTestConsumer::OnStartRequest(nsISupports* context)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
InputTestConsumer::OnDataAvailable(nsISupports* context,
|
||||
InputTestConsumer::OnDataAvailable(nsIChannel* channel,
|
||||
nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength)
|
||||
@ -107,9 +108,10 @@ InputTestConsumer::OnDataAvailable(nsISupports* context,
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
InputTestConsumer::OnStopRequest(nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
InputTestConsumer::OnStopRequest(nsIChannel* channel,
|
||||
nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
{
|
||||
gKeepRunning = 0;
|
||||
printf("\n+++ InputTestConsumer::OnStopRequest (status = %x) +++\n", aStatus);
|
||||
@ -129,9 +131,9 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// IStreamObserver interface...
|
||||
NS_IMETHOD OnStartRequest(nsISupports* context);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports* context);
|
||||
|
||||
NS_IMETHOD OnStopRequest(nsISupports* context,
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg);
|
||||
|
||||
@ -157,7 +159,7 @@ NS_IMPL_ISUPPORTS(TestWriteObserver,nsCOMTypeInfo<nsIStreamObserver>::GetIID());
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
TestWriteObserver::OnStartRequest(nsISupports* context)
|
||||
TestWriteObserver::OnStartRequest(nsIChannel* channel, nsISupports* context)
|
||||
{
|
||||
printf("\n+++ TestWriteObserver::OnStartRequest +++\n");
|
||||
return NS_OK;
|
||||
@ -165,7 +167,7 @@ TestWriteObserver::OnStartRequest(nsISupports* context)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
TestWriteObserver::OnStopRequest(nsISupports* context,
|
||||
TestWriteObserver::OnStopRequest(nsIChannel* channel, nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
{
|
||||
|
@ -46,14 +46,14 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// IStreamListener interface...
|
||||
NS_IMETHOD OnStartRequest(nsISupports* context);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports* context);
|
||||
|
||||
NS_IMETHOD OnDataAvailable(nsISupports* context,
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength);
|
||||
|
||||
NS_IMETHOD OnStopRequest(nsISupports* context,
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg);
|
||||
|
||||
@ -75,7 +75,7 @@ NS_IMPL_ISUPPORTS(InputTestConsumer,kIStreamListenerIID);
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
InputTestConsumer::OnStartRequest(nsISupports* context)
|
||||
InputTestConsumer::OnStartRequest(nsIChannel* channel, nsISupports* context)
|
||||
{
|
||||
printf("+++ OnStartRequest +++\n");
|
||||
return NS_OK;
|
||||
@ -83,7 +83,8 @@ InputTestConsumer::OnStartRequest(nsISupports* context)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
InputTestConsumer::OnDataAvailable(nsISupports* context,
|
||||
InputTestConsumer::OnDataAvailable(nsIChannel* channel,
|
||||
nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength)
|
||||
@ -102,9 +103,10 @@ InputTestConsumer::OnDataAvailable(nsISupports* context,
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
InputTestConsumer::OnStopRequest(nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
InputTestConsumer::OnStopRequest(nsIChannel* channel,
|
||||
nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
{
|
||||
gKeepRunning = 0;
|
||||
printf("+++ OnStopRequest +++\n");
|
||||
|
@ -104,14 +104,14 @@ public:
|
||||
NS_IMETHOD Run(void);
|
||||
|
||||
// IStreamListener interface...
|
||||
NS_IMETHOD OnStartRequest(nsISupports* context);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports* context);
|
||||
|
||||
NS_IMETHOD OnDataAvailable(nsISupports* context,
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength);
|
||||
|
||||
NS_IMETHOD OnStopRequest(nsISupports* context,
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg);
|
||||
|
||||
@ -141,7 +141,7 @@ protected:
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
TestConnection::OnStartRequest(nsISupports* context)
|
||||
TestConnection::OnStartRequest(nsIChannel* channel, nsISupports* context)
|
||||
{
|
||||
printf("\n+++ TestConnection::OnStartRequest +++. Context = %p\n", context);
|
||||
return NS_OK;
|
||||
@ -149,7 +149,7 @@ TestConnection::OnStartRequest(nsISupports* context)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
TestConnection::OnDataAvailable(nsISupports* context,
|
||||
TestConnection::OnDataAvailable(nsIChannel* channel, nsISupports* context,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 aSourceOffset,
|
||||
PRUint32 aLength)
|
||||
@ -177,7 +177,8 @@ TestConnection::OnDataAvailable(nsISupports* context,
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
TestConnection::OnStopRequest(nsISupports* context,
|
||||
TestConnection::OnStopRequest(nsIChannel* channel,
|
||||
nsISupports* context,
|
||||
nsresult aStatus,
|
||||
const PRUnichar* aMsg)
|
||||
{
|
||||
|
@ -69,9 +69,9 @@ public:
|
||||
PRUint32 aLength);
|
||||
|
||||
// stream observer methods
|
||||
NS_IMETHOD OnStartRequest(nsISupports* context);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports* context);
|
||||
|
||||
NS_IMETHOD OnStopRequest(nsISupports* context,
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports* context,
|
||||
nsresult aStatus,
|
||||
nsIString* aMsg);
|
||||
|
||||
@ -124,7 +124,7 @@ NS_IMETHODIMP TestConsumer::OnDataAvailable(nsISupports *context,
|
||||
return 0;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP TestConsumer::OnStartRequest(nsISupports *context) {
|
||||
NS_IMETHODIMP TestConsumer::OnStartRequest(nsIChannel* channel, nsISupports *context) {
|
||||
if (bTraceEnabled) {
|
||||
printf("\n+++ TestConsumer::OnStartRequest: URL: %p, Content type: %s\n", mUrl, "XXX some context");
|
||||
}
|
||||
@ -132,7 +132,8 @@ NS_IMETHODIMP TestConsumer::OnStartRequest(nsISupports *context) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP TestConsumer::OnStopRequest(nsISupports *context, nsresult aStatus, nsIString *aMsg) {
|
||||
NS_IMETHODIMP TestConsumer::OnStopRequest(nsISupports *context, nsIChannel* channel,
|
||||
nsresult aStatus, nsIString *aMsg) {
|
||||
if (bTraceEnabled) {
|
||||
printf("\n+++ TestConsumer::OnStopRequest... URL: %p status: %d\n", mUrl, aStatus);
|
||||
}
|
||||
|
@ -44,11 +44,12 @@ public:
|
||||
NS_IMETHOD GetNumCharsRead(PRInt32* aNumBytes);
|
||||
|
||||
// nsIStreamObserver methods
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
|
||||
// nsIStreamListener methods
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
|
||||
#if 0
|
||||
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
|
||||
@ -136,32 +137,24 @@ nsUnicharStreamLoader::GetNumCharsRead(PRInt32* aNumBytes)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsUnicharStreamLoader::OnStartRequest(nsISupports *ctxt)
|
||||
nsUnicharStreamLoader::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsUnicharStreamLoader::OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg)
|
||||
nsUnicharStreamLoader::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg)
|
||||
{
|
||||
(*mFunc)(this, *mData, mRef, status);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#if 0
|
||||
NS_IMETHODIMP
|
||||
nsUnicharStreamLoader::GetBindInfo(nsIURI* aURL,
|
||||
nsStreamBindingInfo* aInfo)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
#endif // 0
|
||||
|
||||
#define BUF_SIZE 1024
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsUnicharStreamLoader::OnDataAvailable(nsISupports *ctxt,
|
||||
nsUnicharStreamLoader::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *inStr,
|
||||
PRUint32 sourceOffset, PRUint32 count)
|
||||
{
|
||||
|
@ -134,8 +134,8 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt) { return NS_OK; }
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt) { return NS_OK; }
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
#else
|
||||
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 Progress, PRUint32 ProgressMax) { return NS_OK; }
|
||||
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg) { return NS_OK; }
|
||||
@ -145,7 +145,8 @@ public:
|
||||
};
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP CStreamListener::OnStopRequest(nsISupports* aContext, nsresult status, const PRUnichar* aMsg)
|
||||
NS_IMETHODIMP CStreamListener::OnStopRequest(nsIChannel* channel, nsISupports* aContext,
|
||||
nsresult status, const PRUnichar* aMsg)
|
||||
#else
|
||||
NS_IMETHODIMP CStreamListener::OnStopRequest(nsIURI* aURL, nsresult status, const PRUnichar* aMsg)
|
||||
#endif
|
||||
|
@ -970,7 +970,7 @@ nsresult nsParser::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo){
|
||||
*/
|
||||
nsresult
|
||||
#ifdef NECKO
|
||||
nsParser::OnProgress(nsISupports* aContext, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
nsParser::OnProgress(nsIChannel* channel, nsISupports* aContext, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#else
|
||||
nsParser::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#endif
|
||||
@ -978,7 +978,7 @@ nsParser::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
nsresult result=0;
|
||||
#ifdef NECKO
|
||||
if (nsnull != mProgressEventSink) {
|
||||
mProgressEventSink->OnProgress(aContext, aProgress, aProgressMax);
|
||||
mProgressEventSink->OnProgress(channel, aContext, aProgress, aProgressMax);
|
||||
}
|
||||
#else
|
||||
if (nsnull != mObserver) {
|
||||
@ -997,7 +997,7 @@ nsParser::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
*/
|
||||
nsresult
|
||||
#ifdef NECKO
|
||||
nsParser::OnStatus(nsISupports* aContext, const PRUnichar* aMsg)
|
||||
nsParser::OnStatus(nsIChannel* channel, nsISupports* aContext, const PRUnichar* aMsg)
|
||||
#else
|
||||
nsParser::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
#endif
|
||||
@ -1005,7 +1005,7 @@ nsParser::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
nsresult result=0;
|
||||
#ifdef NECKO
|
||||
if (nsnull != mProgressEventSink) {
|
||||
mProgressEventSink->OnStatus(aContext, aMsg);
|
||||
mProgressEventSink->OnStatus(channel, aContext, aMsg);
|
||||
}
|
||||
#else
|
||||
if (nsnull != mObserver) {
|
||||
@ -1028,7 +1028,7 @@ nsParser::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
* @return error code -- 0 if ok, non-zero if error.
|
||||
*/
|
||||
#ifdef NECKO
|
||||
nsresult nsParser::OnStartRequest(nsISupports* aContext)
|
||||
nsresult nsParser::OnStartRequest(nsIChannel* channel, nsISupports* aContext)
|
||||
#else
|
||||
nsresult nsParser::OnStartRequest(nsIURI* aURL, const char *aSourceType)
|
||||
#endif
|
||||
@ -1037,7 +1037,7 @@ nsresult nsParser::OnStartRequest(nsIURI* aURL, const char *aSourceType)
|
||||
|
||||
if (nsnull != mObserver) {
|
||||
#ifdef NECKO
|
||||
mObserver->OnStartRequest(aContext);
|
||||
mObserver->OnStartRequest(channel, aContext);
|
||||
#else
|
||||
mObserver->OnStartRequest(aURL, aSourceType);
|
||||
#endif
|
||||
@ -1047,18 +1047,13 @@ nsresult nsParser::OnStartRequest(nsIURI* aURL, const char *aSourceType)
|
||||
mParserContext->mDTD=0;
|
||||
#ifdef NECKO
|
||||
nsresult rv;
|
||||
nsIChannel* channel;
|
||||
rv = aContext->QueryInterface(nsIChannel::GetIID(), (void**)&channel);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
char* contentType;
|
||||
rv = channel->GetContentType(&contentType);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_ASSERTION(contentType, "parser needs a content type to find a dtd");
|
||||
}
|
||||
mParserContext->mSourceType = contentType;
|
||||
nsCRT::free(contentType);
|
||||
NS_RELEASE(channel);
|
||||
char* contentType;
|
||||
rv = channel->GetContentType(&contentType);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_ASSERTION(contentType, "parser needs a content type to find a dtd");
|
||||
}
|
||||
mParserContext->mSourceType = contentType;
|
||||
nsCRT::free(contentType);
|
||||
#else
|
||||
mParserContext->mSourceType=aSourceType;
|
||||
#endif
|
||||
@ -1079,7 +1074,8 @@ nsresult nsParser::OnStartRequest(nsIURI* aURL, const char *aSourceType)
|
||||
* @return error code (usually 0)
|
||||
*/
|
||||
#ifdef NECKO
|
||||
nsresult nsParser::OnDataAvailable(nsISupports* aContext, nsIInputStream *pIStream, PRUint32 sourceOffset, PRUint32 aLength)
|
||||
nsresult nsParser::OnDataAvailable(nsIChannel* channel, nsISupports* aContext,
|
||||
nsIInputStream *pIStream, PRUint32 sourceOffset, PRUint32 aLength)
|
||||
#else
|
||||
nsresult nsParser::OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUint32 aLength)
|
||||
#endif
|
||||
@ -1152,7 +1148,8 @@ nsresult nsParser::OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUin
|
||||
* @return
|
||||
*/
|
||||
#ifdef NECKO
|
||||
nsresult nsParser::OnStopRequest(nsISupports* aContext, nsresult status, const PRUnichar* aMsg)
|
||||
nsresult nsParser::OnStopRequest(nsIChannel* channel, nsISupports* aContext,
|
||||
nsresult status, const PRUnichar* aMsg)
|
||||
#else
|
||||
nsresult nsParser::OnStopRequest(nsIURI* aURL, nsresult status, const PRUnichar* aMsg)
|
||||
#endif
|
||||
@ -1172,7 +1169,7 @@ nsresult nsParser::OnStopRequest(nsIURI* aURL, nsresult status, const PRUnichar*
|
||||
// parser isn't yet enabled?
|
||||
if (nsnull != mObserver) {
|
||||
#ifdef NECKO
|
||||
mObserver->OnStopRequest(aContext, status, aMsg);
|
||||
mObserver->OnStopRequest(channel, aContext, status, aMsg);
|
||||
#else
|
||||
mObserver->OnStopRequest(aURL, status, aMsg);
|
||||
#endif
|
||||
|
@ -241,13 +241,13 @@ friend class CTokenHandler;
|
||||
//*********************************************
|
||||
#ifdef NECKO
|
||||
// nsIProgressEventSink methods:
|
||||
NS_IMETHOD OnProgress(nsISupports* context, PRUint32 Progress, PRUint32 ProgressMax);
|
||||
NS_IMETHOD OnStatus(nsISupports* context, const PRUnichar* aMmsg);
|
||||
NS_IMETHOD OnProgress(nsIChannel* channel, nsISupports* context, PRUint32 Progress, PRUint32 ProgressMax);
|
||||
NS_IMETHOD OnStatus(nsIChannel* channel, nsISupports* context, const PRUnichar* aMmsg);
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
#else
|
||||
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
|
||||
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 Progress, PRUint32 ProgressMax);
|
||||
|
@ -572,7 +572,7 @@ rdf_BlockingParse(nsIURI* aURL, nsIStreamListener* aConsumer)
|
||||
goto done;
|
||||
|
||||
#ifdef NECKO
|
||||
aConsumer->OnStartRequest(channel);
|
||||
aConsumer->OnStartRequest(channel, nsnull);
|
||||
#else
|
||||
// XXX shouldn't netlib be doing this???
|
||||
aConsumer->OnStartRequest(aURL, "text/rdf");
|
||||
@ -590,7 +590,7 @@ rdf_BlockingParse(nsIURI* aURL, nsIStreamListener* aConsumer)
|
||||
proxy->SetBuffer(buf, readCount);
|
||||
|
||||
#ifdef NECKO
|
||||
rv = aConsumer->OnDataAvailable(channel, proxy, sourceOffset, readCount);
|
||||
rv = aConsumer->OnDataAvailable(channel, nsnull, proxy, sourceOffset, readCount);
|
||||
sourceOffset += readCount;
|
||||
#else
|
||||
// XXX shouldn't netlib be doing this???
|
||||
@ -603,7 +603,7 @@ rdf_BlockingParse(nsIURI* aURL, nsIStreamListener* aConsumer)
|
||||
rv = NS_OK;
|
||||
}
|
||||
#ifdef NECKO
|
||||
aConsumer->OnStopRequest(channel, NS_OK, nsnull);
|
||||
aConsumer->OnStopRequest(channel, nsnull, NS_OK, nsnull);
|
||||
#else
|
||||
// XXX shouldn't netlib be doing this???
|
||||
aConsumer->OnStopRequest(aURL, 0, nsnull);
|
||||
|
@ -85,10 +85,10 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
#else
|
||||
// stream observer
|
||||
|
||||
@ -607,7 +607,7 @@ FTPDataSourceCallback::~FTPDataSourceCallback()
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
FTPDataSourceCallback::OnStartRequest(nsISupports *ctxt)
|
||||
FTPDataSourceCallback::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
#else
|
||||
FTPDataSourceCallback::OnStartRequest(nsIURI *aURL, const char *aContentType)
|
||||
#endif
|
||||
@ -645,7 +645,7 @@ FTPDataSourceCallback::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
FTPDataSourceCallback::OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg)
|
||||
FTPDataSourceCallback::OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg)
|
||||
#else
|
||||
FTPDataSourceCallback::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
|
||||
#endif
|
||||
@ -679,8 +679,8 @@ FTPDataSourceCallback::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
FTPDataSourceCallback::OnDataAvailable(nsISupports *ctxt, nsIInputStream *aIStream,
|
||||
PRUint32 sourceOffset, PRUint32 aLength)
|
||||
FTPDataSourceCallback::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *aIStream, PRUint32 sourceOffset, PRUint32 aLength)
|
||||
#else
|
||||
FTPDataSourceCallback::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, PRUint32 aLength)
|
||||
#endif
|
||||
|
@ -52,6 +52,7 @@
|
||||
#include "nsIURL.h"
|
||||
#ifdef NECKO
|
||||
#include "nsNeckoUtil.h"
|
||||
#include "nsIChannel.h"
|
||||
#else
|
||||
#include "nsIPostToServer.h"
|
||||
#endif // NECKO
|
||||
@ -112,10 +113,10 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
#else
|
||||
// stream observer
|
||||
|
||||
@ -1509,7 +1510,7 @@ SearchDataSourceCallback::~SearchDataSourceCallback()
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
SearchDataSourceCallback::OnStartRequest(nsISupports *ctxt)
|
||||
SearchDataSourceCallback::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
#else
|
||||
SearchDataSourceCallback::OnStartRequest(nsIURI *aURL, const char *aContentType)
|
||||
#endif
|
||||
@ -1552,7 +1553,8 @@ SearchDataSourceCallback::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
SearchDataSourceCallback::OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg)
|
||||
SearchDataSourceCallback::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg)
|
||||
#else
|
||||
SearchDataSourceCallback::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
|
||||
#endif
|
||||
@ -1561,13 +1563,9 @@ SearchDataSourceCallback::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PR
|
||||
nsIRDFLiteral *literal = nsnull;
|
||||
nsresult rv;
|
||||
#ifdef NECKO
|
||||
nsIURI* aURL = (nsIURI*)ctxt; // this is true because of how NS_OpenURI works...
|
||||
#ifdef DEBUG
|
||||
// but verify anyway
|
||||
rv = ctxt->QueryInterface(nsIURI::GetIID(), (void**)aURL);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "bad assumption about NS_OpenURI");
|
||||
NS_RELEASE(aURL);
|
||||
#endif
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
|
||||
if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(trueStr.GetUnicode(), &literal)))
|
||||
@ -2023,8 +2021,8 @@ SearchDataSourceCallback::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
SearchDataSourceCallback::OnDataAvailable(nsISupports *ctxt, nsIInputStream *aIStream,
|
||||
PRUint32 sourceOffset, PRUint32 aLength)
|
||||
SearchDataSourceCallback::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt, nsIInputStream *aIStream,
|
||||
PRUint32 sourceOffset, PRUint32 aLength)
|
||||
#else
|
||||
SearchDataSourceCallback::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, PRUint32 aLength)
|
||||
#endif
|
||||
|
@ -132,17 +132,17 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg);
|
||||
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr,
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt, nsIInputStream *inStr,
|
||||
PRUint32 sourceOffset, PRUint32 count);
|
||||
|
||||
// nsIProgressEventSink methods:
|
||||
NS_IMETHOD OnProgress(nsISupports *ctxt, PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatus(nsISupports *ctxt, const PRUnichar *aMsg);
|
||||
NS_IMETHOD OnProgress(nsIChannel* channel, nsISupports *ctxt, PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatus(nsIChannel* channel, nsISupports *ctxt, const PRUnichar *aMsg);
|
||||
#else
|
||||
/* nsIStreamListener interface methods... */
|
||||
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
|
||||
@ -1650,7 +1650,8 @@ NS_METHOD nsDocumentBindInfo::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aIn
|
||||
#endif
|
||||
|
||||
#ifdef NECKO
|
||||
NS_METHOD nsDocumentBindInfo::OnProgress(nsISupports *ctxt, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
NS_METHOD nsDocumentBindInfo::OnProgress(nsIChannel* channel, nsISupports *ctxt,
|
||||
PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#else
|
||||
NS_METHOD nsDocumentBindInfo::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#endif
|
||||
@ -1658,8 +1659,6 @@ NS_METHOD nsDocumentBindInfo::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUin
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(ctxt);
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -1713,7 +1712,7 @@ NS_METHOD nsDocumentBindInfo::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUin
|
||||
|
||||
|
||||
#ifdef NECKO
|
||||
NS_METHOD nsDocumentBindInfo::OnStatus(nsISupports *ctxt, const PRUnichar *aMsg)
|
||||
NS_METHOD nsDocumentBindInfo::OnStatus(nsIChannel* channel, nsISupports *ctxt, const PRUnichar *aMsg)
|
||||
#else
|
||||
NS_METHOD nsDocumentBindInfo::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
#endif
|
||||
@ -1721,8 +1720,6 @@ NS_METHOD nsDocumentBindInfo::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(ctxt);
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -1762,7 +1759,7 @@ NS_METHOD nsDocumentBindInfo::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsDocumentBindInfo::OnStartRequest(nsISupports *ctxt)
|
||||
nsDocumentBindInfo::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
#else
|
||||
nsDocumentBindInfo::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
#endif
|
||||
@ -1771,8 +1768,6 @@ nsDocumentBindInfo::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
nsIContentViewer* viewer = nsnull;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(ctxt);
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -1855,7 +1850,7 @@ nsDocumentBindInfo::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
*/
|
||||
if (nsnull != m_NextStream) {
|
||||
#ifdef NECKO
|
||||
rv = m_NextStream->OnStartRequest(channel);
|
||||
rv = m_NextStream->OnStartRequest(channel, ctxt);
|
||||
#else
|
||||
rv = m_NextStream->OnStartRequest(aURL, aContentType);
|
||||
#endif
|
||||
@ -1876,7 +1871,7 @@ nsDocumentBindInfo::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
/* Pass the notification out to the Observer... */
|
||||
if (nsnull != m_Observer) {
|
||||
#ifdef NECKO
|
||||
nsresult rv2 = m_Observer->OnStartRequest(channel);
|
||||
nsresult rv2 = m_Observer->OnStartRequest(channel, ctxt);
|
||||
#else
|
||||
nsresult rv2 = m_Observer->OnStartRequest(aURL, aContentType);
|
||||
#endif
|
||||
@ -1892,7 +1887,7 @@ nsDocumentBindInfo::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
|
||||
|
||||
#ifdef NECKO
|
||||
NS_METHOD nsDocumentBindInfo::OnDataAvailable(nsISupports *ctxt,
|
||||
NS_METHOD nsDocumentBindInfo::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *aStream,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 aLength)
|
||||
@ -1903,8 +1898,6 @@ NS_METHOD nsDocumentBindInfo::OnDataAvailable(nsIURI* aURL, nsIInputStream *aStr
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(ctxt);
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -1945,7 +1938,7 @@ NS_METHOD nsDocumentBindInfo::OnDataAvailable(nsIURI* aURL, nsIInputStream *aStr
|
||||
|
||||
NS_ADDREF(listener);
|
||||
#ifdef NECKO
|
||||
rv = listener->OnDataAvailable(ctxt, aStream, sourceOffset, aLength);
|
||||
rv = listener->OnDataAvailable(channel, ctxt, aStream, sourceOffset, aLength);
|
||||
#else
|
||||
rv = listener->OnDataAvailable(aURL, aStream, aLength);
|
||||
#endif
|
||||
@ -1960,8 +1953,8 @@ done:
|
||||
|
||||
|
||||
#ifdef NECKO
|
||||
NS_METHOD nsDocumentBindInfo::OnStopRequest(nsISupports *ctxt, nsresult aStatus,
|
||||
const PRUnichar *aMsg)
|
||||
NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult aStatus, const PRUnichar *aMsg)
|
||||
#else
|
||||
NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
|
||||
#endif
|
||||
@ -1969,8 +1962,6 @@ NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIURI* aURL, nsresult aStatus, cons
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(ctxt);
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -2015,7 +2006,7 @@ NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIURI* aURL, nsresult aStatus, cons
|
||||
|
||||
if (nsnull != m_NextStream) {
|
||||
#ifdef NECKO
|
||||
rv = m_NextStream->OnStopRequest(ctxt, aStatus, aMsg);
|
||||
rv = m_NextStream->OnStopRequest(channel, ctxt, aStatus, aMsg);
|
||||
#else
|
||||
rv = m_NextStream->OnStopRequest(aURL, aStatus, aMsg);
|
||||
#endif
|
||||
@ -2025,7 +2016,7 @@ NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIURI* aURL, nsresult aStatus, cons
|
||||
if (nsnull != m_Observer) {
|
||||
/* XXX: Should we ignore the return value? */
|
||||
#ifdef NECKO
|
||||
(void) m_Observer->OnStopRequest(ctxt, aStatus, aMsg);
|
||||
(void) m_Observer->OnStopRequest(channel, ctxt, aStatus, aMsg);
|
||||
#else
|
||||
(void) m_Observer->OnStopRequest(aURL, aStatus, aMsg);
|
||||
#endif
|
||||
|
@ -132,17 +132,17 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg);
|
||||
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr,
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt, nsIInputStream *inStr,
|
||||
PRUint32 sourceOffset, PRUint32 count);
|
||||
|
||||
// nsIProgressEventSink methods:
|
||||
NS_IMETHOD OnProgress(nsISupports *ctxt, PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatus(nsISupports *ctxt, const PRUnichar *aMsg);
|
||||
NS_IMETHOD OnProgress(nsIChannel* channel, nsISupports *ctxt, PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatus(nsIChannel* channel, nsISupports *ctxt, const PRUnichar *aMsg);
|
||||
#else
|
||||
/* nsIStreamListener interface methods... */
|
||||
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
|
||||
@ -1650,7 +1650,8 @@ NS_METHOD nsDocumentBindInfo::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aIn
|
||||
#endif
|
||||
|
||||
#ifdef NECKO
|
||||
NS_METHOD nsDocumentBindInfo::OnProgress(nsISupports *ctxt, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
NS_METHOD nsDocumentBindInfo::OnProgress(nsIChannel* channel, nsISupports *ctxt,
|
||||
PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#else
|
||||
NS_METHOD nsDocumentBindInfo::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#endif
|
||||
@ -1658,8 +1659,6 @@ NS_METHOD nsDocumentBindInfo::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUin
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(ctxt);
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -1713,7 +1712,7 @@ NS_METHOD nsDocumentBindInfo::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUin
|
||||
|
||||
|
||||
#ifdef NECKO
|
||||
NS_METHOD nsDocumentBindInfo::OnStatus(nsISupports *ctxt, const PRUnichar *aMsg)
|
||||
NS_METHOD nsDocumentBindInfo::OnStatus(nsIChannel* channel, nsISupports *ctxt, const PRUnichar *aMsg)
|
||||
#else
|
||||
NS_METHOD nsDocumentBindInfo::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
#endif
|
||||
@ -1721,8 +1720,6 @@ NS_METHOD nsDocumentBindInfo::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(ctxt);
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -1762,7 +1759,7 @@ NS_METHOD nsDocumentBindInfo::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsDocumentBindInfo::OnStartRequest(nsISupports *ctxt)
|
||||
nsDocumentBindInfo::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
#else
|
||||
nsDocumentBindInfo::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
#endif
|
||||
@ -1771,8 +1768,6 @@ nsDocumentBindInfo::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
nsIContentViewer* viewer = nsnull;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(ctxt);
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -1855,7 +1850,7 @@ nsDocumentBindInfo::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
*/
|
||||
if (nsnull != m_NextStream) {
|
||||
#ifdef NECKO
|
||||
rv = m_NextStream->OnStartRequest(channel);
|
||||
rv = m_NextStream->OnStartRequest(channel, ctxt);
|
||||
#else
|
||||
rv = m_NextStream->OnStartRequest(aURL, aContentType);
|
||||
#endif
|
||||
@ -1876,7 +1871,7 @@ nsDocumentBindInfo::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
/* Pass the notification out to the Observer... */
|
||||
if (nsnull != m_Observer) {
|
||||
#ifdef NECKO
|
||||
nsresult rv2 = m_Observer->OnStartRequest(channel);
|
||||
nsresult rv2 = m_Observer->OnStartRequest(channel, ctxt);
|
||||
#else
|
||||
nsresult rv2 = m_Observer->OnStartRequest(aURL, aContentType);
|
||||
#endif
|
||||
@ -1892,7 +1887,7 @@ nsDocumentBindInfo::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
|
||||
|
||||
#ifdef NECKO
|
||||
NS_METHOD nsDocumentBindInfo::OnDataAvailable(nsISupports *ctxt,
|
||||
NS_METHOD nsDocumentBindInfo::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *aStream,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 aLength)
|
||||
@ -1903,8 +1898,6 @@ NS_METHOD nsDocumentBindInfo::OnDataAvailable(nsIURI* aURL, nsIInputStream *aStr
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(ctxt);
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -1945,7 +1938,7 @@ NS_METHOD nsDocumentBindInfo::OnDataAvailable(nsIURI* aURL, nsIInputStream *aStr
|
||||
|
||||
NS_ADDREF(listener);
|
||||
#ifdef NECKO
|
||||
rv = listener->OnDataAvailable(ctxt, aStream, sourceOffset, aLength);
|
||||
rv = listener->OnDataAvailable(channel, ctxt, aStream, sourceOffset, aLength);
|
||||
#else
|
||||
rv = listener->OnDataAvailable(aURL, aStream, aLength);
|
||||
#endif
|
||||
@ -1960,8 +1953,8 @@ done:
|
||||
|
||||
|
||||
#ifdef NECKO
|
||||
NS_METHOD nsDocumentBindInfo::OnStopRequest(nsISupports *ctxt, nsresult aStatus,
|
||||
const PRUnichar *aMsg)
|
||||
NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult aStatus, const PRUnichar *aMsg)
|
||||
#else
|
||||
NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
|
||||
#endif
|
||||
@ -1969,8 +1962,6 @@ NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIURI* aURL, nsresult aStatus, cons
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(ctxt);
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -2015,7 +2006,7 @@ NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIURI* aURL, nsresult aStatus, cons
|
||||
|
||||
if (nsnull != m_NextStream) {
|
||||
#ifdef NECKO
|
||||
rv = m_NextStream->OnStopRequest(ctxt, aStatus, aMsg);
|
||||
rv = m_NextStream->OnStopRequest(channel, ctxt, aStatus, aMsg);
|
||||
#else
|
||||
rv = m_NextStream->OnStopRequest(aURL, aStatus, aMsg);
|
||||
#endif
|
||||
@ -2025,7 +2016,7 @@ NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIURI* aURL, nsresult aStatus, cons
|
||||
if (nsnull != m_Observer) {
|
||||
/* XXX: Should we ignore the return value? */
|
||||
#ifdef NECKO
|
||||
(void) m_Observer->OnStopRequest(ctxt, aStatus, aMsg);
|
||||
(void) m_Observer->OnStopRequest(channel, ctxt, aStatus, aMsg);
|
||||
#else
|
||||
(void) m_Observer->OnStopRequest(aURL, aStatus, aMsg);
|
||||
#endif
|
||||
|
@ -1870,7 +1870,8 @@ nsBrowserWindow::FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTak
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsBrowserWindow::OnProgress(nsISupports *ctxt, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
nsBrowserWindow::OnProgress(nsIChannel* channel, nsISupports *ctxt,
|
||||
PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#else
|
||||
nsBrowserWindow::OnProgress(nsIURI* aURL,
|
||||
PRUint32 aProgress,
|
||||
@ -1880,8 +1881,6 @@ nsBrowserWindow::OnProgress(nsIURI* aURL,
|
||||
nsresult rv;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(ctxt);
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -1919,7 +1918,7 @@ nsBrowserWindow::OnProgress(nsIURI* aURL,
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsBrowserWindow::OnStatus(nsISupports *ctxt, const PRUnichar *aMsg)
|
||||
nsBrowserWindow::OnStatus(nsIChannel* channel, nsISupports *ctxt, const PRUnichar *aMsg)
|
||||
#else
|
||||
nsBrowserWindow::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
#endif
|
||||
@ -1933,7 +1932,7 @@ nsBrowserWindow::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsBrowserWindow::OnStartRequest(nsISupports *ctxt)
|
||||
nsBrowserWindow::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
#else
|
||||
nsBrowserWindow::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
#endif
|
||||
@ -1941,8 +1940,6 @@ nsBrowserWindow::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
nsresult rv;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(ctxt);
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -1974,7 +1971,8 @@ nsBrowserWindow::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsBrowserWindow::OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg)
|
||||
nsBrowserWindow::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg)
|
||||
#else
|
||||
nsBrowserWindow::OnStopRequest(nsIURI* aURL,
|
||||
nsresult status,
|
||||
@ -1984,8 +1982,6 @@ nsBrowserWindow::OnStopRequest(nsIURI* aURL,
|
||||
nsresult rv;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(ctxt);
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
@ -109,12 +109,14 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg);
|
||||
|
||||
// nsIProgressEventSink
|
||||
NS_IMETHOD OnProgress(nsISupports *ctxt, PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatus(nsISupports *ctxt, const PRUnichar *aMsg);
|
||||
NS_IMETHOD OnProgress(nsIChannel* channel, nsISupports *ctxt,
|
||||
PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatus(nsIChannel* channel, nsISupports *ctxt, const PRUnichar *aMsg);
|
||||
|
||||
#else
|
||||
// nsIStreamObserver
|
||||
|
@ -602,7 +602,7 @@ NS_IMETHODIMP nsXPBaseWindow::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
|
||||
//----------------------------------------
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsXPBaseWindow::OnStartRequest(nsISupports *ctxt)
|
||||
NS_IMETHODIMP nsXPBaseWindow::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
#else
|
||||
NS_IMETHODIMP nsXPBaseWindow::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
#endif
|
||||
@ -612,8 +612,8 @@ NS_IMETHODIMP nsXPBaseWindow::OnStartRequest(nsIURI* aURL, const char *aContentT
|
||||
|
||||
//----------------------------------------
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsXPBaseWindow::OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg)
|
||||
NS_IMETHODIMP nsXPBaseWindow::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg)
|
||||
#else
|
||||
NS_IMETHODIMP nsXPBaseWindow::OnStopRequest(nsIURI* aURL, nsresult status, const PRUnichar* aMsg)
|
||||
#endif
|
||||
|
@ -91,9 +91,9 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg);
|
||||
#else
|
||||
// nsIStreamObserver
|
||||
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
|
||||
|
@ -100,12 +100,13 @@ public:
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg);
|
||||
|
||||
// nsIStreamListener
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
|
||||
#else
|
||||
// stream observer
|
||||
@ -242,7 +243,7 @@ NS_IMPL_ISUPPORTS(RelatedLinksStreamListener, nsIStreamListener::GetIID());
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
RelatedLinksStreamListener::OnStartRequest(nsISupports *ctxt)
|
||||
RelatedLinksStreamListener::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
#else
|
||||
RelatedLinksStreamListener::OnStartRequest(nsIURI *aURL, const char *aContentType)
|
||||
#endif
|
||||
@ -278,8 +279,8 @@ RelatedLinksStreamListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
RelatedLinksStreamListener::OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg)
|
||||
RelatedLinksStreamListener::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg)
|
||||
#else
|
||||
RelatedLinksStreamListener::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
|
||||
#endif
|
||||
@ -311,7 +312,7 @@ RelatedLinksStreamListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
RelatedLinksStreamListener::OnDataAvailable(nsISupports *ctxt,
|
||||
RelatedLinksStreamListener::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *aIStream,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 aLength)
|
||||
|
@ -217,7 +217,7 @@ nsDownloadProgressDialog::ConstructBeforeJavaScript(nsIWebShell *aWebShell) {
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsDownloadProgressDialog::OnDataAvailable(nsISupports* aContext, nsIInputStream *aIStream,
|
||||
nsDownloadProgressDialog::OnDataAvailable(nsIChannel* channel, nsISupports* aContext, nsIInputStream *aIStream,
|
||||
PRUint32 offset, PRUint32 aLength)
|
||||
#else
|
||||
nsDownloadProgressDialog::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, PRUint32 aLength)
|
||||
@ -270,7 +270,7 @@ nsDownloadProgressDialog::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsDownloadProgressDialog::OnStartRequest(nsISupports* aContext)
|
||||
nsDownloadProgressDialog::OnStartRequest(nsIChannel* channel, nsISupports* aContext)
|
||||
#else
|
||||
nsDownloadProgressDialog::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
#endif
|
||||
@ -281,7 +281,8 @@ nsDownloadProgressDialog::OnStartRequest(nsIURI* aURL, const char *aContentType)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsDownloadProgressDialog::OnProgress(nsISupports* aContext, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
nsDownloadProgressDialog::OnProgress(nsIChannel* channel, nsISupports* aContext,
|
||||
PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#else
|
||||
nsDownloadProgressDialog::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#endif
|
||||
@ -297,7 +298,8 @@ nsDownloadProgressDialog::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsDownloadProgressDialog::OnStatus(nsISupports* aContext, const PRUnichar* aMsg)
|
||||
nsDownloadProgressDialog::OnStatus(nsIChannel* channel, nsISupports* aContext,
|
||||
const PRUnichar* aMsg)
|
||||
#else
|
||||
nsDownloadProgressDialog::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
#endif
|
||||
@ -310,7 +312,8 @@ nsDownloadProgressDialog::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsDownloadProgressDialog::OnStopRequest(nsISupports* aContext, nsresult aStatus, const PRUnichar* aMsg)
|
||||
nsDownloadProgressDialog::OnStopRequest(nsIChannel* channel, nsISupports* aContext,
|
||||
nsresult aStatus, const PRUnichar* aMsg)
|
||||
#else
|
||||
nsDownloadProgressDialog::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
|
||||
#endif
|
||||
|
@ -28,12 +28,18 @@
|
||||
#include "nsIURL.h"
|
||||
#include "nsIWebShellWindow.h"
|
||||
#include "nsIWebShell.h"
|
||||
#ifdef NECKO
|
||||
#include "nsIProgressEventSink.h"
|
||||
#endif
|
||||
|
||||
/*------------------------- nsDownloadProgressDialog ---------------------------
|
||||
| This class implements a "download progress" dialog that transfers a URL |
|
||||
| to an output file and indicates the progress to the user as it does so. |
|
||||
------------------------------------------------------------------------------*/
|
||||
class nsDownloadProgressDialog : public nsIXULWindowCallbacks,
|
||||
#ifdef NECKO
|
||||
public nsIProgressEventSink,
|
||||
#endif
|
||||
public nsIStreamListener,
|
||||
public nsIDocumentObserver {
|
||||
public:
|
||||
@ -47,13 +53,13 @@ public:
|
||||
// Declare implementations of nsIStreamListener/nsIStreamObserver functions.
|
||||
#ifdef NECKO
|
||||
// nsIProgressEventSink methods:
|
||||
NS_IMETHOD OnProgress(nsISupports* context, PRUint32 Progress, PRUint32 ProgressMax);
|
||||
NS_IMETHOD OnStatus(nsISupports* context, const PRUnichar* aMmsg);
|
||||
NS_IMETHOD OnProgress(nsIChannel* channel, nsISupports* context, PRUint32 Progress, PRUint32 ProgressMax);
|
||||
NS_IMETHOD OnStatus(nsIChannel* channel, nsISupports* context, const PRUnichar* aMmsg);
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
#else
|
||||
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo) { return NS_ERROR_NOT_IMPLEMENTED; }
|
||||
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, PRUint32 aLength);
|
||||
|
@ -34,14 +34,12 @@
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsIContentViewer.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIURL.h"
|
||||
#ifndef NECKO
|
||||
#include "nsIURL.h"
|
||||
#include "nsINetService.h"
|
||||
#else
|
||||
#include "nsIIOService.h"
|
||||
#include "nsNeckoUtil.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIServiceManager.h"
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
#endif // NECKO
|
||||
#include "nsIWebShell.h"
|
||||
#include "nsIWebShellWindow.h"
|
||||
@ -221,15 +219,7 @@ nsInstallProgressDialog::Open()
|
||||
#ifndef NECKO
|
||||
rv = NS_NewURL( &url, urlStr );
|
||||
#else
|
||||
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsIURI *uri = nsnull;
|
||||
rv = service->NewURI(urlStr, nsnull, &uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
|
||||
NS_RELEASE(uri);
|
||||
rv = NS_NewURI( &url, urlStr );
|
||||
#endif // NECKO
|
||||
|
||||
if ( NS_SUCCEEDED(rv) )
|
||||
|
@ -288,7 +288,7 @@ nsXPInstallManager::OnStatus(nsIURI* aURL,
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsXPInstallManager::OnStartRequest(nsISupports *ctxt)
|
||||
nsXPInstallManager::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
|
||||
#else
|
||||
nsXPInstallManager::OnStartRequest(nsIURI* aURL,
|
||||
const char *aContentType)
|
||||
@ -300,8 +300,8 @@ nsXPInstallManager::OnStartRequest(nsIURI* aURL,
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsXPInstallManager::OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg)
|
||||
nsXPInstallManager::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg)
|
||||
#else
|
||||
nsXPInstallManager::OnStopRequest(nsIURI* aURL,
|
||||
nsresult status,
|
||||
@ -337,7 +337,7 @@ nsXPInstallManager::OnStopRequest(nsIURI* aURL,
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsXPInstallManager::OnDataAvailable(nsISupports *ctxt,
|
||||
nsXPInstallManager::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *pIStream,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 length)
|
||||
|
@ -64,11 +64,11 @@ class nsXPInstallManager : public nsIXPINotifier, public nsIStreamListener
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsIChannel* channel, nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsresult status, const PRUnichar *errorMsg);
|
||||
// nsIStreamListener
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt,
|
||||
NS_IMETHOD OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
|
||||
nsIInputStream *inStr,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 count);
|
||||
|
Loading…
x
Reference in New Issue
Block a user