mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 930097 - Fix an exact rooting false positive in worker event dispatch; r=bent
--HG-- extra : rebase_source : 8fcffa0b3aa4e381b8fdce6abfd9f05e88829768
This commit is contained in:
parent
5a05edfe2d
commit
115bbf99fa
@ -338,29 +338,14 @@ EventListenerManager::DispatchEvent(JSContext* aCx, const EventTarget& aTarget,
|
||||
return false;
|
||||
}
|
||||
|
||||
ContextAllocPolicy ap(aCx);
|
||||
|
||||
// XXXbent There is no reason to use nsAutoJSValHolder here as we should be
|
||||
// able to use js::AutoValueVector. Worse, nsAutoJSValHolder is much
|
||||
// slower. However, js::AutoValueVector causes crashes on Android at
|
||||
// the moment so we don't have much choice.
|
||||
js::Vector<nsAutoJSValHolder, 10, ContextAllocPolicy> listeners(ap);
|
||||
|
||||
JS::AutoValueVector listeners(aCx);
|
||||
for (ListenerData* listenerData = collection->mListeners.getFirst();
|
||||
listenerData;
|
||||
listenerData = listenerData->getNext()) {
|
||||
// Listeners that don't want untrusted events will be skipped if this is an
|
||||
// untrusted event.
|
||||
if (eventIsTrusted || listenerData->mWantsUntrusted) {
|
||||
nsAutoJSValHolder holder;
|
||||
if (!holder.Hold(aCx)) {
|
||||
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
return false;
|
||||
}
|
||||
|
||||
holder = listenerData->mListener;
|
||||
|
||||
if (!listeners.append(holder)) {
|
||||
if (!listeners.append(OBJECT_TO_JSVAL(listenerData->mListener))) {
|
||||
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user