Bug 1323100 - Use AutoProfilerRegister to register chromium threads with the profiler. r?froydnj
MozReview-Commit-ID: 12LS5hqCA2c
--- 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;