NS_ENSURE_STATE(mSessionHistory); NS_ENSURE_TRUE(!IsFrame(), NS_ERROR_FAILURE);
nsresult rv = NS_ERROR_ILLEGAL_VALUE;
nsWebShell::GetURL(PRInt32 aIndex, const PRUnichar** aURLResult){   NS_ENSURE_STATE(mSessionHistory);   NS_ENSURE_TRUE(!IsFrame(), NS_ERROR_FAILURE);   nsCOMPtr<nsIHistoryEntry> entry;   NS_ENSURE_SUCCESS(mSessionHistory->GetEntryAtIndex(aIndex, PR_TRUE,       getter_AddRefs(entry)), NS_ERROR_FAILURE);   NS_ENSURE_TRUE(entry, NS_ERROR_FAILURE);   nsCOMPtr<nsIURI> uri;   entry->GetURI(getter_AddRefs(uri));   NS_ENSURE_TRUE(uri, NS_ERROR_FAILURE);   nsXPIDLCString spec;   uri->GetSpec(getter_Copies(spec));   *aURLResult = NS_ConvertASCIItoUCS2(spec).ToNewUnicode();   return NS_OK;}