if (conversionRequired) {
rv = m_DocLoader->CreateContentViewer(m_Command, channel, aContentType, m_Container, m_ExtraInfo, &m_NextStream, &viewer); } else { rv = NS_ERROR_NULL_POINTER; }
nsChannelListener::OnStartRequest(nsIChannel *aChannel, nsISupports *aContext){  nsresult rv;  nsCOMPtr<nsIContentViewerContainer> container;  nsCOMPtr<nsIContentViewer> viewer;  ///////////////////////////////  // STREAM CONVERTERS  ///////////////////////////////  nsXPIDLCString contentType;  rv = aChannel->GetContentType(getter_Copies(contentType));  if (NS_FAILED(rv)) return rv;  PRBool conversionRequired = PR_FALSE;  nsAutoString from, to;  // Let's shanghai this channelListener's mNextListener if we want to convert the stream.  if (!PL_strcmp(contentType, "message/rfc822"))  {	  from = "message/rfc822";	  to = "text/xul";	  conversionRequired = PR_TRUE;  }  else if (!PL_strcmp(contentType, "multipart/x-mixed-replace"))   {	  from = "multipart/x-mixed-replace";	  to = "text/html";	  conversionRequired = PR_TRUE;  }  if (conversionRequired)  {	NS_WITH_SERVICE(nsIStreamConverterService, StreamConvService, kStreamConverterServiceCID, &rv);	if (NS_FAILED(rv)) return rv;    // The following call binds this channelListener's mNextListener (typically    // the nsDocumentBindInfo) to the underlying stream converter, and returns    // the underlying stream converter which we then set to be this channelListener's    // mNextListener. This effectively nestles the stream converter down right    // in between the raw stream and the final listener.    nsIStreamListener *converterListener = nsnull;    rv = StreamConvService->AsyncConvertData(from.GetUnicode(), to.GetUnicode(), mNextListener, aChannel,                                             &converterListener);    mNextListener = converterListener;	NS_IF_RELEASE(converterListener);  }  //////////////////////////////  // END STREAM CONVERTERS  //////////////////////////////    // Pass the notification to the next listener...  rv = mNextListener->OnStartRequest(aChannel, aContext);  //  // Notify the document loader...  mDocLoader->GetContainer(getter_AddRefs(container));  if (container) {    container->GetContentViewer(getter_AddRefs(viewer));  }  if (mDocLoader->IsLoadingDocument()) {    nsLoadFlags loadAttribs;    aChannel->GetLoadAttributes(&loadAttribs);    if (!(loadAttribs & nsIChannel::LOAD_BACKGROUND)) {      mDocLoader->FireOnStartURLLoad(mDocLoader,                                      aChannel,                                      viewer);    }  }  return rv;}