Commit 364e524e authored by Cervantes Yu's avatar Cervantes Yu
Browse files

Bug 1024669 - Part 1: Annotate crash reports with thread names. r=gsvelto

MozReview-Commit-ID: 4RpAWzTuvPs
parent 7a6b22b9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#include "HRTFDatabaseLoader.h"
#include "HRTFDatabase.h"
#include "GeckoProfiler.h"
#include "nsThreadUtils.h"

using namespace mozilla;

@@ -153,7 +154,7 @@ void HRTFDatabaseLoader::MainThreadRelease()
static void databaseLoaderEntry(void* threadData)
{
    AutoProfilerRegister registerThread("HRTFDatabaseLdr");
    PR_SetCurrentThreadName("HRTFDatabaseLdr");
    NS_SetCurrentThreadName("HRTFDatabaseLdr");

    HRTFDatabaseLoader* loader = reinterpret_cast<HRTFDatabaseLoader*>(threadData);
    MOZ_ASSERT(loader);
+1 −1
Original line number Diff line number Diff line
@@ -341,7 +341,7 @@ void
StorageDBThread::ThreadFunc(void* aArg)
{
  AutoProfilerRegister registerThread("localStorage DB");
  PR_SetCurrentThreadName("localStorage DB");
  NS_SetCurrentThreadName("localStorage DB");
  mozilla::IOInterposer::RegisterCurrentThread();

  StorageDBThread* thread = static_cast<StorageDBThread*>(aArg);
+1 −1
Original line number Diff line number Diff line
@@ -2792,7 +2792,7 @@ WorkerThreadPrimaryRunnable::Run()

  char stackBaseGuess;

  PR_SetCurrentThreadName("DOM Worker");
  NS_SetCurrentThreadName("DOM Worker");

  nsAutoCString threadName;
  threadName.AssignLiteral("DOM Worker '");
+2 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include "mozJSComponentLoader.h"
#include "nsAutoPtr.h"
#include "nsNetUtil.h"
#include "nsThreadUtils.h"

#include "nsIMemoryInfoDumper.h"
#include "nsIMemoryReporter.h"
@@ -1230,7 +1231,7 @@ static void
WatchdogMain(void* arg)
{
    mozilla::AutoProfilerRegister registerThread("JS Watchdog");
    PR_SetCurrentThreadName("JS Watchdog");
    NS_SetCurrentThreadName("JS Watchdog");

    Watchdog* self = static_cast<Watchdog*>(arg);
    WatchdogManager* manager = self->Manager();
+2 −1
Original line number Diff line number Diff line
@@ -442,7 +442,8 @@ void CacheIOThread::ThreadFunc(void* aClosure)
{
  // XXXmstange We'd like to register this thread with the profiler, but doing
  // so causes leaks, see bug 1323100.
  PR_SetCurrentThreadName("Cache2 I/O");
  NS_SetCurrentThreadName("Cache2 I/O");

  mozilla::IOInterposer::RegisterCurrentThread();
  CacheIOThread* thread = static_cast<CacheIOThread*>(aClosure);
  thread->ThreadFunc();
Loading