Bug 1425996 - fix build error: unused variable 'rv'. r=gerald
authorJW Wang <jwwang@mozilla.com>
Thu, 21 Dec 2017 12:12:42 +0800
changeset 397080 06a19fbe2581a81e6908b4810f8aa302f1516145
parent 397079 63a089b7dc0446545593e3d1e8592f7285cb1a7c
child 397117 41084549f30fe029c96f19bcd1fbfd6f209df874
child 397126 cd981f26866c3eb5953ee43a504d58ec3b6605d6
push id33123
push userncsoregi@mozilla.com
push dateThu, 21 Dec 2017 10:00:47 +0000
treeherdermozilla-central@06a19fbe2581 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1425996
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1425996 - fix build error: unused variable 'rv'. r=gerald MozReview-Commit-ID: 7MhsSWbxB3z
dom/media/MediaDecoder.cpp
dom/media/MediaDecoderStateMachine.cpp
dom/media/MediaDecoderStateMachine.h
dom/media/MediaFormatReader.cpp
dom/media/MediaRecorder.cpp
dom/media/MediaTimer.cpp
dom/media/ReaderProxy.cpp
dom/media/encoder/MediaEncoder.cpp
dom/media/hls/HLSDemuxer.cpp
dom/media/mediasource/MediaSourceDemuxer.cpp
dom/media/mediasource/TrackBuffersManager.cpp
dom/media/platforms/android/RemoteDataDecoder.cpp
dom/media/platforms/omx/OmxDataDecoder.cpp
dom/media/webaudio/MediaBufferDecoder.cpp
media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1219,16 +1219,17 @@ MediaDecoder::NotifyReaderDataArrived()
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
 
   nsresult rv = mReader->OwnerThread()->Dispatch(
     NewRunnableMethod("MediaFormatReader::NotifyDataArrived",
                       mReader.get(),
                       &MediaFormatReader::NotifyDataArrived));
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 // Provide access to the state machine object
 MediaDecoderStateMachine*
 MediaDecoder::GetStateMachine() const
 {
   MOZ_ASSERT(NS_IsMainThread());
   return mDecoderStateMachine;
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1488,16 +1488,17 @@ public:
     // promise resolving is postponed and then the JS developer receives the
     // "ended" event before the seek promise is resolved.
     // An asynchronous seek operation helps to solve this issue since while the
     // seek is actually performed, the ThenValue of SeekPromise has already
     // been set so that it won't be postponed.
     RefPtr<Runnable> r = mAsyncSeekTask = new AysncNextFrameSeekTask(this);
     nsresult rv = OwnerThread()->Dispatch(r.forget());
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 
 private:
   void DoSeekInternal()
   {
     // We don't need to discard frames to the mCurrentTime here because we have
     // done it at DoSeek() and any video data received in between either
     // finishes the seek operation or be discarded, see HandleVideoDecoded().
@@ -3605,16 +3606,17 @@ MediaDecoderStateMachine::ScheduleStateM
   mDispatchedStateMachine = true;
 
   nsresult rv =
     OwnerThread()->Dispatch(
       NewRunnableMethod("MediaDecoderStateMachine::RunStateMachine",
                         this,
                         &MediaDecoderStateMachine::RunStateMachine));
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 void
 MediaDecoderStateMachine::ScheduleStateMachineIn(const TimeUnit& aTime)
 {
   MOZ_ASSERT(OnTaskQueue()); // mDelayedScheduler.Ensure() may Disconnect()
                              // the promise, which must happen on the state
                              // machine task queue.
@@ -3849,47 +3851,50 @@ MediaDecoderStateMachine::RequestDebugIn
   RefPtr<PromiseType::Private> p = new PromiseType::Private(__func__);
   RefPtr<MediaDecoderStateMachine> self = this;
   nsresult rv = OwnerThread()->Dispatch(
     NS_NewRunnableFunction(
       "MediaDecoderStateMachine::RequestDebugInfo",
       [self, p]() { p->Resolve(self->GetDebugInfo(), __func__); }),
     AbstractThread::TailDispatch);
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
   return p.forget();
 }
 
 void MediaDecoderStateMachine::AddOutputStream(ProcessedMediaStream* aStream,
                                                bool aFinishWhenEnded)
 {
   MOZ_ASSERT(NS_IsMainThread());
   LOG("AddOutputStream aStream=%p!", aStream);
   mOutputStreamManager->Add(aStream, aFinishWhenEnded);
   nsCOMPtr<nsIRunnable> r =
     NewRunnableMethod<bool>("MediaDecoderStateMachine::SetAudioCaptured",
                             this,
                             &MediaDecoderStateMachine::SetAudioCaptured,
                             true);
   nsresult rv = OwnerThread()->Dispatch(r.forget());
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 void MediaDecoderStateMachine::RemoveOutputStream(MediaStream* aStream)
 {
   MOZ_ASSERT(NS_IsMainThread());
   LOG("RemoveOutputStream=%p!", aStream);
   mOutputStreamManager->Remove(aStream);
   if (mOutputStreamManager->IsEmpty()) {
     nsCOMPtr<nsIRunnable> r =
       NewRunnableMethod<bool>("MediaDecoderStateMachine::SetAudioCaptured",
                               this,
                               &MediaDecoderStateMachine::SetAudioCaptured,
                               false);
     nsresult rv = OwnerThread()->Dispatch(r.forget());
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 }
 
 class VideoQueueMemoryFunctor : public nsDequeFunctor
 {
 public:
   VideoQueueMemoryFunctor()
     : mSize(0)
--- a/dom/media/MediaDecoderStateMachine.h
+++ b/dom/media/MediaDecoderStateMachine.h
@@ -228,16 +228,17 @@ public:
       [self, aEndTime]() {
         // A negative number means we don't have a fragment end time at all.
         self->mFragmentEndTime = aEndTime >= media::TimeUnit::Zero()
                                    ? aEndTime
                                    : media::TimeUnit::Invalid();
       });
     nsresult rv = OwnerThread()->Dispatch(r.forget());
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 
   void DispatchCanPlayThrough(bool aCanPlayThrough)
   {
     RefPtr<MediaDecoderStateMachine> self = this;
     nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction(
       "MediaDecoderStateMachine::DispatchCanPlayThrough",
       [self, aCanPlayThrough]() {
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -1123,16 +1123,17 @@ public:
   void Reset() override
   {
     RefPtr<Wrapper> self = this;
     nsresult rv =
       mTaskQueue->Dispatch(
         NS_NewRunnableFunction("MediaFormatReader::DemuxerProxy::Wrapper::Reset",
                                [self]() { self->mTrackDemuxer->Reset(); }));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 
   nsresult GetNextRandomAccessPoint(TimeUnit* aTime) override
   {
     MutexAutoLock lock(mMutex);
     if (NS_SUCCEEDED(mNextRandomAccessPointResult)) {
       *aTime = mNextRandomAccessPoint;
     }
@@ -1184,16 +1185,17 @@ private:
   ~Wrapper()
   {
     RefPtr<MediaTrackDemuxer> trackDemuxer = mTrackDemuxer.forget();
     nsresult rv =
       mTaskQueue->Dispatch(NS_NewRunnableFunction(
         "MediaFormatReader::DemuxerProxy::Wrapper::~Wrapper",
         [trackDemuxer]() { trackDemuxer->BreakCycles(); }));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
     DecoderDoctorLogger::LogDestruction(
       "MediaFormatReader::DemuxerProxy::Wrapper", this);
   }
 
   void UpdateRandomAccessPoint()
   {
     MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
     if (!mTrackDemuxer) {
@@ -2229,16 +2231,17 @@ MediaFormatReader::ScheduleUpdate(TrackT
     return;
   }
   LOGV("SchedulingUpdate(%s)", TrackTypeToStr(aTrack));
   decoder.mUpdateScheduled = true;
   RefPtr<nsIRunnable> task(NewRunnableMethod<TrackType>(
     "MediaFormatReader::Update", this, &MediaFormatReader::Update, aTrack));
   nsresult rv = OwnerThread()->Dispatch(task.forget());
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 bool
 MediaFormatReader::UpdateReceivedNewData(TrackType aTrack)
 {
   MOZ_ASSERT(OnTaskQueue());
   auto& decoder = GetDecoderData(aTrack);
 
@@ -3169,16 +3172,17 @@ MediaFormatReader::ScheduleSeek()
   if (mSeekScheduled) {
     return;
   }
   mSeekScheduled = true;
   nsresult rv =
     OwnerThread()->Dispatch(NewRunnableMethod(
       "MediaFormatReader::AttemptSeek", this, &MediaFormatReader::AttemptSeek));
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 void
 MediaFormatReader::AttemptSeek()
 {
   MOZ_ASSERT(OnTaskQueue());
 
   mSeekScheduled = false;
--- a/dom/media/MediaRecorder.cpp
+++ b/dom/media/MediaRecorder.cpp
@@ -965,16 +965,17 @@ private:
 
     mEncoderListener = MakeAndAddRef<EncoderListener>(mEncoderThread, this);
     nsresult rv =
       mEncoderThread->Dispatch(
         NewRunnableMethod<RefPtr<EncoderListener>>(
           "mozilla::MediaEncoder::RegisterListener",
           mEncoder, &MediaEncoder::RegisterListener, mEncoderListener));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
 
     if (mRecorder->mAudioNode) {
       mEncoder->ConnectAudioNode(mRecorder->mAudioNode,
                                  mRecorder->mAudioNodeOutput);
     }
 
     for (auto& track : mMediaStreamTracks) {
       mEncoder->ConnectMediaStreamTrack(track);
--- a/dom/media/MediaTimer.cpp
+++ b/dom/media/MediaTimer.cpp
@@ -41,16 +41,17 @@ MediaTimer::DispatchDestroy()
   // Destroy(), which may run completely before the stack if Dispatch() begins
   // to unwind.
   nsCOMPtr<nsIEventTarget> thread = mThread;
   nsresult rv =
     thread->Dispatch(NewNonOwningRunnableMethod(
                        "MediaTimer::Destroy", this, &MediaTimer::Destroy),
                      NS_DISPATCH_NORMAL);
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
   (void) rv;
 }
 
 void
 MediaTimer::Destroy()
 {
   MOZ_ASSERT(OnMediaTimerThread());
   TIMER_LOG("MediaTimer::Destroy");
@@ -97,16 +98,17 @@ MediaTimer::ScheduleUpdate()
     return;
   }
   mUpdateScheduled = true;
 
   nsresult rv = mThread->Dispatch(
     NewRunnableMethod("MediaTimer::Update", this, &MediaTimer::Update),
     NS_DISPATCH_NORMAL);
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
   (void) rv;
 }
 
 void
 MediaTimer::Update()
 {
   MonitorAutoLock mon(mMonitor);
   UpdateLocked();
@@ -175,12 +177,13 @@ MediaTimer::ArmTimer(const TimeStamp& aT
   // a timer when mTarget might compare < now (even if very close), so round up.
   unsigned long delay = std::ceil((aTarget - aNow).ToMilliseconds());
   TIMER_LOG("MediaTimer::ArmTimer delay=%lu", delay);
   mCurrentTimerTarget = aTarget;
   nsresult rv = mTimer->InitWithNamedFuncCallback(&TimerCallback, this, delay,
                                                   nsITimer::TYPE_ONE_SHOT,
                                                   "MediaTimer::TimerCallback");
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
   (void) rv;
 }
 
 } // namespace mozilla
--- a/dom/media/ReaderProxy.cpp
+++ b/dom/media/ReaderProxy.cpp
@@ -206,29 +206,31 @@ ReaderProxy::ReleaseResources()
 {
   MOZ_ASSERT(mOwnerThread->IsCurrentThreadIn());
   nsCOMPtr<nsIRunnable> r =
     NewRunnableMethod("MediaFormatReader::ReleaseResources",
                       mReader,
                       &MediaFormatReader::ReleaseResources);
   nsresult rv = mReader->OwnerThread()->Dispatch(r.forget());
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 void
 ReaderProxy::ResetDecode(TrackSet aTracks)
 {
   MOZ_ASSERT(mOwnerThread->IsCurrentThreadIn());
   nsCOMPtr<nsIRunnable> r =
     NewRunnableMethod<TrackSet>("MediaFormatReader::ResetDecode",
                                 mReader,
                                 &MediaFormatReader::ResetDecode,
                                 aTracks);
   nsresult rv = mReader->OwnerThread()->Dispatch(r.forget());
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 RefPtr<ShutdownPromise>
 ReaderProxy::Shutdown()
 {
   MOZ_ASSERT(mOwnerThread->IsCurrentThreadIn());
   mShutdown = true;
   RefPtr<ReaderProxy> self = this;
@@ -266,16 +268,17 @@ ReaderProxy::SetVideoBlankDecode(bool aI
   MOZ_ASSERT(mOwnerThread->IsCurrentThreadIn());
   nsCOMPtr<nsIRunnable> r =
     NewRunnableMethod<bool>("MediaFormatReader::SetVideoNullDecode",
                             mReader,
                             &MediaFormatReader::SetVideoNullDecode,
                             aIsBlankDecode);
   nsresult rv = mReader->OwnerThread()->Dispatch(r.forget());
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 void
 ReaderProxy::UpdateDuration()
 {
   MOZ_ASSERT(mReader->OwnerThread()->IsCurrentThreadIn());
   mReader->UpdateDuration(mDuration.Ref().ref());
 }
@@ -289,16 +292,17 @@ ReaderProxy::SetCanonicalDuration(
   RefPtr<DurationT> canonical = aCanonical;
   nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction(
     "ReaderProxy::SetCanonicalDuration", [this, self, canonical]() {
       mDuration.Connect(canonical);
       mWatchManager.Watch(mDuration, &ReaderProxy::UpdateDuration);
     });
   nsresult rv = mReader->OwnerThread()->Dispatch(r.forget());
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 void
 ReaderProxy::SetSeamlessLoopingEnabled(bool aEnabled)
 {
   MOZ_ASSERT(mOwnerThread->IsCurrentThreadIn());
   mSeamlessLoopingEnabled = aEnabled;
 }
--- a/dom/media/encoder/MediaEncoder.cpp
+++ b/dom/media/encoder/MediaEncoder.cpp
@@ -98,41 +98,44 @@ public:
 
     if (!mInitialized) {
       nsresult rv =
         mEncoderThread->Dispatch(
           NewRunnableMethod<StreamTime>(
             "mozilla::AudioTrackEncoder::SetStartOffset",
             mEncoder, &AudioTrackEncoder::SetStartOffset, aTrackOffset));
       MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+      Unused << rv;
       mInitialized = true;
     }
 
     if (mDirectConnected) {
       if (aQueuedMedia.IsNull()) {
         nsresult rv =
           mEncoderThread->Dispatch(
             NewRunnableMethod<StreamTime>(
               "mozilla::AudioTrackEncoder::AdvanceBlockedInput",
               mEncoder, &AudioTrackEncoder::AdvanceBlockedInput,
               aQueuedMedia.GetDuration()));
         MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+        Unused << rv;
         return;
       }
     } else {
       NotifyRealtimeTrackData(aGraph, aTrackOffset, aQueuedMedia);
     }
 
     nsresult rv =
       mEncoderThread->Dispatch(
         NewRunnableMethod<StreamTime>(
           "mozilla::AudioTrackEncoder::AdvanceCurrentTime",
           mEncoder, &AudioTrackEncoder::AdvanceCurrentTime,
           aQueuedMedia.GetDuration()));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 
   void NotifyRealtimeTrackData(MediaStreamGraph* aGraph,
                                StreamTime aTrackOffset,
                                const MediaSegment& aMedia) override
   {
     MOZ_ASSERT(mEncoder);
     MOZ_ASSERT(mEncoderThread);
@@ -147,42 +150,45 @@ public:
     copy.AppendSlice(audio, 0, audio.GetDuration());
 
     nsresult rv =
       mEncoderThread->Dispatch(
         NewRunnableMethod<StoreCopyPassByRRef<AudioSegment>>(
           "mozilla::AudioTrackEncoder::AppendAudioSegment",
           mEncoder, &AudioTrackEncoder::AppendAudioSegment, Move(copy)));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 
   void NotifyEnded() override
   {
     MOZ_ASSERT(mEncoder);
     MOZ_ASSERT(mEncoderThread);
 
     if (mShutdown) {
       return;
     }
 
     nsresult rv =
       mEncoderThread->Dispatch(
         NewRunnableMethod("mozilla::AudioTrackEncoder::NotifyEndOfStream",
                           mEncoder, &AudioTrackEncoder::NotifyEndOfStream));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 
   void NotifyRemoved() override
   {
     if (!mShutdown) {
       nsresult rv =
         mEncoderThread->Dispatch(
           NewRunnableMethod("mozilla::AudioTrackEncoder::NotifyEndOfStream",
                             mEncoder, &AudioTrackEncoder::NotifyEndOfStream));
       MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+      Unused << rv;
     }
 
     mRemoved = true;
 
     if (!mDirectConnected) {
       mEncoder = nullptr;
       mEncoderThread = nullptr;
     }
@@ -252,37 +258,40 @@ public:
 
     if (!mInitialized) {
       nsresult rv =
         mEncoderThread->Dispatch(
           NewRunnableMethod<StreamTime>(
             "mozilla::VideoTrackEncoder::SetStartOffset",
             mEncoder, &VideoTrackEncoder::SetStartOffset, aTrackOffset));
       MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+      Unused << rv;
       mInitialized = true;
     }
 
     if (aQueuedMedia.IsNull()) {
       nsresult rv =
         mEncoderThread->Dispatch(
           NewRunnableMethod<StreamTime>(
             "mozilla::VideoTrackEncoder::AdvanceBlockedInput",
             mEncoder, &VideoTrackEncoder::AdvanceBlockedInput,
             aQueuedMedia.GetDuration()));
       MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+      Unused << rv;
       return;
     }
 
     nsresult rv =
       mEncoderThread->Dispatch(
         NewRunnableMethod<StreamTime>(
           "mozilla::VideoTrackEncoder::AdvanceCurrentTime",
           mEncoder, &VideoTrackEncoder::AdvanceCurrentTime,
           aQueuedMedia.GetDuration()));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 
   void SetCurrentFrames(const VideoSegment& aMedia) override
   {
     MOZ_ASSERT(mEncoder);
     MOZ_ASSERT(mEncoderThread);
 
     if (mShutdown) {
@@ -293,16 +302,17 @@ public:
     copy.AppendSlice(aMedia, 0, aMedia.GetDuration());
 
     nsresult rv =
       mEncoderThread->Dispatch(
         NewRunnableMethod<StoreCopyPassByRRef<VideoSegment>>(
           "mozilla::VideoTrackEncoder::AppendVideoSegment",
           mEncoder, &VideoTrackEncoder::AppendVideoSegment, Move(copy)));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 
   void ClearFrames() override {}
 
   void NotifyEnded() override
   {
     MOZ_ASSERT(mEncoder);
     MOZ_ASSERT(mEncoderThread);
@@ -311,26 +321,28 @@ public:
       return;
     }
 
     nsresult rv =
       mEncoderThread->Dispatch(
         NewRunnableMethod("mozilla::VideoTrackEncoder::NotifyEndOfStream",
                           mEncoder, &VideoTrackEncoder::NotifyEndOfStream));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 
   void NotifyRemoved() override
   {
     if (!mShutdown) {
       nsresult rv =
         mEncoderThread->Dispatch(
           NewRunnableMethod("mozilla::VideoTrackEncoder::NotifyEndOfStream",
                             mEncoder, &VideoTrackEncoder::NotifyEndOfStream));
       MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+      Unused << rv;
     }
 
     mRemoved = true;
 
     if (!mDirectConnected) {
       mEncoder = nullptr;
       mEncoderThread = nullptr;
     }
@@ -370,16 +382,17 @@ public:
       return;
     }
 
     nsresult rv =
       mEncoderThread->Dispatch(
         NewRunnableMethod("mozilla::MediaEncoder::NotifyInitialized",
                           mEncoder, &MediaEncoder::NotifyInitialized));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 
   void DataAvailable(TrackEncoder* aTrackEncoder) override
   {
     MOZ_ASSERT(mEncoderThread->IsCurrentThreadIn());
     MOZ_ASSERT(aTrackEncoder->IsInitialized());
 
     if (!mEncoder) {
@@ -390,16 +403,17 @@ public:
       return;
     }
 
     nsresult rv =
       mEncoderThread->Dispatch(
         NewRunnableMethod("mozilla::MediaEncoder::EncoderListener::DataAvailableImpl",
                           this, &EncoderListener::DataAvailableImpl));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
 
     mPendingDataAvailable = true;
   }
 
   void DataAvailableImpl()
   {
     MOZ_ASSERT(mEncoderThread->IsCurrentThreadIn());
 
@@ -419,16 +433,17 @@ public:
       return;
     }
 
     nsresult rv =
       mEncoderThread->Dispatch(
         NewRunnableMethod("mozilla::MediaEncoder::SetError",
                           mEncoder, &MediaEncoder::SetError));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 
 protected:
   RefPtr<TaskQueue> mEncoderThread;
   RefPtr<MediaEncoder> mEncoder;
   bool mPendingDataAvailable;
 };
 
@@ -456,27 +471,29 @@ MediaEncoder::MediaEncoder(TaskQueue* aE
       MakeAndAddRef<AudioTrackListener>(mAudioEncoder, mEncoderThread);
     nsresult rv =
       mEncoderThread->Dispatch(
         NewRunnableMethod<RefPtr<EncoderListener>>(
           "mozilla::AudioTrackEncoder::RegisterListener",
           mAudioEncoder, &AudioTrackEncoder::RegisterListener,
           mEncoderListener));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
   if (mVideoEncoder) {
     mVideoListener =
       MakeAndAddRef<VideoTrackListener>(mVideoEncoder, mEncoderThread);
     nsresult rv =
       mEncoderThread->Dispatch(
         NewRunnableMethod<RefPtr<EncoderListener>>(
           "mozilla::VideoTrackEncoder::RegisterListener",
           mVideoEncoder, &VideoTrackEncoder::RegisterListener,
           mEncoderListener));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 }
 
 MediaEncoder::~MediaEncoder()
 {
   MOZ_ASSERT(mListeners.IsEmpty());
 }
 
@@ -491,16 +508,17 @@ MediaEncoder::Suspend(TimeStamp aTime)
         ae->Suspend(aTime);
       }
       if (ve) {
         ve->Suspend(aTime);
       }
       return NS_OK;
     }));
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 void
 MediaEncoder::Resume(TimeStamp aTime)
 {
   auto& ae = mAudioEncoder;
   auto& ve = mVideoEncoder;
   nsresult rv =
@@ -509,16 +527,17 @@ MediaEncoder::Resume(TimeStamp aTime)
         ae->Resume(aTime);
       }
       if (ve) {
         ve->Resume(aTime);
       }
       return NS_OK;
     }));
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 void
 MediaEncoder::ConnectAudioNode(AudioNode* aNode, uint32_t aOutput)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (mAudioNode) {
@@ -878,16 +897,17 @@ MediaEncoder::Shutdown()
   for (auto& l : listeners) {
     // We dispatch here since this method is typically called from
     // a DataAvailable() handler.
     nsresult rv =
       mEncoderThread->Dispatch(
         NewRunnableMethod("mozilla::MediaEncoderListener::Shutdown",
                           l, &MediaEncoderListener::Shutdown));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 }
 
 nsresult
 MediaEncoder::WriteEncodedDataToMuxer(TrackEncoder *aTrackEncoder)
 {
   AUTO_PROFILER_LABEL("MediaEncoder::WriteEncodedDataToMuxer", OTHER);
 
@@ -969,16 +989,17 @@ MediaEncoder::Cancel()
       }
       if (self->mVideoEncoder) {
         self->mVideoEncoder->Cancel();
       }
       self->Shutdown();
       return NS_OK;
     }));
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 bool
 MediaEncoder::HasError()
 {
   MOZ_ASSERT(mEncoderThread->IsCurrentThreadIn());
   return mError;
 }
--- a/dom/media/hls/HLSDemuxer.cpp
+++ b/dom/media/hls/HLSDemuxer.cpp
@@ -91,16 +91,17 @@ public:
        "HLSDemuxer::HLSDemuxerCallbacksSupport::OnInitialized",
        [=] () {
          MutexAutoLock lock(self->mMutex);
          if (self->mDemuxer) {
            self->mDemuxer->OnInitialized(aHasAudio, aHasVideo);
          }
        }));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 
   void OnError(int aErrorCode)
   {
     HLS_DEBUG("HLSDemuxerCallbacksSupport", "Got error(%d) from java side", aErrorCode);
     MutexAutoLock lock(mMutex);
     if (!mDemuxer) { return; }
     RefPtr<HLSDemuxerCallbacksSupport> self = this;
@@ -109,16 +110,17 @@ public:
        "HLSDemuxer::HLSDemuxerCallbacksSupport::OnError",
        [=] () {
          MutexAutoLock lock(self->mMutex);
          if (self->mDemuxer) {
            self->mDemuxer->OnError(aErrorCode);
          }
        }));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 
   void Detach()
   {
     MutexAutoLock lock(mMutex);
     mDemuxer = nullptr;
   }
 
@@ -637,15 +639,16 @@ HLSTrackDemuxer::BreakCycles()
   RefPtr<HLSTrackDemuxer> self = this;
   nsCOMPtr<nsIRunnable> task =
     NS_NewRunnableFunction("HLSTrackDemuxer::BreakCycles",
     [self]() {
       self->mParent = nullptr;
     } );
   nsresult rv = mParent->GetTaskQueue()->Dispatch(task.forget());
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 HLSTrackDemuxer::~HLSTrackDemuxer()
 {
 }
 
 } // namespace mozilla
--- a/dom/media/mediasource/MediaSourceDemuxer.cpp
+++ b/dom/media/mediasource/MediaSourceDemuxer.cpp
@@ -62,32 +62,34 @@ MediaSourceDemuxer::AddSizeOfResources(
     "MediaSourceDemuxer::AddSizeOfResources", [self, sizes]() {
       for (const RefPtr<TrackBuffersManager>& manager : self->mSourceBuffers) {
         manager->AddSizeOfResources(sizes);
       }
     });
 
   nsresult rv = GetTaskQueue()->Dispatch(task.forget());
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 void MediaSourceDemuxer::NotifyInitDataArrived()
 {
   RefPtr<MediaSourceDemuxer> self = this;
   nsCOMPtr<nsIRunnable> task = NS_NewRunnableFunction(
     "MediaSourceDemuxer::NotifyInitDataArrived", [self]() {
       if (self->mInitPromise.IsEmpty()) {
         return;
       }
       if (self->ScanSourceBuffersForContent()) {
         self->mInitPromise.ResolveIfExists(NS_OK, __func__);
       }
     });
   nsresult rv = GetTaskQueue()->Dispatch(task.forget());
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 bool
 MediaSourceDemuxer::ScanSourceBuffersForContent()
 {
   MOZ_ASSERT(OnTaskQueue());
 
   if (mSourceBuffers.IsEmpty()) {
@@ -171,16 +173,17 @@ MediaSourceDemuxer::AttachSourceBuffer(
 {
   nsCOMPtr<nsIRunnable> task = NewRunnableMethod<RefPtr<TrackBuffersManager>&&>(
     "MediaSourceDemuxer::DoAttachSourceBuffer",
     this,
     &MediaSourceDemuxer::DoAttachSourceBuffer,
     aSourceBuffer);
   nsresult rv = GetTaskQueue()->Dispatch(task.forget());
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 void
 MediaSourceDemuxer::DoAttachSourceBuffer(
   RefPtr<mozilla::TrackBuffersManager>&& aSourceBuffer)
 {
   MOZ_ASSERT(OnTaskQueue());
   mSourceBuffers.AppendElement(Move(aSourceBuffer));
@@ -193,16 +196,17 @@ MediaSourceDemuxer::DetachSourceBuffer(
 {
   nsCOMPtr<nsIRunnable> task = NewRunnableMethod<RefPtr<TrackBuffersManager>&&>(
     "MediaSourceDemuxer::DoDetachSourceBuffer",
     this,
     &MediaSourceDemuxer::DoDetachSourceBuffer,
     aSourceBuffer);
   nsresult rv = GetTaskQueue()->Dispatch(task.forget());
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 void
 MediaSourceDemuxer::DoDetachSourceBuffer(
   RefPtr<TrackBuffersManager>&& aSourceBuffer)
 {
   MOZ_ASSERT(OnTaskQueue());
   mSourceBuffers.RemoveElementsBy(
@@ -367,16 +371,17 @@ MediaSourceTrackDemuxer::Reset()
       {
         MonitorAutoLock mon(self->mMonitor);
         self->mNextRandomAccessPoint = self->mManager->GetNextRandomAccessPoint(
           self->mType, MediaSourceDemuxer::EOS_FUZZ);
       }
     });
   nsresult rv = mParent->GetTaskQueue()->Dispatch(task.forget());
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 nsresult
 MediaSourceTrackDemuxer::GetNextRandomAccessPoint(TimeUnit* aTime)
 {
   MonitorAutoLock mon(mMonitor);
   *aTime = mNextRandomAccessPoint;
   return NS_OK;
@@ -408,16 +413,17 @@ MediaSourceTrackDemuxer::BreakCycles()
   RefPtr<MediaSourceTrackDemuxer> self = this;
   nsCOMPtr<nsIRunnable> task =
     NS_NewRunnableFunction("MediaSourceTrackDemuxer::BreakCycles", [self]() {
       self->DetachManager();
       self->mParent = nullptr;
     });
   nsresult rv = mParent->GetTaskQueue()->Dispatch(task.forget());
   MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+  Unused << rv;
 }
 
 RefPtr<MediaSourceTrackDemuxer::SeekPromise>
 MediaSourceTrackDemuxer::DoSeek(const TimeUnit& aTime)
 {
   if (!mManager) {
     return SeekPromise::CreateAndReject(
       MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
--- a/dom/media/mediasource/TrackBuffersManager.cpp
+++ b/dom/media/mediasource/TrackBuffersManager.cpp
@@ -187,16 +187,17 @@ TrackBuffersManager::QueueTask(SourceBuf
   if (!taskQueue->IsCurrentThreadIn()) {
     nsresult rv =
         taskQueue->Dispatch(NewRunnableMethod<RefPtr<SourceBufferTask>>(
         "TrackBuffersManager::QueueTask",
         this,
         &TrackBuffersManager::QueueTask,
         aTask));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
     return;
   }
   mQueue.Push(aTask);
   ProcessTasks();
 }
 
 void
 TrackBuffersManager::ProcessTasks()
--- a/dom/media/platforms/android/RemoteDataDecoder.cpp
+++ b/dom/media/platforms/android/RemoteDataDecoder.cpp
@@ -644,16 +644,17 @@ RemoteDataDecoder::UpdateInputStatus(int
     nsresult rv =
       mTaskQueue->Dispatch(
         NewRunnableMethod<int64_t, bool>("RemoteDataDecoder::UpdateInputStatus",
                                          this,
                                          &RemoteDataDecoder::UpdateInputStatus,
                                          aTimestamp,
                                          aProcessed));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
     return;
   }
   AssertOnTaskQueue();
   if (mShutdown) {
     return;
   }
 
   if (!aProcessed) {
@@ -674,16 +675,17 @@ RemoteDataDecoder::UpdateOutputStatus(Re
   if (!mTaskQueue->IsCurrentThreadIn()) {
     nsresult rv =
       mTaskQueue->Dispatch(
         NewRunnableMethod<const RefPtr<MediaData>>("RemoteDataDecoder::UpdateOutputStatus",
                                                    this,
                                                    &RemoteDataDecoder::UpdateOutputStatus,
                                                    Move(aSample)));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
     return;
   }
   AssertOnTaskQueue();
   if (mShutdown) {
     return;
   }
   if (IsUsefulData(aSample)) {
     mDecodedData.AppendElement(Move(aSample));
@@ -712,16 +714,17 @@ void
 RemoteDataDecoder::DrainComplete()
 {
   if (!mTaskQueue->IsCurrentThreadIn()) {
     nsresult rv =
       mTaskQueue->Dispatch(
         NewRunnableMethod("RemoteDataDecoder::DrainComplete",
                           this, &RemoteDataDecoder::DrainComplete));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
     return;
   }
   AssertOnTaskQueue();
   if (mShutdown) {
     return;
   }
   mDrainStatus = DrainStatus::DRAINED;
   ReturnDecodedData();
@@ -734,16 +737,17 @@ RemoteDataDecoder::Error(const MediaResu
 {
   if (!mTaskQueue->IsCurrentThreadIn()) {
     nsresult rv =
       mTaskQueue->Dispatch(
         NewRunnableMethod<MediaResult>("RemoteDataDecoder::Error",
                                        this, &RemoteDataDecoder::Error,
                                        aError));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
     return;
   }
   AssertOnTaskQueue();
   if (mShutdown) {
     return;
   }
   mDecodePromise.RejectIfExists(aError, __func__);
   mDrainPromise.RejectIfExists(aError, __func__);
--- a/dom/media/platforms/omx/OmxDataDecoder.cpp
+++ b/dom/media/platforms/omx/OmxDataDecoder.cpp
@@ -396,16 +396,17 @@ OmxDataDecoder::EmptyBufferDone(BufferDa
         }
 
         mDecodePromise.ResolveIfExists(mDecodedData, __func__);
         mDecodedData.Clear();
       });
 
     nsresult rv = mOmxTaskQueue->Dispatch(r.forget());
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 }
 
 void
 OmxDataDecoder::EmptyBufferFailure(OmxBufferFailureHolder aFailureHolder)
 {
   NotifyError(aFailureHolder.mError, __func__);
 }
--- a/dom/media/webaudio/MediaBufferDecoder.cpp
+++ b/dom/media/webaudio/MediaBufferDecoder.cpp
@@ -507,16 +507,17 @@ AsyncDecodeWebAudio(const char* aContent
   } else {
     // If we did this without a temporary:
     //   task->Reader()->OwnerThread()->Dispatch(task.forget())
     // we might evaluate the task.forget() before calling Reader(). Enforce
     // a non-crashy order-of-operations.
     TaskQueue* taskQueue = task->Reader()->OwnerThread();
     nsresult rv = taskQueue->Dispatch(task.forget());
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 }
 
 WebAudioDecodeJob::WebAudioDecodeJob(AudioContext* aContext,
                                      Promise* aPromise,
                                      DecodeSuccessCallback* aSuccessCallback,
                                      DecodeErrorCallback* aFailureCallback)
   : mContext(aContext)
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -210,16 +210,17 @@ public:
       NewRunnableMethod<StoreRefPtrPassByPtr<Image>, bool>(
         "VideoFrameConverter::ProcessVideoFrame",
         this,
         &VideoFrameConverter::ProcessVideoFrame,
         aChunk.mFrame.GetImage(),
         forceBlack);
     nsresult rv = mTaskQueue->Dispatch(runnable.forget());
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+    Unused << rv;
   }
 
   void AddListener(VideoConverterListener* aListener)
   {
     MutexAutoLock lock(mMutex);
 
     MOZ_ASSERT(!mListeners.Contains(aListener));
     mListeners.AppendElement(aListener);