nsCOMPtr<nsIStreamListener> finalStreamListener = do_QueryReferent(mWeakPtrPluginStreamListenerPeer); if (!finalStreamListener) return NS_ERROR_FAILURE;
PLUGIN_LOG(PLUGIN_LOG_NOISY, ("nsPluginStreamListenerPeer::OnStopRequest this=%p aStatus=%d request=%p\n", this, aStatus, request));
nsPluginByteRangeStreamListener::OnStopRequest(nsIRequest *request, nsISupports *ctxt,                              nsresult status){  if (!mStreamConverter)    return NS_ERROR_FAILURE;  nsCOMPtr<nsIStreamListener> finalStreamListener = do_QueryReferent(mWeakPtrPluginStreamListenerPeer);  if (!finalStreamListener)    return NS_ERROR_FAILURE;  if (mRemoveMagicNumber) {    // remove magic number from container    nsCOMPtr<nsISupportsPRUint32> container = do_QueryInterface(ctxt);    if (container) {      PRUint32 magicNumber = 0;      container->GetData(&magicNumber);      if (magicNumber == MAGIC_REQUEST_CONTEXT) {        // to allow properly finish nsPluginStreamListenerPeer->OnStopRequest()        // set it to something that is not the magic number.        container->SetData(0);      }    } else {      NS_WARNING("Bad state of nsPluginByteRangeStreamListener");    }  }  return mStreamConverter->OnStopRequest(request, ctxt, status);}