NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIRequest *request, nsISupports* aContext, nsresult aStatus)
nsPluginCacheListener::OnStopRequest(nsIRequest *request, nsISupports* aContext, nsresult aStatus)
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIRequest *request,                                                         nsISupports* aContext,                                                        nsresult aStatus){  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(nsnull != mPStreamListener)  {    char* urlString;    nsCOMPtr<nsIFile> localFile;#if MOZ_NEW_CACHE    nsCOMPtr<nsICachingChannel> cacheChannel = do_QueryInterface(channel);    if (cacheChannel)        rv = cacheChannel->GetCacheFile(getter_AddRefs(localFile));#else    nsCOMPtr<nsIStreamAsFile> streamAsFile = do_QueryInterface(channel);    if (streamAsFile)        rv = streamAsFile->GetFile(getter_AddRefs(localFile));#endif    if (NS_SUCCEEDED(rv) && localFile)    {      char* pathAndFilename;      rv = localFile->GetPath(&pathAndFilename);      if (NS_SUCCEEDED(rv))      {        OnFileAvailable(pathAndFilename);        nsMemory::Free(pathAndFilename);      }    }    rv = aURL->GetSpec(&urlString);    if (NS_SUCCEEDED(rv))     {      mPluginStreamInfo->SetURL(urlString);      nsCRT::free(urlString);    }    // Set the content type to ensure we don't pass null to the plugin    char* aContentType = nsnull;    rv = channel->GetContentType(&aContentType);    if (NS_FAILED(rv)) return rv;    if (nsnull != aContentType)      mPluginStreamInfo->SetContentType(aContentType);    if (mStartBinding)    {	// On start binding has been called	mPStreamListener->OnStopBinding((nsIPluginStreamInfo*)mPluginStreamInfo, aStatus);    }    else    {	// OnStartBinding hasn't been called, so complete the action.	mPStreamListener->OnStartBinding((nsIPluginStreamInfo*)mPluginStreamInfo);	mPStreamListener->OnStopBinding((nsIPluginStreamInfo*)mPluginStreamInfo, aStatus);    }  if (aContentType)    nsCRT::free(aContentType);  }  return rv;}