mDocumentRequest = request; mLoadGroup->SetDefaultLoadRequest(request);
nsCOMPtr<nsIContentViewerContainer> cvContainer(do_QueryInterface(m_Container)); if (cvContainer) { viewer->SetContainer(m_Container);
nsDocLoaderImpl::OnStartRequest(nsIRequest *request, nsISupports *aCtxt){  // called each time a request is added to the group.#ifdef PR_LOGGING  if (PR_LOG_TEST(gDocLoaderLog, PR_LOG_DEBUG)) {    nsXPIDLString name;    request->GetName(getter_Copies(name));    PRUint32 count = 0;    if (mLoadGroup)      mLoadGroup->GetActiveCount(&count);    PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,           ("DocLoader:%p: OnStartRequest[%p](%s) mIsLoadingDocument=%s, %u active URLs",            this, request, NS_ConvertUCS2toUTF8(name).get(),            (mIsLoadingDocument ? "true" : "false"),            count));  }#endif /* PR_LOGGING */      PRUint32 loadFlags = 0;  request->GetLoadFlags(&loadFlags);  if (!mIsLoadingDocument && (loadFlags & nsIChannel::LOAD_DOCUMENT_URI)) {      mIsLoadingDocument = PR_TRUE;      ClearInternalProgress(); // only clear our progress if we are starting a new load....  }  //  // Only fire an OnStartDocumentLoad(...) if the document loader  // has initiated a load...  Otherwise, this notification has  // resulted from a request being added to the load group.  //  if (mIsLoadingDocument) {    //    // Create a new nsRequestInfo for the request that is starting to    // load...    //    AddRequestInfo(request);    if (loadFlags & nsIChannel::LOAD_DOCUMENT_URI) {      //      // Make sure that hte document channel is null at this point...      // (unless its been redirected)      //      NS_ASSERTION((loadFlags & nsIChannel::LOAD_REPLACE) ||                   !(mDocumentRequest.get()),                   "Overwriting an existing document channel!");      // This request is associated with the entire document...      mDocumentRequest = request;      mLoadGroup->SetDefaultLoadRequest(request);       // Only fire the start document load notification for the first      // document URI...  Do not fire it again for redirections      //      if (!(loadFlags & nsIChannel::LOAD_REPLACE)) {        // Update the progress status state        mProgressStateFlags = nsIWebProgressListener::STATE_START;        // Fire the start document load notification        doStartDocumentLoad();        return NS_OK;      }    }   }  else {    // The DocLoader is not busy, so clear out any cached information...    ClearRequestInfoList();  }  NS_ASSERTION(!mIsLoadingDocument || mDocumentRequest,               "mDocumentRequest MUST be set for the duration of a page load!");  doStartURLLoad(request);  return NS_OK;}