зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
3593dd9aad
Коммит
cdf4e99378
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче