nsresult rv; PRInt32 colon, fSlash; PRUnichar port; nsAutoString urlSpec; convertFileToURL(nsString(aURLSpec), urlSpec);  fSlash=urlSpec.Find('/');   if ( ((colon=urlSpec.Find(':')) == -1) || ( (fSlash > -1) && (colon > fSlash) ) || ( (colon < urlSpec.Length()-1) && ((port=urlSpec.CharAt(colon+1)) < '9') && (port > '0') ) ) { nsString httpDef("http: urlSpec.Insert(httpDef, 0, 7); }   if (nsnull != mContainer) { rv = mContainer->WillLoadURL(this, urlSpec, nsLoadURL); if (NS_FAILED(rv)) { return rv; } }  nsString* url = new nsString(urlSpec); if (aModifyHistory) {  PRInt32 i, n = mHistory.Count(); i = mHistoryIndex + 1; while (--n >= i) { nsString* u = (nsString*) mHistory.ElementAt(n); delete u; mHistory.RemoveElementAt(n); }   mHistory.AppendElement(url); mHistoryIndex++; } else {  nsString* u = (nsString*) mHistory.ElementAt(mHistoryIndex); if (nsnull != u) { delete u; } mHistory.ReplaceElementAt(url, mHistoryIndex); } ShowHistory();    Stop();   if (nsnull != mContainer) { rv = mContainer->BeginLoadURL(this, urlSpec); if (NS_FAILED(rv)) { return rv; } }  rv = mDocLoader->LoadDocument(urlSpec, aCommand, this, aPostData, nsnull, this, aType, aLocalIP);   return rv;
return LoadURL(aURLSpec,"view",aPostData,aModifyHistory,aType, aLocalIP);
nsWebShell::LoadURL(const PRUnichar *aURLSpec,                    const char* aCommand,                    nsIPostData* aPostData,                    PRBool aModifyHistory,                    nsURLReloadType aType,                    const PRUint32 aLocalIP){  nsresult rv;  PRInt32 colon, fSlash;  PRUnichar port;  nsAutoString urlSpec;  convertFileToURL(nsString(aURLSpec), urlSpec);  fSlash=urlSpec.Find('/');  // if no scheme (protocol) is found, assume http.  if ( ((colon=urlSpec.Find(':')) == -1) // no colon at all      || ( (fSlash > -1) && (colon > fSlash) ) // the only colon comes after the first slash      || ( (colon < urlSpec.Length()-1) // the first char after the first colon is a digit (i.e. a port)            && ((port=urlSpec.CharAt(colon+1)) < '9')            && (port > '0') )      ) {    nsString httpDef("http://");    urlSpec.Insert(httpDef, 0, 7);  }  // Give web-shell-container right of refusal  if (nsnull != mContainer) {    rv = mContainer->WillLoadURL(this, urlSpec, nsLoadURL);    if (NS_FAILED(rv)) {      return rv;    }  }  nsString* url = new nsString(urlSpec);  if (aModifyHistory) {    // Discard part of history that is no longer reachable    PRInt32 i, n = mHistory.Count();    i = mHistoryIndex + 1;    while (--n >= i) {      nsString* u = (nsString*) mHistory.ElementAt(n);      delete u;      mHistory.RemoveElementAt(n);    }    // Tack on new url    mHistory.AppendElement(url);    mHistoryIndex++;  }  else {    // Replace the current history index with this URL    nsString* u = (nsString*) mHistory.ElementAt(mHistoryIndex);    if (nsnull != u) {      delete u;    }    mHistory.ReplaceElementAt(url, mHistoryIndex);  }  ShowHistory();  // Stop loading the current document (if any...).  This call may result in  // firing an EndLoadURL notification for the old document...  Stop();  // Tell web-shell-container we are loading a new url  if (nsnull != mContainer) {    rv = mContainer->BeginLoadURL(this, urlSpec);    if (NS_FAILED(rv)) {      return rv;    }  }  rv = mDocLoader->LoadDocument(urlSpec,       // URL string                                aCommand,         // Command                                this,           // Container                                aPostData,      // Post Data                                nsnull,         // Extra Info...                                this,           // Observer                                aType,          // reload type                                aLocalIP);      // load attributes.  return rv;}