☠☠ backed out by 524e7bc67431 ☠ ☠ | |
author | Marco Chen <mchen@mozilla.com> |
Mon, 18 Feb 2013 14:30:32 +0800 | |
changeset 122215 | b093ba2c7ff9d5ec10ae4e70686f28eef08c3bab |
parent 122214 | 5474b831ece7011e78cba505d992b11cdd5b2ff4 |
child 122216 | 91134dd6ac0ad65ef60524fc2caa6eeb4ef3e293 |
push id | 24322 |
push user | dbaron@mozilla.com |
push date | Mon, 18 Feb 2013 08:55:11 +0000 |
treeherder | mozilla-central@0acbd06d48a9 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | baku |
bugs | 836655 |
milestone | 21.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
|
--- a/dom/audiochannel/AudioChannelService.cpp +++ b/dom/audiochannel/AudioChannelService.cpp @@ -130,16 +130,24 @@ 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].IndexOf(aChildID) == -1)) { + mActiveContentChildIDs.RemoveElement(aChildID); + } SendAudioChannelChangedNotification(); Notify(); } } bool AudioChannelService::GetMuted(AudioChannelAgent* aAgent, bool aElementHidden) { @@ -286,18 +294,22 @@ 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; } - // Content channels play in background if just one is active. - else if (!mActiveContentChildIDs.IsEmpty()) { + // 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].IndexOf( + mActiveContentChildIDs[0]) != -1) { higher = AUDIO_CHANNEL_CONTENT; } } if (higher != mCurrentHigherChannel) { mCurrentHigherChannel = higher; nsString channelName;