nsCOMPtr<nsIURI> uri; nsresult result = ioService->NewURI(nsDependentCString(passwordRealm), nsnull, nsnull, getter_AddRefs(uri)); if (NS_FAILED(result)) { return; } nsCAutoString tempHost; result = uri->GetHost(tempHost); if (NS_FAILED(result)) { return; }
SINGSIGN_RememberSignonData     (nsIPrompt* dialog, const char* passwordRealm, nsVoidArray * signonData,     nsIDOMWindowInternal* window){      nsCAutoString strippedRealm;  nsCOMPtr<nsIIOService> ioService = do_GetService(NS_IOSERVICE_CONTRACTID);  if (!ioService) return;  ioService->ExtractUrlPart(nsDependentCString(passwordRealm), nsIIOService::url_Host, strippedRealm);  if (!strippedRealm.IsEmpty()) {    si_RememberSignonData(dialog, strippedRealm.get(), signonData, window);  }}