Bug 1345751. P2 - use SystemGroup to dispatch the event. r?cpearce draft
authorJW Wang <jwwang@mozilla.com>
Thu, 09 Mar 2017 14:46:58 +0800
changeset 496370 8c58dabcc0ee2e68333092f01dfccf38c26f7a41
parent 496369 176c2021c9535b6f83ce3988285e494bbf01c97e
child 496371 48c9d126e7a29b693e1effbdff92279eae4a3f22
push id48577
push userjwwang@mozilla.com
push dateFri, 10 Mar 2017 02:53:02 +0000
reviewerscpearce
bugs1345751
milestone55.0a1
Bug 1345751. P2 - use SystemGroup to dispatch the event. r?cpearce MozReview-Commit-ID: B8HuIpbpm06
dom/media/FileBlockCache.cpp
--- 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)