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 250678 24c053ff08e95b66310d11ecf0e7bd7955d84694
parent 250677 bf236e6efd4970ae783b17cfbcd161c778d6707a
child 250679 3524973b9630077c314cd6722af7199e5dd48e02
push idunknown
push userunknown
push dateunknown
reviewersjww
bugs1177282
milestone42.0a1
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);