mStreamObserver = dont_QueryInterface(anObserver);
nsDocLoaderImpl::LoadDocument(nsIURI * aUri,                               const char* aCommand,                              nsIContentViewerContainer* aContainer,                              nsIInputStream* aPostDataStream,                              nsISupports* aExtraInfo,                              nsIStreamObserver* anObserver,                              nsLoadFlags aType,                              const PRUint32 aLocalIP,                              const PRUnichar* aReferrer){  nsresult rv = NS_OK;  nsDocumentBindInfo* loader = nsnull;  if (!aUri)    return NS_ERROR_NULL_POINTER;#if defined(DEBUG)  nsXPIDLCString urlSpec;  aUri->GetSpec(getter_Copies(urlSpec));  PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,          ("DocLoader:%p: LoadDocument(...) called for %s.",           this, (const char *) urlSpec));#endif /* DEBUG */  /* Check for initial error conditions... */  if (nsnull == aContainer) {      rv = NS_ERROR_NULL_POINTER;      goto done;  }  NS_NEWXPCOM(loader, nsDocumentBindInfo);  if (nsnull == loader) {      rv = NS_ERROR_OUT_OF_MEMORY;      goto done;  }  NS_ADDREF(loader);  loader->Init(this,           // DocLoader               aCommand,       // Command               aContainer,     // Viewer Container               aExtraInfo,     // Extra Info               anObserver);    // Observer  /*   * Set the flag indicating that the document loader is in the process of   * loading a document.  This flag will remain set until the    * OnConnectionsComplete(...) notification is fired for the loader...   */  mIsLoadingDocument = PR_TRUE;  mStreamObserver = dont_QueryInterface(anObserver);  rv = loader->Bind(aUri, mLoadGroup, aPostDataStream, aReferrer);done:  NS_RELEASE(loader);  return rv;}