if (!mGlobalHistory) return NS_OK;   nsCAutoString resolvedPath(aLinkURI); nsresult rv;   if (!mIOService) mIOService = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);  NormalizeURI(resolvedPath);  PRBool isVisited; NS_ENSURE_SUCCESS(mGlobalHistory->IsVisited(resolvedPath.get(), &isVisited), NS_ERROR_FAILURE); if (isVisited)
nsWebShell::GetLinkState(const nsACString& aLinkURI, nsLinkState& aState){  aState = eLinkState_Unvisited;  // no history, leave state unchanged  if (!mGlobalHistory)    return NS_OK;    // default to the given URI  nsCAutoString resolvedPath(aLinkURI);  nsresult rv;  // get the cached IO service  if (!mIOService)    mIOService = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);          NormalizeURI(resolvedPath);  PRBool isVisited;  NS_ENSURE_SUCCESS(mGlobalHistory->IsVisited(resolvedPath.get(), &isVisited),                    NS_ERROR_FAILURE);  if (isVisited)    aState = eLinkState_Visited;    return NS_OK;}