Backed out changesets b093ba2c7ff9 and 0acbd06d48a9 (Bug 836655) for failing unit test.
authorL. David Baron <dbaron@dbaron.org>
Mon, 18 Feb 2013 01:15:24 -0800
changeset 122218 524e7bc6743104e4bbc6f1a0eb520e23b1fe4abd
parent 122217 0acbd06d48a9aeea17696f5280231e4ee5fd029b
child 122219 645cb4fbf390452b445ebc3778b8a81257cd32f8
child 122222 673dd484f5b5eaecbcb45e8da3d0a07ac82017b1
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs836655
milestone21.0a1
backs outb093ba2c7ff9d5ec10ae4e70686f28eef08c3bab
0acbd06d48a9aeea17696f5280231e4ee5fd029b
Backed out changesets b093ba2c7ff9 and 0acbd06d48a9 (Bug 836655) for failing unit test.
dom/audiochannel/AudioChannelService.cpp
--- a/dom/audiochannel/AudioChannelService.cpp
+++ b/dom/audiochannel/AudioChannelService.cpp
@@ -130,24 +130,16 @@ AudioChannelService::UnregisterType(Audi
   // The array may contain multiple occurrence of this appId but
   // this should remove only the first one.
   AudioChannelInternalType type = GetInternalType(aType, aElementHidden);
   mChannelCounters[type].RemoveElement(aChildID);
 
   // In order to avoid race conditions, it's safer to notify any existing
   // agent any time a new one is registered.
   if (XRE_GetProcessType() == GeckoProcessType_Default) {
-    // We only remove ChildID when it is in the foreground.
-    // If in the background, we kept ChildID for allowing it to play next song.
-    if (aType == AUDIO_CHANNEL_CONTENT &&
-        mActiveContentChildIDs.Contains(aChildID) &&
-        (!mActiveContentChildIDsFrozen &&
-          !mChannelCounters[AUDIO_CHANNEL_INT_CONTENT].Contains(aChildID))) {
-      mActiveContentChildIDs.RemoveElement(aChildID);
-    }
     SendAudioChannelChangedNotification();
     Notify();
   }
 }
 
 bool
 AudioChannelService::GetMuted(AudioChannelAgent* aAgent, bool aElementHidden)
 {
@@ -294,22 +286,18 @@ AudioChannelService::SendAudioChannelCha
     else if (!mChannelCounters[AUDIO_CHANNEL_INT_ALARM_HIDDEN].IsEmpty()) {
       higher = AUDIO_CHANNEL_ALARM;
     }
 
     else if (!mChannelCounters[AUDIO_CHANNEL_INT_NOTIFICATION_HIDDEN].IsEmpty()) {
       higher = AUDIO_CHANNEL_NOTIFICATION;
     }
 
-    // There is only one Child can play content channel in the background.
-    // And need to check whether there is any content channels under playing
-    // now.
-    else if (!mActiveContentChildIDs.IsEmpty() &&
-             mChannelCounters[AUDIO_CHANNEL_INT_CONTENT_HIDDEN].Contains(
-             mActiveContentChildIDs[0])) {
+    // Content channels play in background if just one is active.
+    else if (!mActiveContentChildIDs.IsEmpty()) {
       higher = AUDIO_CHANNEL_CONTENT;
     }
   }
 
   if (higher != mCurrentHigherChannel) {
     mCurrentHigherChannel = higher;
 
     nsString channelName;