Bug 1323100 - Use AutoProfilerRegister to register chromium threads with the profiler. r?froydnj draft
authorMarkus Stange <mstange@themasta.com>
Thu, 22 Dec 2016 00:48:55 +0100
changeset 456894 6c14817f368b93f59b340e949298aa9531e09c3d
parent 456893 fcc61ab1ce2362e92bc3efe3bdf8a69842f2d621
child 541351 b9e29f22e81e3fbc020999f4bae1262f24fb7472
push id40636
push userbmo:mstange@themasta.com
push dateFri, 06 Jan 2017 12:38:48 +0000
reviewersfroydnj
bugs1323100
milestone53.0a1
Bug 1323100 - Use AutoProfilerRegister to register chromium threads with the profiler. r?froydnj MozReview-Commit-ID: 12LS5hqCA2c
ipc/chromium/src/base/thread.cc
--- a/ipc/chromium/src/base/thread.cc
+++ b/ipc/chromium/src/base/thread.cc
@@ -148,18 +148,17 @@ void Thread::StopSoon() {
   // to someone calling Quit() on our message loop directly.
   DCHECK(message_loop_);
 
   RefPtr<ThreadQuitTask> task = new ThreadQuitTask();
   message_loop_->PostTask(task.forget());
 }
 
 void Thread::ThreadMain() {
-  char aLocal;
-  profiler_register_thread(name_.c_str(), &aLocal);
+  mozilla::AutoProfilerRegister registerThread(name_.c_str());
   mozilla::IOInterposer::RegisterCurrentThread();
 
   // The message loop for this thread.
   MessageLoop message_loop(startup_data_->options.message_loop_type,
                            NS_GetCurrentThread());
 
   // Complete the initialization of our Thread object.
   thread_id_ = PlatformThread::CurrentId();
@@ -181,17 +180,16 @@ void Thread::ThreadMain() {
 
   // Let the thread do extra cleanup.
   CleanUp();
 
   // Assert that MessageLoop::Quit was called by ThreadQuitTask.
   DCHECK(GetThreadWasQuitProperly());
 
   mozilla::IOInterposer::UnregisterCurrentThread();
-  profiler_unregister_thread();
 
 #ifdef MOZ_TASK_TRACER
   mozilla::tasktracer::FreeTraceInfo();
 #endif
 
   // We can't receive messages anymore.
   message_loop_ = NULL;
   thread_id_ = 0;