OK, mjudge and I have both looked, and we think no callers remain that |QueryInterface| to get an enumerator. Everyone has been fixed to call |GetEnumerator| ... but just in case, we added an assert to find any stragglers. If this assert fires, mjudge or I need to know. bug=16543; r=mjudge

This commit is contained in:
scc%netscape.com 2000-01-19 01:42:54 +00:00
Родитель cde2e07dc6
Коммит bde5f1a9a0
1 изменённых файлов: 9 добавлений и 15 удалений

Просмотреть файл

@ -1930,22 +1930,16 @@ nsDOMSelection::QueryInterface(REFNSIID aIID, void** aInstancePtr)
NS_ADDREF_THIS();
return NS_OK;
}
if (aIID.Equals(nsIEnumerator::GetIID())) {
nsRangeListIterator *iter = new nsRangeListIterator(this);
if (!iter)
return NS_ERROR_OUT_OF_MEMORY;
*aInstancePtr = NS_STATIC_CAST(nsIEnumerator*, iter);
NS_ADDREF(iter);
return NS_OK;
}
if (aIID.Equals(nsIBidirectionalEnumerator::GetIID())) {
nsRangeListIterator *iter = new nsRangeListIterator(this);
if (!iter)
return NS_ERROR_OUT_OF_MEMORY;
*aInstancePtr = NS_STATIC_CAST(nsIBidirectionalEnumerator*, iter);
NS_ADDREF(iter);
return NS_OK;
/* The following clause needs to go away, as soon as we've caught any offending callers */
if (aIID.Equals(nsIEnumerator::GetIID())
|| aIID.Equals(nsIBidirectionalEnumerator::GetIID())) {
NS_ASSERTION(0, "(tell scc or mjudge) -- Error: Get new enumerators with |GetEnumerator|, not |QueryInterface|! Caller must be fixed");
return NS_NOINTERFACE;
}
if (aIID.Equals(nsIScriptObjectOwner::GetIID())) {
nsIScriptObjectOwner* tmp = this;
*aInstancePtr = (void*) tmp;