зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1190496 - Remove dependency on VideoUtils.h for stack size. r=cpearce
This commit is contained in:
Родитель
71ab6cac45
Коммит
de2bb0bad9
|
@ -90,7 +90,7 @@ AudioSink::Init()
|
|||
nsresult rv = NS_NewNamedThread("Media Audio",
|
||||
getter_AddRefs(mThread),
|
||||
nullptr,
|
||||
MEDIA_THREAD_STACK_SIZE);
|
||||
SharedThreadPool::kStackSize);
|
||||
if (NS_FAILED(rv)) {
|
||||
mEndPromise.Reject(rv, __func__);
|
||||
return p;
|
||||
|
|
|
@ -23,7 +23,7 @@ nsresult FileBlockCache::Open(PRFileDesc* aFD)
|
|||
MonitorAutoLock mon(mDataMonitor);
|
||||
nsresult res = NS_NewThread(getter_AddRefs(mThread),
|
||||
nullptr,
|
||||
MEDIA_THREAD_STACK_SIZE);
|
||||
SharedThreadPool::kStackSize);
|
||||
mIsOpen = NS_SUCCEEDED(res);
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
#include "SharedThreadPool.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/Monitor.h"
|
||||
#include "mozilla/ReentrantMonitor.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "nsDataHashtable.h"
|
||||
#include "VideoUtils.h"
|
||||
#include "nsXPCOMCIDInternal.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#ifdef XP_WIN
|
||||
|
@ -147,7 +147,7 @@ SharedThreadPool::~SharedThreadPool()
|
|||
nsresult
|
||||
SharedThreadPool::EnsureThreadLimitIsAtLeast(uint32_t aLimit)
|
||||
{
|
||||
// We limit the number of threads that we use for media. Note that we
|
||||
// We limit the number of threads that we use. Note that we
|
||||
// set the thread limit to the same as the idle limit so that we're not
|
||||
// constantly creating and destroying threads (see Bug 881954). When the
|
||||
// thread pool threads shutdown they dispatch an event to the main thread
|
||||
|
@ -184,7 +184,7 @@ CreateThreadPool(const nsCString& aName)
|
|||
rv = pool->SetName(aName);
|
||||
NS_ENSURE_SUCCESS(rv, nullptr);
|
||||
|
||||
rv = pool->SetThreadStackSize(MEDIA_THREAD_STACK_SIZE);
|
||||
rv = pool->SetThreadStackSize(SharedThreadPool::kStackSize);
|
||||
NS_ENSURE_SUCCESS(rv, nullptr);
|
||||
|
||||
#ifdef XP_WIN
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <queue>
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsIThreadManager.h"
|
||||
#include "nsIThreadPool.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
|
@ -66,6 +67,17 @@ public:
|
|||
// *Must* be called on the main thread.
|
||||
static void SpinUntilEmpty();
|
||||
|
||||
#if defined(MOZ_ASAN)
|
||||
// Use the system default in ASAN builds, because the default is assumed to be
|
||||
// larger than the size we want to use and is hopefully sufficient for ASAN.
|
||||
static const uint32_t kStackSize = nsIThreadManager::DEFAULT_STACK_SIZE;
|
||||
#elif defined(XP_WIN) || defined(XP_MACOSX) || defined(LINUX)
|
||||
static const uint32_t kStackSize = (256 * 1024);
|
||||
#else
|
||||
// All other platforms use their system defaults.
|
||||
static const uint32_t kStackSize = nsIThreadManager::DEFAULT_STACK_SIZE;
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
// Returns whether there are no pools in existence at the moment.
|
||||
|
|
|
@ -17,11 +17,6 @@
|
|||
#include "nsSize.h"
|
||||
#include "nsRect.h"
|
||||
|
||||
#if !(defined(XP_WIN) || defined(XP_MACOSX) || defined(LINUX)) || \
|
||||
defined(MOZ_ASAN)
|
||||
// For MEDIA_THREAD_STACK_SIZE
|
||||
#include "nsIThreadManager.h"
|
||||
#endif
|
||||
#include "nsThreadUtils.h"
|
||||
#include "prtime.h"
|
||||
#include "AudioSampleFormat.h"
|
||||
|
@ -165,18 +160,6 @@ static const int32_t MAX_VIDEO_HEIGHT = 3000;
|
|||
// before being used!
|
||||
void ScaleDisplayByAspectRatio(nsIntSize& aDisplay, float aAspectRatio);
|
||||
|
||||
// The amount of virtual memory reserved for thread stacks.
|
||||
#if defined(MOZ_ASAN)
|
||||
// Use the system default in ASAN builds, because the default is assumed to be
|
||||
// larger than the size we want to use and is hopefully sufficient for ASAN.
|
||||
#define MEDIA_THREAD_STACK_SIZE nsIThreadManager::DEFAULT_STACK_SIZE
|
||||
#elif defined(XP_WIN) || defined(XP_MACOSX) || defined(LINUX)
|
||||
#define MEDIA_THREAD_STACK_SIZE (256 * 1024)
|
||||
#else
|
||||
// All other platforms use their system defaults.
|
||||
#define MEDIA_THREAD_STACK_SIZE nsIThreadManager::DEFAULT_STACK_SIZE
|
||||
#endif
|
||||
|
||||
// Downmix multichannel Audio samples to Stereo.
|
||||
// Input are the buffer contains multichannel data,
|
||||
// the number of channels and the number of frames.
|
||||
|
|
Загрузка…
Ссылка в новой задаче