PRInt32 count = mWindowList.Count(); for ( int32 i = 0; i< count; i++ ) { nsWindowInfo* windowInfo = (nsWindowInfo*) mWindowList[i]; if (  windowInfo->mWindow == inWindow ) { mTimeStamp++; windowInfo->mTimeStamp = mTimeStamp; return NS_OK; } }  return NS_ERROR_FAILURE;
nsWindowInfo *info, *listEnd;  nsAutoLock lock(mListLock); info = mOldestWindow; listEnd = 0; while (info != listEnd) { if (info->mWindow.get() == inWindow) {  info->mTimeStamp = ++mTimeStamp;   nsCOMPtr<nsIDOMWindowInternal> idomwindow; GetDOMWindow(info->mWindow, idomwindow); nsCOMPtr<nsIDOMWindow> domwindow(do_QueryInterface(idomwindow));   mWatcher->SetActiveWindow(domwindow);  return NS_OK; } info = info->mYounger; listEnd = mOldestWindow; } return NS_ERROR_FAILURE;
NS_IMETHODIMP nsWindowMediator::UpdateWindowTimeStamp( nsIWebShellWindow* inWindow ){	PRInt32 count = mWindowList.Count();	for ( int32 i = 0; i< count; i++ )	{			nsWindowInfo* windowInfo = (nsWindowInfo*) mWindowList[i];		if (  windowInfo->mWindow == inWindow ) 		{			mTimeStamp++;			windowInfo->mTimeStamp = mTimeStamp;			return NS_OK;		}	}		return NS_ERROR_FAILURE;   }