Bug 1324311 - window-less agent can't own audio focus.
MozReview-Commit-ID: HBieQMoIGOv
--- a/dom/audiochannel/AudioChannelService.cpp
+++ b/dom/audiochannel/AudioChannelService.cpp
@@ -1049,16 +1049,21 @@ AudioChannelService::RefreshAgentsAudioF
}
}
void
AudioChannelService::AudioChannelWindow::RequestAudioFocus(AudioChannelAgent* aAgent)
{
MOZ_ASSERT(aAgent);
+ // Don't need to check audio focus for window-less agent.
+ if (!aAgent->Window()) {
+ return;
+ }
+
// We already have the audio focus. No operation is needed.
if (mOwningAudioFocus) {
return;
}
// Only foreground window can request audio focus, but it would still own the
// audio focus even it goes to background. Audio focus would be abandoned
// only when other foreground window starts audio competing.