Bug 1190496 - Use the normal XPCOM way to dispatch to the main thread. r=cpearce
authorBobby Holley <bobbyholley@gmail.com>
Mon, 03 Aug 2015 14:40:06 -0700
changeset 287866 7edc83e08f2361c7539eaba67298ed7be4c4e505
parent 287865 2a7cc98d59ef360d1ace0c31ef9fb50345f55da4
child 287867 d60938776f12438ba6f61e4e811d730568a1849f
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1190496
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1190496 - Use the normal XPCOM way to dispatch to the main thread. r=cpearce
dom/media/SharedThreadPool.cpp
--- a/dom/media/SharedThreadPool.cpp
+++ b/dom/media/SharedThreadPool.cpp
@@ -114,17 +114,17 @@ NS_IMETHODIMP_(MozExternalRefCountType) 
   // Remove SharedThreadPool from table of pools.
   sPools->Remove(mName);
   MOZ_ASSERT(!sPools->Get(mName));
 
   // Dispatch an event to the main thread to call Shutdown() on
   // the nsIThreadPool. The Runnable here  will add a refcount to the pool,
   // and when the Runnable releases the nsIThreadPool it will be deleted.
   nsCOMPtr<nsIRunnable> r = NS_NewRunnableMethod(mPool, &nsIThreadPool::Shutdown);
-  AbstractThread::MainThread()->Dispatch(r.forget());
+  NS_DispatchToMainThread(r);
 
   // Stabilize refcount, so that if something in the dtor QIs, it won't explode.
   mRefCnt = 1;
   delete this;
   return 0;
 }
 
 NS_IMPL_QUERY_INTERFACE(SharedThreadPool, nsIThreadPool, nsIEventTarget)