Back out dougt's channel changes

This commit is contained in:
disttsc%bart.nl 2006-04-20 03:37:06 +00:00
Родитель d2c911acdc
Коммит fec4b7011b
3 изменённых файлов: 93 добавлений и 25 удалений

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

@ -82,9 +82,7 @@ nsDOMParserChannel::~nsDOMParserChannel()
{
}
NS_IMPL_ISUPPORTS2(nsDOMParserChannel,
nsIChannel,
nsIRequest)
NS_IMPL_ISUPPORTS2(nsDOMParserChannel, nsIRequest, nsIChannel)
/* boolean isPending (); */
NS_IMETHODIMP nsDOMParserChannel::GetName(PRUnichar* *result)
@ -161,6 +159,38 @@ NS_IMETHODIMP nsDOMParserChannel::SetURI(nsIURI * aURI)
return NS_OK;
}
/* attribute unsigned long transferOffset; */
NS_IMETHODIMP nsDOMParserChannel::GetTransferOffset(PRUint32 *aTransferOffset)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsDOMParserChannel::SetTransferOffset(PRUint32 aTransferOffset)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute long transferCount; */
NS_IMETHODIMP nsDOMParserChannel::GetTransferCount(PRInt32 *aTransferCount)
{
NS_ENSURE_ARG(aTransferCount);
*aTransferCount = -1;
return NS_OK;
}
NS_IMETHODIMP nsDOMParserChannel::SetTransferCount(PRInt32 aTransferCount)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute nsLoadFlags loadAttributes; */
NS_IMETHODIMP nsDOMParserChannel::GetLoadAttributes(nsLoadFlags *aLoadAttributes)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsDOMParserChannel::SetLoadAttributes(nsLoadFlags aLoadAttributes)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute string contentType; */
NS_IMETHODIMP nsDOMParserChannel::GetContentType(char * *aContentType)
{
@ -202,16 +232,6 @@ NS_IMETHODIMP nsDOMParserChannel::SetOwner(nsISupports * aOwner)
return NS_OK;
}
/* attribute nsLoadFlags loadAttributes; */
NS_IMETHODIMP nsDOMParserChannel::GetLoadAttributes(nsLoadFlags *aLoadAttributes)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsDOMParserChannel::SetLoadAttributes(nsLoadFlags aLoadAttributes)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute nsILoadGroup loadGroup; */
NS_IMETHODIMP nsDOMParserChannel::GetLoadGroup(nsILoadGroup * *aLoadGroup)
{
@ -242,12 +262,62 @@ NS_IMETHODIMP nsDOMParserChannel::GetSecurityInfo(nsISupports * *aSecurityInfo)
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsDOMParserChannel::Open(nsIInputStream **_retval)
/* attribute unsigned long bufferSegmentSize; */
NS_IMETHODIMP nsDOMParserChannel::GetBufferSegmentSize(PRUint32 *aBufferSegmentSize)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsDOMParserChannel::SetBufferSegmentSize(PRUint32 aBufferSegmentSize)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsDOMParserChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *ctxt)
/* attribute unsigned long bufferMaxSize; */
NS_IMETHODIMP nsDOMParserChannel::GetBufferMaxSize(PRUint32 *aBufferMaxSize)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsDOMParserChannel::SetBufferMaxSize(PRUint32 aBufferMaxSize)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute nsIFile localFile; */
NS_IMETHODIMP nsDOMParserChannel::GetLocalFile(nsIFile * *aLocalFile)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute boolean pipeliningAllowed; */
NS_IMETHODIMP nsDOMParserChannel::GetPipeliningAllowed(PRBool *aPipeliningAllowed)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsDOMParserChannel::SetPipeliningAllowed(PRBool aPipeliningAllowed)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIInputStream openInputStream (); */
NS_IMETHODIMP nsDOMParserChannel::OpenInputStream(nsIInputStream **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIOutputStream openOutputStream (); */
NS_IMETHODIMP nsDOMParserChannel::OpenOutputStream(nsIOutputStream **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void asyncRead (in nsIStreamListener listener, in nsISupports ctxt); */
NS_IMETHODIMP nsDOMParserChannel::AsyncRead(nsIStreamListener *listener, nsISupports *ctxt)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void asyncWrite (in nsIStreamProvider provider, in nsISupports ctxt); */
NS_IMETHODIMP nsDOMParserChannel::AsyncWrite(nsIStreamProvider *provider, nsISupports *ctxt)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
@ -439,7 +509,6 @@ nsDOMParser::ParseFromStream(nsIInputStream *stream,
if (principal) {
channel->SetOwner(principal);
}
nsCOMPtr<nsIRequest> request = NS_STATIC_CAST(nsIRequest*, parserChannel);
// Tell the document to start loading
nsCOMPtr<nsIStreamListener> listener;
@ -456,15 +525,15 @@ nsDOMParser::ParseFromStream(nsIInputStream *stream,
// Now start pumping data to the listener
nsresult status;
rv = listener->OnStartRequest(request, nsnull);
request->GetStatus(&status);
rv = listener->OnStartRequest(channel, nsnull);
channel->GetStatus(&status);
if (NS_SUCCEEDED(rv) && NS_SUCCEEDED(status)) {
rv = listener->OnDataAvailable(request, nsnull, stream, 0, contentLength);
request->GetStatus(&status);
rv = listener->OnDataAvailable(channel, nsnull, stream, 0, contentLength);
channel->GetStatus(&status);
}
rv = listener->OnStopRequest(request, nsnull, status, nsnull);
rv = listener->OnStopRequest(channel, nsnull, status, nsnull);
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
*_retval = domDocument;

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

@ -603,8 +603,8 @@ nsXMLHttpRequest::GetStatusText(char * *aStatusText)
NS_IMETHODIMP
nsXMLHttpRequest::Abort()
{
if (mReadRequest) {
return mReadRequest->Cancel(NS_BINDING_ABORTED);
if (mChannel) {
return mChannel->Cancel(NS_BINDING_ABORTED);
}
return NS_OK;
@ -1038,7 +1038,7 @@ nsXMLHttpRequest::Send(nsISupports *body)
// Start reading from the channel
mStatus = XML_HTTP_REQUEST_SENT;
rv = mChannel->AsyncOpen(listener, nsnull);
rv = mChannel->AsyncRead(listener, nsnull);
#ifdef IMPLEMENT_SYNC_LOAD
if (NS_FAILED(rv)) {

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

@ -89,7 +89,6 @@ protected:
nsIInputStream** aStream);
nsCOMPtr<nsIHTTPChannel> mChannel;
nsCOMPtr<nsIRequest> mReadRequest;
nsCOMPtr<nsIDOMDocument> mDocument;
nsCOMPtr<nsIURI> mBaseURI;
nsCOMPtr<nsIDocument> mBaseDocument;