Bug 1323100 - Use NS_NewNamedThread for the Android Audio thread. r?froydnj draft
authorMarkus Stange <mstange@themasta.com>
Wed, 21 Dec 2016 11:31:15 +0100
changeset 454492 b4be0f189bb8e373e1e1271cabd8a6e031f62e0e
parent 454491 419b0680336f70f8910f9b12208324a1aada96c4
child 454493 7c4b365ac5a62da35985c9dd70bb88ad9d20a5f5
push id39953
push userbmo:mstange@themasta.com
push dateThu, 29 Dec 2016 16:14:16 +0000
reviewersfroydnj
bugs1323100
milestone53.0a1
Bug 1323100 - Use NS_NewNamedThread for the Android Audio thread. r?froydnj MozReview-Commit-ID: IcKsOZCZVwB
dom/plugins/base/android/ANPAudio.cpp
--- a/dom/plugins/base/android/ANPAudio.cpp
+++ b/dom/plugins/base/android/ANPAudio.cpp
@@ -117,18 +117,16 @@ public:
   }
 
   ANPAudioTrack* mTrack;
 };
 
 NS_IMETHODIMP
 AudioRunnable::Run()
 {
-  PR_SetCurrentThreadName("Android Audio");
-
   JNIEnv* const jenv = mozilla::jni::GetEnvForThread();
 
   mozilla::AutoLocalJNIFrame autoFrame(jenv, 2);
 
   jbyteArray bytearray = jenv->NewByteArray(mTrack->bufferSize);
   if (!bytearray) {
     LOG("AudioRunnable:: Run.  Could not create bytearray");
     return NS_ERROR_FAILURE;
@@ -316,17 +314,17 @@ anp_audio_start(ANPAudioTrack* s)
 
   s->isStopped = false;
   s->keepGoing = true;
 
   // AudioRunnable now owns the ANPAudioTrack
   RefPtr<AudioRunnable> runnable = new AudioRunnable(s);
 
   nsCOMPtr<nsIThread> thread;
-  NS_NewThread(getter_AddRefs(thread), runnable);
+  NS_NewNamedThread("Android Audio", getter_AddRefs(thread), runnable);
 }
 
 void
 anp_audio_pause(ANPAudioTrack* s)
 {
   if (s == nullptr || s->output_unit == nullptr) {
     return;
   }