Bug 894234 - Guard against audioContext->IsOffline(). r=ehsan

This commit is contained in:
Drew Willcoxon 2013-07-17 09:59:08 -04:00
Родитель 09e5e38a50
Коммит 07cdd2c80d
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -3284,7 +3284,7 @@ nsPIDOMWindow::AddAudioContext(AudioContext* aAudioContext)
mAudioContexts.AppendElement(aAudioContext); mAudioContexts.AppendElement(aAudioContext);
nsIDocShell* docShell = GetDocShell(); nsIDocShell* docShell = GetDocShell();
if (docShell && !docShell->GetAllowMedia()) { if (docShell && !docShell->GetAllowMedia() && !aAudioContext->IsOffline()) {
aAudioContext->Mute(); aAudioContext->Mute();
} }
} }
@ -3293,7 +3293,9 @@ void
nsPIDOMWindow::MuteAudioContexts() nsPIDOMWindow::MuteAudioContexts()
{ {
for (uint32_t i = 0; i < mAudioContexts.Length(); ++i) { for (uint32_t i = 0; i < mAudioContexts.Length(); ++i) {
mAudioContexts[i]->Mute(); if (!mAudioContexts[i]->IsOffline()) {
mAudioContexts[i]->Mute();
}
} }
} }
@ -3301,7 +3303,9 @@ void
nsPIDOMWindow::UnmuteAudioContexts() nsPIDOMWindow::UnmuteAudioContexts()
{ {
for (uint32_t i = 0; i < mAudioContexts.Length(); ++i) { for (uint32_t i = 0; i < mAudioContexts.Length(); ++i) {
mAudioContexts[i]->Unmute(); if (!mAudioContexts[i]->IsOffline()) {
mAudioContexts[i]->Unmute();
}
} }
} }