nsAutoString rootStr = protocolStr + ":
nsAutoString rootStr(protocolStr + ":
nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,                      nsIChannel* channel,                      nsresult aStatus){  nsresult rv;  nsCOMPtr<nsIURI> aURL;  rv = channel->GetURI(getter_AddRefs(aURL));  if (NS_FAILED(rv)) return rv;  char* uProtocol;  char* uHost;  char* uFile;  nsVoidArray* currentURLList;  if(!mPICSRatingsEnabled)    return NS_OK;   nsCOMPtr<nsISupports> cont;  NS_ENSURE_SUCCESS(loader->GetContainer(getter_AddRefs(cont)), NS_ERROR_FAILURE);    nsCOMPtr<nsIWebShellServices> ws(do_QueryInterface(cont));  NS_ENSURE_TRUE(ws, NS_ERROR_FAILURE);    mWebShellServices = ws;  nsVoidKey key((void*)ws);  if(mWebShellServicesURLTable == nsnull) {    return NS_ERROR_NULL_POINTER;  }    if(mWebShellServicesURLTable->Exists(&key)) {    currentURLList = (nsVoidArray *) mWebShellServicesURLTable->Get(&key);    if (currentURLList != NULL) {      PRInt32 count = currentURLList->Count();      for (PRInt32 i = 0; i < count; i++) {        PICS_URLData* urlData = (PICS_URLData*)currentURLList->ElementAt(i);        if(urlData == nsnull)          continue;        char* spec1;        char* spec2;                if(aURL == nsnull)          continue;        aURL->GetSpec(&spec1);        if(spec1 == nsnull)          continue;        if(urlData->url == nsnull) {          nsCRT::free(spec1);          continue;        }        (urlData->url)->GetSpec(&spec2);        if(spec2 == nsnull) {          nsCRT::free(spec1);          continue;        }        if(0 == PL_strcmp(spec1, spec2)) {          if(!urlData->notified) {            currentURLList->RemoveElementAt(i);            if (nsnull != aURL) {              aURL->GetScheme(&uProtocol);              aURL->GetHost(&uHost);              aURL->GetPath(&uFile);              if ((0 != PL_strcmp("/", uFile)) && (0 != PL_strcmp("/index.html", uFile))) {                if (0 != PL_strcmp("file", uProtocol)) {                  nsAutoString protocolStr(uProtocol);                  nsAutoString hostStr(uHost);                  // Construct a chrome URL and use it to look up a resource.                  nsAutoString rootStr = protocolStr + "://" + hostStr + "/";                                  // XXX if we're no longer calling GetRootURL, these calls can go away                  // rv = NS_NewURI(&rootURL, rootStr);               //   rv = GetRootURL(rootURL);                }              }              nsCRT::free(uProtocol);              nsCRT::free(uHost);              nsCRT::free(uFile);            }          }        }        nsCRT::free(spec1);        nsCRT::free(spec2);      }    }  }   return NS_OK;}