Bug 1300016 - only suspend web-speech when mUtterance exists. r=eeejay
authorAlastor Wu <alwu@mozilla.com>
Mon, 07 Nov 2016 17:49:13 +0800
changeset 364863 117b0fa754f7879063174e138cfdf05d1c8dfabb
parent 364862 1fdb1f8a9ddd74fde0ce54694fb096e5317adce7
child 364864 9cfc41a2869ee9a880aaae5d22a34e2daa7b64b6
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-beta@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseeejay
bugs1300016
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1300016 - only suspend web-speech when mUtterance exists. r=eeejay 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;