зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1349883 - part 4: strengthen precondition of ReturnDecodedData(). r=jya
MozReview-Commit-ID: 2jLNlrHEE0b --HG-- extra : rebase_source : af780e3b10f915302aa1deaba18a324266fa1dc0
This commit is contained in:
Родитель
ab9060d531
Коммит
6e70175957
|
@ -460,6 +460,9 @@ RemoteDataDecoder::Drain()
|
|||
{
|
||||
RefPtr<RemoteDataDecoder> self = this;
|
||||
return InvokeAsync(mTaskQueue, __func__, [self, this]() {
|
||||
if (mShutdown) {
|
||||
return DecodePromise::CreateAndReject(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
|
||||
}
|
||||
RefPtr<DecodePromise> p = mDrainPromise.Ensure(__func__);
|
||||
if (mDrainStatus == DrainStatus::DRAINED) {
|
||||
// There's no operation to perform other than returning any already
|
||||
|
@ -592,15 +595,9 @@ RemoteDataDecoder::UpdateOutputStatus(MediaData* aSample)
|
|||
void
|
||||
RemoteDataDecoder::ReturnDecodedData()
|
||||
{
|
||||
if (!mTaskQueue->IsCurrentThreadIn()) {
|
||||
mTaskQueue->Dispatch(
|
||||
NewRunnableMethod(this, &RemoteDataDecoder::ReturnDecodedData));
|
||||
return;
|
||||
}
|
||||
AssertOnTaskQueue();
|
||||
if (mShutdown) {
|
||||
return;
|
||||
}
|
||||
MOZ_ASSERT(!mShutdown);
|
||||
|
||||
// We only want to clear mDecodedData when we have resolved the promises.
|
||||
if (!mDecodePromise.IsEmpty()) {
|
||||
mDecodePromise.Resolve(mDecodedData, __func__);
|
||||
|
|
Загрузка…
Ссылка в новой задаче