Bug 1345751. P2 - use SystemGroup to dispatch the event. r?cpearce
MozReview-Commit-ID: B8HuIpbpm06
--- a/dom/media/FileBlockCache.cpp
+++ b/dom/media/FileBlockCache.cpp
@@ -69,20 +69,18 @@ void FileBlockCache::Close()
if (mThread) {
// We must shut down the thread in another runnable. This is called
// while we're shutting down the media cache, and nsIThread::Shutdown()
// can cause events to run before it completes, which could end up
// opening more streams, while the media cache is shutting down and
// releasing memory etc! Also note we close mFD in the destructor so
// as to not disturb any IO that's currently running.
- nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
- MOZ_ASSERT(mainThread);
nsCOMPtr<nsIRunnable> event = new ShutdownThreadEvent(mThread);
- mainThread->Dispatch(event.forget(), NS_DISPATCH_NORMAL);
+ SystemGroup::Dispatch("ShutdownThreadEvent", TaskCategory::Other, event.forget());
}
}
template<typename Container, typename Value>
bool
ContainerContains(const Container& aContainer, const Value& value)
{
return std::find(aContainer.begin(), aContainer.end(), value)