return mStreamConverter->OnDataAvailable(request, ctxt, inStr, sourceOffset, count);
if(mAbort) { PRUint32 magicNumber = 0; nsCOMPtr<nsISupportsPRUint32> container = do_QueryInterface(aContext); if (container) container->GetData(&magicNumber);  if (magicNumber != MAGIC_REQUEST_CONTEXT) {  mAbort = PR_FALSE; return NS_BINDING_ABORTED; } }  nsresult rv = NS_OK; nsCOMPtr<nsIURI> aURL; nsCOMPtr<nsIChannel> channel = do_QueryInterface(request); if (!channel) return NS_ERROR_FAILURE;  rv = channel->GetURI(getter_AddRefs(aURL)); if (NS_FAILED(rv)) return rv;  if(!mPStreamListener || !mPluginStreamInfo) return NS_ERROR_FAILURE;  nsCAutoString urlString; aURL->GetSpec(urlString); mPluginStreamInfo->SetURL(urlString.get()); PLUGIN_LOG(PLUGIN_LOG_NOISY, ("nsPluginStreamListenerPeer::OnDataAvailable this=%p request=%p, offset=%d, length=%d, url=%s\n", this, request, sourceOffset, aLength, urlString.get()));    if(mStreamType != nsPluginStreamType_AsFileOnly) {  nsCOMPtr<nsIByteRangeRequest> brr = do_QueryInterface(request); PRInt32 absoluteOffset = 0; PRInt32 amtForwardToPlugin = 0; if (brr) { brr->GetStartRange(&absoluteOffset);   nsPRUintKey key(absoluteOffset);  if (!mDataForwardToRequest) return NS_ERROR_FAILURE;  if (mDataForwardToRequest->Exists(&key)) amtForwardToPlugin = NS_PTR_TO_INT32(mDataForwardToRequest->Remove(&key));  mDataForwardToRequest->Put(&key, (void*) (amtForwardToPlugin+aLength)); mPluginStreamInfo->SetStreamOffset(absoluteOffset + amtForwardToPlugin); }  nsCOMPtr<nsIInputStream> stream = aIStream;      nsCOMPtr<nsIOutputStream> outStream; mPluginStreamInfo->GetLocalCachedFileStream(getter_AddRefs(outStream)); if (outStream) { rv = NS_NewInputStreamTee(getter_AddRefs(stream), aIStream, outStream); if (NS_FAILED(rv)) return rv; }  rv =  mPStreamListener->OnDataAvailable((nsIPluginStreamInfo*)mPluginStreamInfo, stream, aLength);    if (NS_FAILED(rv)) request->Cancel(rv); } else {  char* buffer = new char[aLength]; PRUint32 amountRead, amountWrote = 0; rv = aIStream->Read(buffer, aLength, &amountRead);   nsCOMPtr<nsIOutputStream> outStream; mPluginStreamInfo->GetLocalCachedFileStream(getter_AddRefs(outStream)); while (outStream && amountWrote < amountRead && NS_SUCCEEDED(rv)) rv = outStream->Write(buffer, amountRead, &amountWrote); delete [] buffer; } return rv;
nsPluginByteRangeStreamListener::OnDataAvailable(nsIRequest *request, nsISupports *ctxt,                                nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count){  return mStreamConverter->OnDataAvailable(request, ctxt, inStr, sourceOffset, count);}