relanding switch to nsAutoTObserverArray per bug 407442.

This commit is contained in:
dwitte@stanford.edu 2007-12-20 02:37:52 -08:00
Родитель 5fefbd0626
Коммит 8e8fcb0405
2 изменённых файлов: 8 добавлений и 8 удалений

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

@ -1157,7 +1157,7 @@ nsEventListenerManager::HandleEvent(nsPresContext* aPresContext,
found:
nsTObserverArray<nsListenerStruct*>::EndLimitedIterator iter(mListeners);
nsAutoTObserverArray<nsListenerStruct*, 2>::EndLimitedIterator iter(mListeners);
nsAutoPopupStatePusher popupStatePusher(nsDOMEvent::GetEventPopupControlState(aEvent));
PRBool hasListener = PR_FALSE;
while (iter.HasMore()) {

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

@ -188,17 +188,17 @@ protected:
nsresult GetDOM2EventGroup(nsIDOMEventGroup** aGroup);
PRBool ListenerCanHandle(nsListenerStruct* aLs, nsEvent* aEvent);
nsTObserverArray<nsListenerStruct*> mListeners;
nsISupports* mTarget; //WEAK
PRUint32 mMayHaveMutationListeners : 1;
nsAutoTObserverArray<nsListenerStruct*, 2> mListeners;
nsISupports* mTarget; //WEAK
PRUint32 mMayHaveMutationListeners : 1;
// These two member variables are used to cache the information
// about the last event which was handled but for which event listener manager
// didn't have event listeners.
PRUint32 mNoListenerForEvent : 31;
nsCOMPtr<nsIAtom> mNoListenerForEventAtom;
PRUint32 mNoListenerForEvent : 31;
nsCOMPtr<nsIAtom> mNoListenerForEventAtom;
static PRUint32 mInstanceCount;
static jsval sAddListenerID;
static PRUint32 mInstanceCount;
static jsval sAddListenerID;
};
#endif // nsEventListenerManager_h__