for ( int32 i = 0; i< count; i++ ) { nsWindowInfo* windowInfo = (nsWindowInfo*) mWindowList[i]; PRBool result = PR_FALSE; if (  windowInfo->mRDFID->EqualsResource( inResource, &result)  && result == PR_TRUE )
nsAutoString temp( inResource ); char* resourceString = ToNewCString(temp); nsWindowInfo *info, *listEnd;  nsAutoLock lock(mListLock); info = mOldestWindow; listEnd = 0; while (info != listEnd) { PRBool isMatch = PR_FALSE;  if ( NS_SUCCEEDED( info->mRDFID->EqualsString( resourceString, &isMatch) ) && isMatch )
NS_IMETHODIMP  nsWindowMediator::GetWindowForResource( nsIRDFResource* inResource, nsIDOMWindow** outWindow ){	if ( outWindow == NULL )		return NS_ERROR_INVALID_ARG;		*outWindow = NULL;	PRInt32 count = mWindowList.Count();	// Find the window	for ( int32 i = 0; i< count; i++ )	{			nsWindowInfo* windowInfo = (nsWindowInfo*) mWindowList[i];		PRBool result = PR_FALSE;		if (  windowInfo->mRDFID->EqualsResource( inResource, &result)  && result == PR_TRUE ) 		{			nsCOMPtr <nsIDOMWindow> DOMWindow;			if( NS_SUCCEEDED ( GetDOMWindow( windowInfo->mWindow, DOMWindow  ) ) )			{					*outWindow = DOMWindow;				return NS_OK;			}			else				return NS_ERROR_FAILURE;		}	} 	return NS_ERROR_FAILURE;}