NS_IMETHODIMP nsWindowMediator::RegisterWindow( nsIWebShellWindow* inWindow ) { if ( inWindow == NULL  ) return NS_ERROR_INVALID_ARG;  mTimeStamp++;   nsWindowInfo* windowInfo = new nsWindowInfo ( inWindow, mTimeStamp ); if ( windowInfo == NULL ) return NS_ERROR_OUT_OF_MEMORY;  if ( !mWindowList.AppendElement( windowInfo ) ) { delete windowInfo; return NS_ERROR_OUT_OF_MEMORY; }  nsresult returnValue; if ( NS_FAILED( returnValue = AddWindowToRDF( windowInfo )  )) { mWindowList.RemoveElementAt( mWindowList.Count() ); delete windowInfo; return returnValue; }  return NS_OK;
NS_IMETHODIMP nsWindowMediator::RegisterWindow(nsIXULWindow* inWindow) { if (inWindow == NULL) return NS_ERROR_INVALID_ARG;  mTimeStamp++;   nsWindowInfo* windowInfo = new nsWindowInfo (inWindow, mTimeStamp); if (windowInfo == NULL) return NS_ERROR_OUT_OF_MEMORY;  nsresult returnValue = AddWindowToRDF(windowInfo); if (NS_FAILED(returnValue)) { delete windowInfo; return returnValue; }  nsAutoLock lock(mListLock); if (mOldestWindow) windowInfo->InsertAfter(mOldestWindow->mOlder, 0); else mOldestWindow = windowInfo;  return NS_OK;
NS_IMETHODIMP nsWindowMediator::RegisterWindow( nsIWebShellWindow* inWindow ){		if ( inWindow == NULL  )		return NS_ERROR_INVALID_ARG;		mTimeStamp++;		// Create window info struct and add to list of windows	nsWindowInfo* windowInfo = new nsWindowInfo ( inWindow, mTimeStamp );	if ( windowInfo == NULL )		return NS_ERROR_OUT_OF_MEMORY;			if ( !mWindowList.AppendElement( windowInfo ) )	{	 	delete windowInfo;	 	return NS_ERROR_OUT_OF_MEMORY;	}	 	nsresult returnValue;	if ( NS_FAILED( returnValue = AddWindowToRDF( windowInfo )  ))	{	 	mWindowList.RemoveElementAt( mWindowList.Count() );	 	delete windowInfo;	 	return returnValue;	 }	 	 return NS_OK;}