зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1450266 P7 Make XMLHttpRequestMainThread check for a valid inner window before dispatching events. r=baku r=smaug
This commit is contained in:
Родитель
a32ccf78b7
Коммит
9bd4654613
|
@ -1325,6 +1325,10 @@ XMLHttpRequestMainThread::DispatchOrStoreEvent(DOMEventTargetHelper* aTarget,
|
|||
MOZ_ASSERT(aTarget);
|
||||
MOZ_ASSERT(aEvent);
|
||||
|
||||
if (NS_FAILED(CheckInnerWindowCorrectness())) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mEventDispatchingSuspended) {
|
||||
PendingEvent* event = mPendingEvents.AppendElement();
|
||||
event->mTarget = aTarget;
|
||||
|
@ -1352,6 +1356,10 @@ XMLHttpRequestMainThread::ResumeEventDispatching()
|
|||
nsTArray<PendingEvent> pendingEvents;
|
||||
pendingEvents.SwapElements(mPendingEvents);
|
||||
|
||||
if (NS_FAILED(CheckInnerWindowCorrectness())) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < pendingEvents.Length(); ++i) {
|
||||
bool dummy;
|
||||
pendingEvents[i].mTarget->DispatchEvent(pendingEvents[i].mEvent, &dummy);
|
||||
|
|
Загрузка…
Ссылка в новой задаче