Bug 1320256 - use PR_GetThreadName as the register name in profiler. r=cyu

MozReview-Commit-ID: Hybb1zElpSO

--HG--
extra : rebase_source : 7bd2485eba40e9c80810e8e844ecfc8f91600ced
This commit is contained in:
Shih-Chiang Chien 2016-11-29 19:00:04 +08:00
Родитель df8b7ba284
Коммит ad4d822074
1 изменённых файлов: 2 добавлений и 11 удалений

Просмотреть файл

@ -12,7 +12,6 @@
#include "nsCOMPtr.h"
#include "nsIObserverService.h"
#include "nsIThreadPool.h"
#include "nsPrintfCString.h"
#include "nsThreadManager.h"
#include "nsThreadUtils.h"
#include "nsXPCOMCIDInternal.h"
@ -162,7 +161,6 @@ class DecodePoolWorker : public Runnable
public:
explicit DecodePoolWorker(DecodePoolImpl* aImpl)
: mImpl(aImpl)
, mSerialNumber(++sNextSerialNumber)
{ }
NS_IMETHOD Run() override
@ -179,10 +177,8 @@ public:
nsThreadManager::get().GetCurrentThread(getter_AddRefs(thisThread));
#ifdef MOZ_ENABLE_PROFILER_SPS
{
const nsPrintfCString threadName("ImgDecoder#%lu", mSerialNumber);
profiler_register_thread(threadName.get(), &stackBaseGuess);
}
// InitCurrentThread() has assigned the thread name.
profiler_register_thread(PR_GetThreadName(PR_GetCurrentThread()), &stackBaseGuess);
#endif // MOZ_ENABLE_PROFILER_SPS
do {
@ -211,14 +207,9 @@ public:
}
private:
static uint32_t sNextSerialNumber;
RefPtr<DecodePoolImpl> mImpl;
uint32_t mSerialNumber;
};
uint32_t DecodePoolWorker::sNextSerialNumber = 0;
/* static */ void
DecodePool::Initialize()
{