Bug 1286810: [MSE] P1. Error on abort() during Range Removals. r=gerald

As per https://github.com/w3c/media-source/issues/26

MozReview-Commit-ID: 1rNKVTBDjFY
This commit is contained in:
Jean-Yves Avenard 2016-07-14 21:37:04 +10:00
Родитель 3593dd9aad
Коммит cdf4e99378
2 изменённых файлов: 14 добавлений и 5 удалений

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

@ -192,6 +192,10 @@ SourceBuffer::Abort(ErrorResult& aRv)
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
if (mPendingRemoval.Exists()) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
AbortBufferAppend();
ResetParserState();
mCurrentAttributes.SetAppendWindowStart(0);
@ -248,11 +252,15 @@ SourceBuffer::RangeRemoval(double aStart, double aEnd)
StartUpdating();
RefPtr<SourceBuffer> self = this;
mPendingRemoval.Begin(
mTrackBuffersManager->RangeRemoval(TimeUnit::FromSeconds(aStart),
TimeUnit::FromSeconds(aEnd))
->Then(AbstractThread::MainThread(), __func__,
[self] (bool) { self->StopUpdating(); },
[]() { MOZ_ASSERT(false); });
[self] (bool) {
self->mPendingRemoval.Complete();
self->StopUpdating();
},
[]() { MOZ_ASSERT(false); }));
}
void

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

@ -174,6 +174,7 @@ private:
mozilla::Atomic<bool> mActive;
MozPromiseRequestHolder<SourceBufferTask::AppendPromise> mPendingAppend;
MozPromiseRequestHolder<SourceBufferTask::RangeRemovalPromise> mPendingRemoval;
const nsCString mType;
RefPtr<TimeRanges> mBuffered;