Bug 1300016 - only suspend web-speech when mUtterance exists. r=eeejay, a=gchang
authorAlastor Wu <alwu@mozilla.com>
Mon, 07 Nov 2016 17:49:13 +0800
changeset 356571 263190e20543fc7f39c6d41c8fd31cedccdbffd8
parent 356570 6c8d0b43d402c9b60deda50340518184032b8aba
child 356572 2ab68e90f1effbd8517bb785509aa2d0567db9ab
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseeejay, gchang
bugs1300016
milestone51.0a2
Bug 1300016 - only suspend web-speech when mUtterance exists. r=eeejay, a=gchang MozReview-Commit-ID: E29qJ1sgZ5c
dom/media/webspeech/synth/nsSpeechTask.cpp
--- a/dom/media/webspeech/synth/nsSpeechTask.cpp
+++ b/dom/media/webspeech/synth/nsSpeechTask.cpp
@@ -742,16 +742,20 @@ nsSpeechTask::WindowVolumeChanged(float 
 {
   SetAudioOutputVolume(aMuted ? 0.0 : mVolume * aVolume);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSpeechTask::WindowSuspendChanged(nsSuspendedTypes aSuspend)
 {
+  if (!mUtterance) {
+    return NS_OK;
+  }
+
   if (aSuspend == nsISuspendedTypes::NONE_SUSPENDED &&
       mUtterance->mPaused) {
     Resume();
   } else if (aSuspend != nsISuspendedTypes::NONE_SUSPENDED &&
              !mUtterance->mPaused) {
     Pause();
   }
   return NS_OK;