PRInt32 count = mWindowList.Count(); nsresult rv; for ( int32 i = 0; i< count; i++ ) { nsWindowInfo* windowInfo = (nsWindowInfo*) mWindowList[i]; if (  windowInfo->mWindow.get() == inWindow ) { nsIRDFResource* window = windowInfo->mRDFID;  nsIRDFNode* target = NULL; if ( NS_SUCCEEDED(mInner->GetTarget( window, kNC_Name, PR_TRUE, &target) ) ) { mInner->Unassert( window, kNC_Name, target ); NS_IF_RELEASE( target ); }   nsCOMPtr<nsIRDFLiteral> newTitle; if ( gRDFService && NS_FAILED(rv = gRDFService->GetLiteral( inTitle, getter_AddRefs(newTitle) ) ) ) { NS_ERROR("unable to create literal for window name"); return rv; }
nsWindowInfo *info, *listEnd; nsresult     rv;
NS_IMETHODIMP  nsWindowMediator::UpdateWindowTitle( nsIWebShellWindow* inWindow, const PRUnichar* inTitle ){	PRInt32 count = mWindowList.Count();	nsresult rv;	for ( int32 i = 0; i< count; i++ )	{			nsWindowInfo* windowInfo = (nsWindowInfo*) mWindowList[i];		if (  windowInfo->mWindow.get() == inWindow ) 		{			nsIRDFResource* window = windowInfo->mRDFID;			// Get rid of the old value			nsIRDFNode* target = NULL;			if ( NS_SUCCEEDED(mInner->GetTarget( window, kNC_Name, PR_TRUE, &target) ) )			{				mInner->Unassert( window, kNC_Name, target );				NS_IF_RELEASE( target );			}                        // Add new title             			nsCOMPtr<nsIRDFLiteral> newTitle;			if ( gRDFService && NS_FAILED(rv = gRDFService->GetLiteral( inTitle, getter_AddRefs(newTitle) ) ) )			{				NS_ERROR("unable to create literal for window name");				return rv;			}			rv = Assert( window , kNC_Name, newTitle, PR_TRUE );  			if (rv != NS_RDF_ASSERTION_ACCEPTED)			{				NS_ERROR("unable to set window name");			}			return NS_OK;		}	} 	return NS_ERROR_FAILURE;}