mNPStream.ndata = (void*) this; pluginInfo->GetURL(&mNPStream.url); mNPStream.notifyData = mNotifyData;
case NP_ASFILEONLY : mStreamType = nsPluginStreamType_AsFileOnly; break;
ns4xPluginStreamListener::OnStartBinding(nsIPluginStreamInfo* pluginInfo){  if(!mInst)    return NS_ERROR_FAILURE;  NPP npp;  const NPPluginFuncs *callbacks = nsnull;  mInst->GetCallbacks(&callbacks);  mInst->GetNPP(&npp);  if(!callbacks || !mInst->IsStarted())    return NS_ERROR_FAILURE;  PRBool seekable;  nsMIMEType contentType;  PRUint16 streamType = NP_NORMAL;  NPError error;  mNPStream.ndata = (void*) this;  pluginInfo->GetURL(&mNPStream.url);  mNPStream.notifyData = mNotifyData;  pluginInfo->GetLength((PRUint32*)&(mNPStream.end));  pluginInfo->GetLastModified((PRUint32*)&(mNPStream.lastmodified));  pluginInfo->IsSeekable(&seekable);  pluginInfo->GetContentType(&contentType);  mStreamInfo = pluginInfo;  // if we don't know the end of the stream, use 0 instead of -1. bug 59571  if (mNPStream.end == -1)    mNPStream.end = 0;  NS_TRY_SAFE_CALL_RETURN(error, CallNPP_NewStreamProc(callbacks->newstream,                                                       npp,                                                       (char *)contentType,                                                       &mNPStream,                                                       seekable,                                                       &streamType), mInst->fLibrary);  NPP_PLUGIN_LOG(PLUGIN_LOG_NORMAL,  ("NPP NewStream called: this=%p, npp=%p, mime=%s, seek=%d, type=%d, return=%d, url=%s\n",  this, npp, (char *)contentType, seekable, streamType, error, mNPStream.url));  if(error != NPERR_NO_ERROR)    return NS_ERROR_FAILURE;  // translate the old 4x style stream type to the new one  switch(streamType)  {    case NP_NORMAL:      mStreamType = nsPluginStreamType_Normal;       break;    case NP_ASFILEONLY:      mStreamType = nsPluginStreamType_AsFileOnly;       break;    case NP_ASFILE:      mStreamType = nsPluginStreamType_AsFile;       break;    case NP_SEEK:      mStreamType = nsPluginStreamType_Seek;       break;    default:      return NS_ERROR_FAILURE;  }  // create buffer for stream here because we know the size  mStreamBuffer = (char*) PR_Malloc((PRUint32)MAX_PLUGIN_NECKO_BUFFER);  if (!mStreamBuffer)  {    NS_ASSERTION(PR_FALSE,"failed to create 4.x plugin stream buffer or size MAX_PLUGIN_NECKO_BUFFER");    return NS_ERROR_OUT_OF_MEMORY;  }  mStreamStarted = PR_TRUE;  return NS_OK;}