prev->LoadURL(cURL, nsnull, PR_FALSE, (nsLoadFlags) LOAD_HISTORY);
prev->LoadURL(cURL, nsnull, PR_FALSE, (nsLoadFlags) aIsReload?nsIChannel::LOAD_NORMAL:LOAD_HISTORY);
nsHistoryEntry::Load(nsIWebShell * aPrevEntry, PRBool aIsReload) {   nsHistoryEntry * cur=nsnull;   PRBool urlChanged = PR_FALSE;   int i = 0;    //nsIWebShell * pWS = nsnull, *cWS=nsnull;   nsIWebShell *prev=nsnull;   PRBool result = PR_FALSE;   nsString*  cSURL=nsnull, * pSURL=nsnull;   const PRUnichar *  pURL=nsnull, * cURL=nsnull;      cur = this;   prev = aPrevEntry;   if (prev) {     prev->GetURL(&pURL);     pSURL = new nsString(pURL);   }   if (cur) {     cur->GetURL(&cURL);     cSURL = new nsString(cURL);   }     //   NS_ADDREF(aPrevEntry);   if (!cur || !prev) {     return NS_ERROR_NULL_POINTER;   }   //Compare the URLs   {     if ((*pSURL) == cURL)       urlChanged = PR_FALSE;     else       urlChanged = PR_TRUE;   }  // compareURLs    /* The URL to be loaded in it */   cur->GetURL(&cURL);   if (urlChanged || aIsReload) {      if (prev) {         PRBool isInSHist=PR_FALSE, isLoadingDoc=PR_FALSE;         prev->GetIsInSHist(isInSHist);         mHistoryList->GetLoadingFlag(isLoadingDoc);              if ((isInSHist && isLoadingDoc) || aIsReload) {            if (APP_DEBUG) printf("SessionHistory::Load Loading URL %s in webshell %x\n", cSURL->ToNewCString(), prev);            /* Get the child count of the webshell for a later use */            PRInt32  ccount=0;            prev->GetChildCount(ccount);            prev->LoadURL(cURL, nsnull, PR_FALSE, (nsLoadFlags) LOAD_HISTORY);            if (aIsReload && (ccount > 0)) {              /* If this is a reload, on a page with frames, you want to return               * true so that consecutive calls by the frame children in to                * session History will get compared properly. We must fall into               * this case only for top level webshells with frame children.               */               if (APP_DEBUG)  printf("Returning from Load(). Located a webshell with frame children\n");               return PR_TRUE;            }         }         else if (!isInSHist && isLoadingDoc) {           prev->SetURL(cURL);         }      }   }   else if (!urlChanged ) {       /* Mark the changed flag to false. This is used in the end to determine        * whether we are done with the whole loading process for this history        */       if (APP_DEBUG) printf("SessionHistory::Load URLs in webshells %x & %x match \n", mWS, prev);   }   /* Make sure the child windows are in par */   PRInt32  cnt=0, ccnt=0, pcnt=0;   ccnt = cur->GetChildCnt();   prev->GetChildCount(pcnt);   /* If the current entry to be loaded and the one on page don't have    * the same # of children, maybe the one on screen is is in the process of    * building. Don't compare the children.    */  cnt = ccnt;  if (pcnt < ccnt)    cnt = pcnt;       for (i=0; i<cnt; i++){      nsHistoryEntry *cChild=nsnull;      nsIWebShell *  pChild=nsnull;      cur->GetChildAt(i, cChild);    // historyentry      prev->ChildAt(i, pChild);   //webshell      result = cChild->Load(pChild, PR_FALSE);      if (result)         break;   }   if (ccnt != pcnt)     result = PR_TRUE; //   NS_IF_RELEASE(aPrevEntry);     return result;}  /* Load */