rv = mFinalPluginStreamListener->ServeStreamAsFile(request, ctxt, rv);  mStreamConverter = mFinalPluginStreamListener;
mHaveFiredOnStartRequest = PR_TRUE;     if (mOwner) { nsCOMPtr<nsIPluginTagInfo2> pti2 = do_QueryInterface(mOwner); NS_ENSURE_TRUE(pti2, NS_ERROR_FAILURE); nsPluginTagType tagType; if (NS_FAILED(pti2->GetTagType(&tagType))) return NS_ERROR_FAILURE; }  nsCOMPtr<nsIChannel> channel = do_QueryInterface(request); NS_ENSURE_TRUE(channel, NS_ERROR_FAILURE);     nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel)); PRBool useCacheAsFile = PR_TRUE;  if (httpChannel) { PRUint32 responseCode = 0; rv = httpChannel->GetResponseStatus(&responseCode); if (NS_FAILED(rv) || responseCode > 206) {     mRequestFailed = PR_TRUE; return NS_ERROR_FAILURE; }    nsCAutoString contentEncoding; rv = httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("Content-Encoding"), contentEncoding); if (NS_SUCCEEDED(rv) && !contentEncoding.Equals("identity", nsCaseInsensitiveCStringComparator())) { useCacheAsFile = PR_FALSE; } }  if (useCacheAsFile) { nsCOMPtr<nsICachingChannel> cacheChannel = do_QueryInterface(channel, &rv); if (cacheChannel) rv = cacheChannel->SetCacheAsFile(PR_TRUE); else {   nsCOMPtr<nsIFileChannel> fileChannel = do_QueryInterface(channel, &rv); } }  if (!useCacheAsFile || NS_FAILED(rv)) {  rv = SetupPluginCacheFile(channel); if (NS_FAILED(rv)) NS_WARNING("No Cache Aval.  Some plugins wont work OR we don't have a URL"); }  nsCAutoString aContentType; rv = channel->GetContentType(aContentType); if (NS_FAILED(rv)) return rv; nsCOMPtr<nsIURI> aURL; rv = channel->GetURI(getter_AddRefs(aURL)); if (NS_FAILED(rv)) return rv;  if (!aContentType.IsEmpty()) mPluginStreamInfo->SetContentType(aContentType.get());  #ifdef PLUGIN_LOGGING nsCAutoString urlSpec; if(aURL != nsnull) (void)aURL->GetSpec(urlSpec);  PR_LOG(nsPluginLogging::gPluginLog, PLUGIN_LOG_NOISY, ("nsPluginStreamListenerPeer::OnStartRequest this=%p request=%p mime=%s, url=%s\n", this, request, aContentType.get(), urlSpec.get()));  PR_LogFlush(); #endif  nsPluginWindow    *window = nsnull;         if ((nsnull == mInstance) && (nsnull != mOwner) && (!aContentType.IsEmpty())) { mOwner->GetInstance(mInstance); mOwner->GetWindow(window);  if ((nsnull == mInstance) && (nsnull != mHost) && (nsnull != window)) {  nsPluginMode mode; mOwner->GetMode(&mode); if (mode == nsPluginMode_Embedded) rv = mHost->InstantiateEmbededPlugin(aContentType.get(), aURL, mOwner); else rv = mHost->SetUpPluginInstance(aContentType.get(), aURL, mOwner);  if (NS_OK == rv) {  mOwner->GetInstance(mInstance);  if (nsnull != mInstance) { mInstance->Start(); mOwner->CreateWidget();    if (window->window) mInstance->SetWindow(window); } } } }     PRInt32 length;  rv = channel->GetContentLength(&length);    if (NS_FAILED(rv)) { mPluginStreamInfo->SetLength(PRUint32(-1)); } else { mPluginStreamInfo->SetLength(length); }   rv = SetUpStreamListener(request, aURL); if (NS_FAILED(rv)) return rv;
nsPluginByteRangeStreamListener::OnStartRequest(nsIRequest *request, nsISupports *ctxt){  nsresult rv;  nsCOMPtr<nsIStreamConverterService> serv = do_GetService(kStreamConverterServiceCID, &rv);  if (NS_SUCCEEDED(rv)) {    rv = serv->AsyncConvertData(NS_LITERAL_STRING(MULTIPART_BYTERANGES).get(),                                NS_LITERAL_STRING("*/*").get(),                                mFinalPluginStreamListener,                                nsnull,                                getter_AddRefs(mStreamConverter));    if (NS_SUCCEEDED(rv)) {      rv = mStreamConverter->OnStartRequest(request, ctxt);      if (NS_SUCCEEDED(rv))        return rv;    }    mStreamConverter = 0;  }  // if server cannot continue with byte range (206 status) and sending us whole object (200 status)  // reset this seekable stream & try serve it to plugin instance as a file  rv = mFinalPluginStreamListener->ServeStreamAsFile(request, ctxt, rv);  // always use mFinalPluginStreamListener  mStreamConverter = mFinalPluginStreamListener;  return rv;}