Bug 1365203 - Annotate name of base::Thread in the crash report. r=gsvelto

This adds the call NS_SetCurrentThreadName() to the thread created using
base::Thread (e.g. the Compositor thread) so that the name gets annotated in the
crash report and displayed on socorro.

MozReview-Commit-ID: 9bNeHlhbicA

--HG--
extra : amend_source : a7c0c09e7fa057df4c0e212e1579961c3f9617b1
extra : histedit_source : 8919f69bc68861858105efed12cc0a37404b38b0
This commit is contained in:
Cervantes Yu 2017-05-17 14:25:09 +08:00
parent d82e0194e8
commit 26a4bb3385

View File

@ -163,6 +163,7 @@ void Thread::ThreadMain() {
// Complete the initialization of our Thread object.
thread_id_ = PlatformThread::CurrentId();
PlatformThread::SetName(name_.c_str());
NS_SetCurrentThreadName(name_.c_str());
message_loop.set_thread_name(name_);
message_loop.set_hang_timeouts(startup_data_->options.transient_hang_timeout,
startup_data_->options.permanent_hang_timeout);