Bug 1263647 - When receiving a TabPreZombify event, send out a Tab:AudioPlayingChange message only if the tab is actually playing some audio. r=margaret
authorJan Henning <jh+bugzilla@buttercookie.de>
Thu, 14 Apr 2016 16:18:00 -0700
changeset 331299 8cbd3940c47f0babdf44937b799e160278b4a1fc
parent 331298 e687d8e0871dc79a26ed6e0b59f12e4e3cb64551
child 331300 e595db332894e0d6a2bacd793f792d56ce3960d1
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1263647
milestone48.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 1263647 - When receiving a TabPreZombify event, send out a Tab:AudioPlayingChange message only if the tab is actually playing some audio. r=margaret MozReview-Commit-ID: 7eAc2mNgM42
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -4081,19 +4081,25 @@ Tab.prototype = {
         Messaging.sendRequest({
           type: "DOMTitleChanged",
           tabID: this.id,
           title: truncate(aEvent.target.title, MAX_TITLE_LENGTH)
         });
         break;
       }
 
+      case "TabPreZombify": {
+        if (!this.playingAudio) {
+          return;
+        }
+        // Fall through to the DOMAudioPlayback events, so the
+        // audio playback indicator gets reset upon zombification.
+      }
       case "DOMAudioPlaybackStarted":
-      case "DOMAudioPlaybackStopped":
-      case "TabPreZombify": {
+      case "DOMAudioPlaybackStopped": {
         if (!Services.prefs.getBoolPref("browser.tabs.showAudioPlayingIcon") ||
             !aEvent.isTrusted) {
           return;
         }
 
         let browser = aEvent.originalTarget;
         if (browser != this.browser) {
           return;