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;
nsAutoLock lock(mListLock); for (info = mOldestWindow, listEnd = 0; info != listEnd; info = info->mYounger, listEnd = mOldestWindow) {  if (info->mWindow.get() != inWindow) continue;  nsIRDFResource* window = info->mRDFID;  nsIRDFNode* target = NULL; if ( NS_SUCCEEDED(mInner->GetTarget( window, kNC_Name, PR_TRUE, &target) ) && (target != nsnull) ) { 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; }   PRBool display = PR_TRUE; nsAutoString displayString; GetAttribute( inWindow, NS_LITERAL_STRING("intaskslist"), displayString ); ToLowerCase(displayString);  if ( displayString.Equals(NS_LITERAL_STRING("false")) ) display=PR_FALSE;  rv = Assert( window , kNC_Name, newTitle, display ); if (rv != NS_RDF_ASSERTION_ACCEPTED) { NS_ERROR("unable to set window name"); } return NS_OK; } return NS_ERROR_FAILURE;
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;}