Bug 1299172 - Fix media element StreamSizeListener calling DispatchToMainThreadAfterStreamStateUpdate off-MSG-thread. r=jesup

MozReview-Commit-ID: Cc2tJbEog20

--HG--
extra : rebase_source : 83731e3fe29a7813a51f70eff8a0f43a21f92e1d
This commit is contained in:
Andreas Pehrson 2016-08-31 14:31:28 +02:00
Родитель b8ed2ee25c
Коммит 864bcdc3c4
1 изменённых файлов: 7 добавлений и 4 удалений

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

@ -310,10 +310,13 @@ public:
if (c->mFrame.GetIntrinsicSize() != gfx::IntSize(0,0)) {
mInitialSizeFound = true;
nsCOMPtr<nsIRunnable> event =
NewRunnableMethod<gfx::IntSize>(
this, &StreamSizeListener::ReceivedSize,
c->mFrame.GetIntrinsicSize());
aGraph->DispatchToMainThreadAfterStreamStateUpdate(event.forget());
NewRunnableMethod<gfx::IntSize>(this, &StreamSizeListener::ReceivedSize,
c->mFrame.GetIntrinsicSize());
// This is fine to dispatch straight to main thread (instead of via
// ...AfterStreamUpdate()) since it reflects state of the element,
// not the stream. Events reflecting stream or track state should be
// dispatched so their order is preserved.
NS_DispatchToMainThread(event.forget());
return;
}
}