diff --git a/dom/media/Benchmark.cpp b/dom/media/Benchmark.cpp index d24e1e5c9ebe..5d87c5940719 100644 --- a/dom/media/Benchmark.cpp +++ b/dom/media/Benchmark.cpp @@ -335,7 +335,7 @@ BenchmarkPlayback::GlobalShutdown() } void -BenchmarkPlayback::Output(MediaDataDecoder::DecodedData&& aResults) +BenchmarkPlayback::Output(const MediaDataDecoder::DecodedData& aResults) { MOZ_ASSERT(OnThread()); MOZ_ASSERT(!mFinished); @@ -391,14 +391,14 @@ BenchmarkPlayback::InputExhausted() if (mSampleIndex == mSamples.Length() && !ref->mParameters.mStopAtFrame) { // Complete current frame decode then drain if still necessary. p->Then(Thread(), __func__, - [ref, this](MediaDataDecoder::DecodedData&& aResults) { - Output(std::move(aResults)); + [ref, this](const MediaDataDecoder::DecodedData& aResults) { + Output(aResults); if (!mFinished) { mDecoder->Drain()->Then( Thread(), __func__, - [ref, this](MediaDataDecoder::DecodedData&& aResults) { + [ref, this](const MediaDataDecoder::DecodedData& aResults) { mDrained = true; - Output(std::move(aResults)); + Output(aResults); MOZ_ASSERT(mFinished, "We must be done now"); }, [ref, this](const MediaResult& aError) { Error(aError); }); @@ -411,8 +411,8 @@ BenchmarkPlayback::InputExhausted() } // Continue decoding p->Then(Thread(), __func__, - [ref, this](MediaDataDecoder::DecodedData&& aResults) { - Output(std::move(aResults)); + [ref, this](const MediaDataDecoder::DecodedData& aResults) { + Output(aResults); if (!mFinished) { InputExhausted(); } diff --git a/dom/media/Benchmark.h b/dom/media/Benchmark.h index 140191d36e88..f6a5ff53b6a5 100644 --- a/dom/media/Benchmark.h +++ b/dom/media/Benchmark.h @@ -29,7 +29,7 @@ class BenchmarkPlayback : public QueueObject void GlobalShutdown(); void InitDecoder(TrackInfo&& aInfo); - void Output(MediaDataDecoder::DecodedData&& aResults); + void Output(const MediaDataDecoder::DecodedData& aResults); void Error(const MediaResult& aError); void InputExhausted(); diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp index 857c56b78071..9ba33603ec50 100644 --- a/dom/media/MediaFormatReader.cpp +++ b/dom/media/MediaFormatReader.cpp @@ -1845,7 +1845,7 @@ MediaFormatReader::OnAudioDemuxCompleted( void MediaFormatReader::NotifyNewOutput( - TrackType aTrack, MediaDataDecoder::DecodedData&& aResults) + TrackType aTrack, const MediaDataDecoder::DecodedData& aResults) { MOZ_ASSERT(OnTaskQueue()); auto& decoder = GetDecoderData(aTrack); @@ -1854,7 +1854,7 @@ MediaFormatReader::NotifyNewOutput( aTrack == TrackInfo::kAudioTrack ? "decoded_audio" : "decoded_video", "no output samples"); } else - for (auto&& sample : aResults) { + for (auto& sample : aResults) { if (DecoderDoctorLogger::IsDDLoggingEnabled()) { switch (sample->mType) { case MediaData::AUDIO_DATA: @@ -2180,9 +2180,9 @@ MediaFormatReader::DecodeDemuxedSamples(TrackType aTrack, decoder.mDecoder->Decode(aSample) ->Then(mTaskQueue, __func__, [self, aTrack, &decoder] - (MediaDataDecoder::DecodedData&& aResults) { + (const MediaDataDecoder::DecodedData& aResults) { decoder.mDecodeRequest.Complete(); - self->NotifyNewOutput(aTrack, std::move(aResults)); + self->NotifyNewOutput(aTrack, aResults); // When we recovered from a GPU crash and get the first decoded // frame, report the recovery time telemetry. @@ -2395,13 +2395,13 @@ MediaFormatReader::DrainDecoder(TrackType aTrack) decoder.mDecoder->Drain() ->Then(mTaskQueue, __func__, [self, aTrack, &decoder] - (MediaDataDecoder::DecodedData&& aResults) { + (const MediaDataDecoder::DecodedData& aResults) { decoder.mDrainRequest.Complete(); DDLOGEX(self.get(), DDLogCategory::Log, "drained", DDNoValue{}); if (aResults.IsEmpty()) { decoder.mDrainState = DrainState::DrainCompleted; } else { - self->NotifyNewOutput(aTrack, std::move(aResults)); + self->NotifyNewOutput(aTrack, aResults); // Let's see if we have any more data available to drain. decoder.mDrainState = DrainState::PartialDrainPending; } diff --git a/dom/media/MediaFormatReader.h b/dom/media/MediaFormatReader.h index a7f94fa97c4a..abb841b9e5e7 100644 --- a/dom/media/MediaFormatReader.h +++ b/dom/media/MediaFormatReader.h @@ -318,7 +318,7 @@ private: // Drain the current decoder. void DrainDecoder(TrackType aTrack); void NotifyNewOutput(TrackType aTrack, - MediaDataDecoder::DecodedData&& aResults); + const MediaDataDecoder::DecodedData& aResults); void NotifyError(TrackType aTrack, const MediaResult& aError); void NotifyWaitingForData(TrackType aTrack); void NotifyWaitingForKey(TrackType aTrack); diff --git a/dom/media/ipc/RemoteVideoDecoderChild.cpp b/dom/media/ipc/RemoteVideoDecoderChild.cpp index 2e49513324e3..de9cdb24981a 100644 --- a/dom/media/ipc/RemoteVideoDecoderChild.cpp +++ b/dom/media/ipc/RemoteVideoDecoderChild.cpp @@ -119,8 +119,8 @@ mozilla::ipc::IPCResult RemoteVideoDecoderChild::RecvInputExhausted() { AssertOnManagerThread(); - mDecodePromise.ResolveIfExists(std::move(mDecodedData), __func__); - mDecodedData = MediaDataDecoder::DecodedData(); + mDecodePromise.ResolveIfExists(mDecodedData, __func__); + mDecodedData.Clear(); return IPC_OK(); } @@ -128,8 +128,8 @@ mozilla::ipc::IPCResult RemoteVideoDecoderChild::RecvDrainComplete() { AssertOnManagerThread(); - mDecodePromise.ResolveIfExists(std::move(mDecodedData), __func__); - mDecodedData = MediaDataDecoder::DecodedData(); + mDrainPromise.ResolveIfExists(mDecodedData, __func__); + mDecodedData.Clear(); return IPC_OK(); } @@ -137,7 +137,7 @@ mozilla::ipc::IPCResult RemoteVideoDecoderChild::RecvError(const nsresult& aError) { AssertOnManagerThread(); - mDecodedData = MediaDataDecoder::DecodedData(); + mDecodedData.Clear(); mDecodePromise.RejectIfExists(aError, __func__); mDrainPromise.RejectIfExists(aError, __func__); mFlushPromise.RejectIfExists(aError, __func__); diff --git a/dom/media/ipc/VideoDecoderChild.cpp b/dom/media/ipc/VideoDecoderChild.cpp index ec35672b26a2..8cd2e258a3d3 100644 --- a/dom/media/ipc/VideoDecoderChild.cpp +++ b/dom/media/ipc/VideoDecoderChild.cpp @@ -81,8 +81,8 @@ mozilla::ipc::IPCResult VideoDecoderChild::RecvInputExhausted() { AssertOnManagerThread(); - mDecodePromise.ResolveIfExists(std::move(mDecodedData), __func__); - mDecodedData = MediaDataDecoder::DecodedData(); + mDecodePromise.ResolveIfExists(mDecodedData, __func__); + mDecodedData.Clear(); return IPC_OK(); } @@ -90,8 +90,8 @@ mozilla::ipc::IPCResult VideoDecoderChild::RecvDrainComplete() { AssertOnManagerThread(); - mDrainPromise.ResolveIfExists(std::move(mDecodedData), __func__); - mDecodedData = MediaDataDecoder::DecodedData(); + mDrainPromise.ResolveIfExists(mDecodedData, __func__); + mDecodedData.Clear(); return IPC_OK(); } @@ -99,7 +99,7 @@ mozilla::ipc::IPCResult VideoDecoderChild::RecvError(const nsresult& aError) { AssertOnManagerThread(); - mDecodedData = MediaDataDecoder::DecodedData(); + mDecodedData.Clear(); mDecodePromise.RejectIfExists(aError, __func__); mDrainPromise.RejectIfExists(aError, __func__); mFlushPromise.RejectIfExists(aError, __func__); @@ -153,7 +153,7 @@ VideoDecoderChild::ActorDestroy(ActorDestroyReason aWhy) MediaResult error(NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER); error.SetGPUCrashTimeStamp(ref->mGPUCrashTime); if (ref->mInitialized) { - mDecodedData = MediaDataDecoder::DecodedData(); + mDecodedData.Clear(); mDecodePromise.RejectIfExists(error, __func__); mDrainPromise.RejectIfExists(error, __func__); mFlushPromise.RejectIfExists(error, __func__); diff --git a/dom/media/ipc/VideoDecoderParent.cpp b/dom/media/ipc/VideoDecoderParent.cpp index cf2d7006db8f..037af7cc2703 100644 --- a/dom/media/ipc/VideoDecoderParent.cpp +++ b/dom/media/ipc/VideoDecoderParent.cpp @@ -165,11 +165,11 @@ VideoDecoderParent::RecvInput(const MediaRawDataIPDL& aData) RefPtr self = this; mDecoder->Decode(data)->Then( mManagerTaskQueue, __func__, - [self, this](MediaDataDecoder::DecodedData&& aResults) { + [self, this](const MediaDataDecoder::DecodedData& aResults) { if (mDestroyed) { return; } - ProcessDecodedData(std::move(aResults)); + ProcessDecodedData(aResults); Unused << SendInputExhausted(); }, [self](const MediaResult& aError) { self->Error(aError); }); @@ -177,7 +177,8 @@ VideoDecoderParent::RecvInput(const MediaRawDataIPDL& aData) } void -VideoDecoderParent::ProcessDecodedData(MediaDataDecoder::DecodedData&& aData) +VideoDecoderParent::ProcessDecodedData( + const MediaDataDecoder::DecodedData& aData) { MOZ_ASSERT(OnManagerThread()); @@ -186,7 +187,7 @@ VideoDecoderParent::ProcessDecodedData(MediaDataDecoder::DecodedData&& aData) return; } - for (auto&& data : aData) { + for (const auto& data : aData) { MOZ_ASSERT(data->mType == MediaData::VIDEO_DATA, "Can only decode videos using VideoDecoderParent!"); VideoData* video = static_cast(data.get()); @@ -199,7 +200,7 @@ VideoDecoderParent::ProcessDecodedData(MediaDataDecoder::DecodedData&& aData) if (!texture) { texture = ImageClient::CreateTextureClientForImage(video->mImage, - mKnowsCompositor); + mKnowsCompositor); } if (texture && !texture->IsAddedToCompositableClient()) { @@ -247,9 +248,9 @@ VideoDecoderParent::RecvDrain() RefPtr self = this; mDecoder->Drain()->Then( mManagerTaskQueue, __func__, - [self, this](MediaDataDecoder::DecodedData&& aResults) { + [self, this](const MediaDataDecoder::DecodedData& aResults) { if (!mDestroyed) { - ProcessDecodedData(std::move(aResults)); + ProcessDecodedData(aResults); Unused << SendDrainComplete(); } }, diff --git a/dom/media/ipc/VideoDecoderParent.h b/dom/media/ipc/VideoDecoderParent.h index bfa9d0dd2c24..c8857a07091f 100644 --- a/dom/media/ipc/VideoDecoderParent.h +++ b/dom/media/ipc/VideoDecoderParent.h @@ -53,7 +53,7 @@ private: void Error(const MediaResult& aError); ~VideoDecoderParent(); - void ProcessDecodedData(MediaDataDecoder::DecodedData&& aData); + void ProcessDecodedData(const MediaDataDecoder::DecodedData& aData); RefPtr mParent; RefPtr mIPDLSelfRef; diff --git a/dom/media/mediacapabilities/MediaCapabilities.cpp b/dom/media/mediacapabilities/MediaCapabilities.cpp index 0edbfbd013f3..9f47ea2f4dd9 100644 --- a/dom/media/mediacapabilities/MediaCapabilities.cpp +++ b/dom/media/mediacapabilities/MediaCapabilities.cpp @@ -251,10 +251,8 @@ MediaCapabilities::DecodingInfo( promises.AppendElement(InvokeAsync( taskQueue, __func__, - [ taskQueue, - frameRate, - compositor, - config = std::move(config) ]() mutable -> RefPtr { + [taskQueue, frameRate, compositor, config = std::move(config)]() mutable + -> RefPtr { // MediaDataDecoder keeps a reference to the config object, so we must // keep it alive until the decoder has been shutdown. CreateDecoderParams params{ *config, @@ -266,25 +264,25 @@ MediaCapabilities::DecodingInfo( return AllocationWrapper::CreateDecoder(params)->Then( taskQueue, __func__, - [ taskQueue, frameRate, config = std::move(config) ]( - AllocationWrapper::AllocateDecoderPromise::ResolveOrRejectValue&& - aValue) mutable { + [taskQueue, frameRate, config = std::move(config)]( + const AllocationWrapper::AllocateDecoderPromise:: + ResolveOrRejectValue& aValue) mutable { if (aValue.IsReject()) { - return CapabilitiesPromise::CreateAndReject( - std::move(aValue.RejectValue()), __func__); + return CapabilitiesPromise::CreateAndReject(aValue.RejectValue(), + __func__); } - RefPtr decoder = std::move(aValue.ResolveValue()); + RefPtr decoder = aValue.ResolveValue(); // We now query the decoder to determine if it's power efficient. RefPtr p = decoder->Init()->Then( taskQueue, __func__, - [ taskQueue, decoder, frameRate, config = std::move(config) ]( - MediaDataDecoder::InitPromise::ResolveOrRejectValue&& - aValue) mutable { + [taskQueue, decoder, frameRate, config = std::move(config)]( + const MediaDataDecoder::InitPromise::ResolveOrRejectValue& + aValue) mutable { RefPtr p; if (aValue.IsReject()) { - p = CapabilitiesPromise::CreateAndReject( - std::move(aValue.RejectValue()), __func__); + p = CapabilitiesPromise::CreateAndReject(aValue.RejectValue(), + __func__); } else { MOZ_ASSERT(config->IsVideo()); nsAutoCString reason; @@ -370,15 +368,14 @@ MediaCapabilities::DecodingInfo( ->Then( targetThread, __func__, - [ - promise, - tracks = std::move(tracks), - workerRef, - holder, - aConfiguration, - self, - this - ](CapabilitiesPromise::AllPromiseType::ResolveOrRejectValue&& aValue) { + [promise, + tracks = std::move(tracks), + workerRef, + holder, + aConfiguration, + self, + this](const CapabilitiesPromise::AllPromiseType::ResolveOrRejectValue& + aValue) { holder->Complete(); if (aValue.IsReject()) { auto info = diff --git a/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp b/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp index d4195c646260..532f92d6a969 100644 --- a/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp +++ b/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp @@ -214,12 +214,14 @@ public: writer->mCrypto = CryptoSample(); RefPtr self = this; mDecoder->Decode(aDecrypted.mSample) - ->Then(mTaskQueue, - __func__, - [self](DecodePromise::ResolveOrRejectValue&& aValue) { + ->Then(mTaskQueue, __func__, + [self](const DecodedData& aResults) { self->mDecodeRequest.Complete(); - self->mDecodePromise.ResolveOrReject(std::move(aValue), - __func__); + self->mDecodePromise.ResolveIfExists(aResults, __func__); + }, + [self](const MediaResult& aError) { + self->mDecodeRequest.Complete(); + self->mDecodePromise.RejectIfExists(aError, __func__); }) ->Track(mDecodeRequest); } @@ -348,14 +350,16 @@ EMEMediaDataDecoderProxy::Decode(MediaRawData* aSample) mKeyRequest.Complete(); MediaDataDecoderProxy::Decode(aSample) - ->Then( - mTaskQueue, - __func__, - [self, this](DecodePromise::ResolveOrRejectValue&& aValue) { - mDecodeRequest.Complete(); - mDecodePromise.ResolveOrReject(std::move(aValue), - __func__); - }) + ->Then(mTaskQueue, + __func__, + [self, this](const DecodedData& aResults) { + mDecodeRequest.Complete(); + mDecodePromise.Resolve(aResults, __func__); + }, + [self, this](const MediaResult& aError) { + mDecodeRequest.Complete(); + mDecodePromise.Reject(aError, __func__); + }) ->Track(mDecodeRequest); }, [self]() { diff --git a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp index 99d21d7a9093..75745b14f47f 100644 --- a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp +++ b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp @@ -101,16 +101,16 @@ void GMPVideoDecoder::InputDataExhausted() { MOZ_ASSERT(IsOnGMPThread()); - mDecodePromise.ResolveIfExists(std::move(mDecodedData), __func__); - mDecodedData = DecodedData(); + mDecodePromise.ResolveIfExists(mDecodedData, __func__); + mDecodedData.Clear(); } void GMPVideoDecoder::DrainComplete() { MOZ_ASSERT(IsOnGMPThread()); - mDrainPromise.ResolveIfExists(std::move(mDecodedData), __func__); - mDecodedData = DecodedData(); + mDrainPromise.ResolveIfExists(mDecodedData, __func__); + mDecodedData.Clear(); } void diff --git a/dom/media/platforms/android/RemoteDataDecoder.cpp b/dom/media/platforms/android/RemoteDataDecoder.cpp index 70fa16a0564f..c938d39984f8 100644 --- a/dom/media/platforms/android/RemoteDataDecoder.cpp +++ b/dom/media/platforms/android/RemoteDataDecoder.cpp @@ -498,7 +498,7 @@ RemoteDataDecoder::Flush() { RefPtr self = this; return InvokeAsync(mTaskQueue, __func__, [self, this]() { - mDecodedData = DecodedData(); + mDecodedData.Clear(); mNumPendingInputs = 0; mDecodePromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__); mDrainPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__); @@ -726,12 +726,12 @@ RemoteDataDecoder::ReturnDecodedData() // We only want to clear mDecodedData when we have resolved the promises. if (!mDecodePromise.IsEmpty()) { - mDecodePromise.Resolve(std::move(mDecodedData), __func__); - mDecodedData = DecodedData(); + mDecodePromise.Resolve(mDecodedData, __func__); + mDecodedData.Clear(); } else if (!mDrainPromise.IsEmpty() && (!mDecodedData.IsEmpty() || mDrainStatus == DrainStatus::DRAINED)) { - mDrainPromise.Resolve(std::move(mDecodedData), __func__); - mDecodedData = DecodedData(); + mDrainPromise.Resolve(mDecodedData, __func__); + mDecodedData.Clear(); } } diff --git a/dom/media/platforms/apple/AppleATDecoder.cpp b/dom/media/platforms/apple/AppleATDecoder.cpp index 4f4c119a00de..85c7e6eca088 100644 --- a/dom/media/platforms/apple/AppleATDecoder.cpp +++ b/dom/media/platforms/apple/AppleATDecoder.cpp @@ -223,9 +223,7 @@ AppleATDecoder::ProcessDecode(MediaRawData* aSample) mQueuedSamples.Clear(); } - DecodedData results = std::move(mDecodedSamples); - mDecodedSamples = DecodedData(); - return DecodePromise::CreateAndResolve(std::move(results), __func__); + return DecodePromise::CreateAndResolve(std::move(mDecodedSamples), __func__); } MediaResult diff --git a/dom/media/platforms/omx/OmxDataDecoder.cpp b/dom/media/platforms/omx/OmxDataDecoder.cpp index eb087e61d2fe..b8236da77a19 100644 --- a/dom/media/platforms/omx/OmxDataDecoder.cpp +++ b/dom/media/platforms/omx/OmxDataDecoder.cpp @@ -137,12 +137,15 @@ OmxDataDecoder::EndOfStream() RefPtr self = this; mOmxLayer->SendCommand(OMX_CommandFlush, OMX_ALL, nullptr) - ->Then(mOmxTaskQueue, - __func__, - [self, this](OmxCommandPromise::ResolveOrRejectValue&& aValue) { - mDrainPromise.ResolveIfExists(std::move(mDecodedData), __func__); - mDecodedData = DecodedData(); - }); + ->Then(mOmxTaskQueue, __func__, + [self, this] () { + mDrainPromise.ResolveIfExists(mDecodedData, __func__); + mDecodedData.Clear(); + }, + [self, this] () { + mDrainPromise.ResolveIfExists(mDecodedData, __func__); + mDecodedData.Clear(); + }); } RefPtr @@ -398,8 +401,8 @@ OmxDataDecoder::EmptyBufferDone(BufferData* aData) return; } - mDecodePromise.ResolveIfExists(std::move(mDecodedData), __func__); - mDecodedData = DecodedData(); + mDecodePromise.ResolveIfExists(mDecodedData, __func__); + mDecodedData.Clear(); }); nsresult rv = mOmxTaskQueue->Dispatch(r.forget()); @@ -419,7 +422,7 @@ OmxDataDecoder::NotifyError(OMX_ERRORTYPE aOmxError, const char* aLine, const Me { LOG("NotifyError %d (%s) at %s", static_cast(aOmxError), aError.ErrorName().get(), aLine); - mDecodedData = DecodedData(); + mDecodedData.Clear(); mDecodePromise.RejectIfExists(aError, __func__); mDrainPromise.RejectIfExists(aError, __func__); mFlushPromise.RejectIfExists(aError, __func__); @@ -852,7 +855,7 @@ OmxDataDecoder::DoFlush() { MOZ_ASSERT(mOmxTaskQueue->IsCurrentThreadIn()); - mDecodedData = DecodedData(); + mDecodedData.Clear(); mDecodePromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__); mDrainPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__); diff --git a/dom/media/platforms/wrappers/MediaChangeMonitor.cpp b/dom/media/platforms/wrappers/MediaChangeMonitor.cpp index 0d8aac76a089..b665679f70da 100644 --- a/dom/media/platforms/wrappers/MediaChangeMonitor.cpp +++ b/dom/media/platforms/wrappers/MediaChangeMonitor.cpp @@ -552,8 +552,8 @@ MediaChangeMonitor::DecodeFirstSample(MediaRawData* aSample) AssertOnTaskQueue(); if (mNeedKeyframe && !aSample->mKeyframe) { - mDecodePromise.Resolve(std::move(mPendingFrames), __func__); - mPendingFrames = DecodedData(); + mDecodePromise.Resolve(mPendingFrames, __func__); + mPendingFrames.Clear(); return; } @@ -569,11 +569,11 @@ MediaChangeMonitor::DecodeFirstSample(MediaRawData* aSample) RefPtr self = this; mDecoder->Decode(aSample) ->Then(AbstractThread::GetCurrent()->AsTaskQueue(), __func__, - [self, this](MediaDataDecoder::DecodedData&& aResults) { + [self, this](const MediaDataDecoder::DecodedData& aResults) { mDecodePromiseRequest.Complete(); - mPendingFrames.AppendElements(std::move(aResults)); - mDecodePromise.Resolve(std::move(mPendingFrames), __func__); - mPendingFrames = DecodedData(); + mPendingFrames.AppendElements(aResults); + mDecodePromise.Resolve(mPendingFrames, __func__); + mPendingFrames.Clear(); }, [self, this](const MediaResult& aError) { mDecodePromiseRequest.Complete(); @@ -619,7 +619,7 @@ MediaChangeMonitor::DrainThenFlushDecoder(MediaRawData* aPendingSample) mDecoder->Drain() ->Then(AbstractThread::GetCurrent()->AsTaskQueue(), __func__, - [self, sample, this](MediaDataDecoder::DecodedData&& aResults) { + [self, sample, this](const MediaDataDecoder::DecodedData& aResults) { mDrainRequest.Complete(); if (!mFlushPromise.IsEmpty()) { // A Flush is pending, abort the current operation. @@ -627,7 +627,7 @@ MediaChangeMonitor::DrainThenFlushDecoder(MediaRawData* aPendingSample) return; } if (aResults.Length() > 0) { - mPendingFrames.AppendElements(std::move(aResults)); + mPendingFrames.AppendElements(aResults); DrainThenFlushDecoder(sample); return; } diff --git a/xpcom/threads/MozPromise.h b/xpcom/threads/MozPromise.h index bf8013cc990b..41b0247742da 100644 --- a/xpcom/threads/MozPromise.h +++ b/xpcom/threads/MozPromise.h @@ -1219,11 +1219,6 @@ public: template void Resolve(ResolveValueType_&& aResolveValue, const char* aMethodName) { - static_assert( - IsConvertible::value, - "Resolve() argument must be convertible to MozPromise's ResolveValueT"); - if (mMonitor) { mMonitor->AssertCurrentThreadOwns(); } @@ -1245,11 +1240,6 @@ public: template void Reject(RejectValueType_&& aRejectValue, const char* aMethodName) { - static_assert( - IsConvertible::value, - "Reject() argument must be convertible to MozPromise's RejectValueT"); - if (mMonitor) { mMonitor->AssertCurrentThreadOwns(); }