Bug 1489160 - Check mCloseCalled instead of mAudioContextState when checking for a closed AudioContext. r=karlt

Differential Revision: https://phabricator.services.mozilla.com/D98316
This commit is contained in:
Andreas Pehrson 2020-12-07 20:48:50 +00:00
Родитель 321d0d9ea2
Коммит 6a217d23a6
1 изменённых файлов: 3 добавлений и 3 удалений

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

@ -931,7 +931,7 @@ already_AddRefed<Promise> AudioContext::Suspend(ErrorResult& aRv) {
return promise.forget();
}
if (mAudioContextState == AudioContextState::Closed || mCloseCalled) {
if (mCloseCalled) {
promise->MaybeRejectWithInvalidStateError(
"Can't suspend if the control thread state is \"closed\"");
return promise.forget();
@ -1002,7 +1002,7 @@ already_AddRefed<Promise> AudioContext::Resume(ErrorResult& aRv) {
return promise.forget();
}
if (mAudioContextState == AudioContextState::Closed || mCloseCalled) {
if (mCloseCalled) {
promise->MaybeRejectWithInvalidStateError(
"Can't resume if the control thread state is \"closed\"");
return promise.forget();
@ -1139,7 +1139,7 @@ already_AddRefed<Promise> AudioContext::Close(ErrorResult& aRv) {
return promise.forget();
}
if (mAudioContextState == AudioContextState::Closed) {
if (mCloseCalled) {
promise->MaybeRejectWithInvalidStateError(
"Can't close an AudioContext twice");
return promise.forget();