Bug 1177282 - Remove the restriction against getting a SharedThreadPool off-main-thread. r=jww
authorBobby Holley <bobbyholley@gmail.com>
Sat, 27 Jun 2015 08:57:31 -0700
changeset 250642 24c053ff08e95b66310d11ecf0e7bd7955d84694
parent 250641 bf236e6efd4970ae783b17cfbcd161c778d6707a
child 250643 3524973b9630077c314cd6722af7199e5dd48e02
push id61613
push userbobbyholley@gmail.com
push dateTue, 30 Jun 2015 09:13:13 +0000
treeherdermozilla-inbound@24c053ff08e9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjww
bugs1177282
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 1177282 - Remove the restriction against getting a SharedThreadPool off-main-thread. r=jww
dom/media/SharedThreadPool.cpp
--- a/dom/media/SharedThreadPool.cpp
+++ b/dom/media/SharedThreadPool.cpp
@@ -56,17 +56,16 @@ SharedThreadPool::SpinUntilEmpty()
     sMonitor->AssertNotCurrentThreadIn();
     NS_ProcessNextEvent(NS_GetCurrentThread(), true);
   }
 }
 
 TemporaryRef<SharedThreadPool>
 SharedThreadPool::Get(const nsCString& aName, uint32_t aThreadLimit)
 {
-  MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(sMonitor && sPools);
   ReentrantMonitorAutoEnter mon(*sMonitor);
   SharedThreadPool* pool = nullptr;
   nsresult rv;
   if (!sPools->Get(aName, &pool)) {
     nsCOMPtr<nsIThreadPool> threadPool(CreateThreadPool(aName));
     NS_ENSURE_TRUE(threadPool, nullptr);
     pool = new SharedThreadPool(aName, threadPool);
@@ -173,18 +172,16 @@ SharedThreadPool::EnsureThreadLimitIsAtL
   }
 
   return NS_OK;
 }
 
 static already_AddRefed<nsIThreadPool>
 CreateThreadPool(const nsCString& aName)
 {
-  MOZ_ASSERT(NS_IsMainThread());
-
   nsresult rv;
   nsCOMPtr<nsIThreadPool> pool = do_CreateInstance(NS_THREADPOOL_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, nullptr);
 
   rv = pool->SetName(aName);
   NS_ENSURE_SUCCESS(rv, nullptr);
 
   rv = pool->SetThreadStackSize(MEDIA_THREAD_STACK_SIZE);