m_DocLoader->SetDocumentChannel(channel);
nsresult nsDocumentBindInfo::Bind(nsIURI* aURL, nsIStreamListener* aListener){  nsresult rv = NS_OK;#ifndef NECKO  m_Url = aURL;  NS_ADDREF(m_Url);#endif#if defined(DEBUG)#ifdef NECKO  char *buffer;#else  const char *buffer;#endif  aURL->GetSpec(&buffer);  PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,          ("DocumentBindInfo:%p: OnStartDocumentLoad(...) called for %s.\n",          this, buffer));#ifdef NECKO  nsCRT::free(buffer);#endif#endif /* DEBUG */  //  m_DocLoader->FireOnStartDocumentLoad(aURL, m_Command);  /* Set up the stream listener (if provided)... */  if (nsnull != aListener) {    m_NextStream = aListener;    NS_ADDREF(m_NextStream);  }#ifndef NECKO  /* Start the URL binding process... */  nsINetService *inet = nsnull;  rv = nsServiceManager::GetService(kNetServiceCID,                                    kINetServiceIID,                                    (nsISupports **)&inet);  if (NS_SUCCEEDED(rv)) {    rv = inet->OpenStream(m_Url, this);    nsServiceManager::ReleaseService(kNetServiceCID, inet);  }#else  nsILoadGroup* loadGroup = nsnull;  if (m_DocLoader) {      loadGroup = m_DocLoader->GetLoadGroup();  }  nsCOMPtr<nsIChannel> channel;  rv = NS_OpenURI(getter_AddRefs(channel), aURL);  if (NS_FAILED(rv)) return rv;  m_DocLoader->SetDocumentChannel(channel);  rv = loadGroup->AddChannel(channel, nsnull);  if (NS_FAILED(rv)) return rv;  rv = channel->AsyncRead(0, -1, nsnull, this);  if (NS_FAILED(rv)) return rv;#endif // NECKO  return rv;}