From 567bfc91f0fb54735177721ca1f16709b7b336a7 Mon Sep 17 00:00:00 2001 From: Andreas Pehrson Date: Fri, 21 Dec 2018 20:05:05 +0000 Subject: [PATCH] Bug 1513973 - Remove mutable keyword from MediaEngineWebRTCMicrophoneSource runnables. r=jib Differential Revision: https://phabricator.services.mozilla.com/D15220 --HG-- extra : moz-landing-system : lando --- dom/media/webrtc/MediaEngineWebRTCAudio.cpp | 37 ++++++++++----------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp index c4165a9cb543..1253cb3abf4b 100644 --- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp +++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp @@ -203,9 +203,8 @@ void MediaEngineWebRTCMicrophoneSource::UpdateAECSettings( RefPtr that = this; RefPtr gripGraph = mStream->GraphImpl(); - NS_DispatchToMainThread( - media::NewRunnableFrom([that, graph = std::move(gripGraph), aEnable, - aUseAecMobile, aLevel]() mutable { + NS_DispatchToMainThread(media::NewRunnableFrom( + [that, graph = std::move(gripGraph), aEnable, aUseAecMobile, aLevel]() { class Message : public ControlMessage { public: Message(AudioInputProcessing* aInputProcessing, bool aEnable, @@ -243,7 +242,7 @@ void MediaEngineWebRTCMicrophoneSource::UpdateAGCSettings( RefPtr that = this; RefPtr gripGraph = mStream->GraphImpl(); NS_DispatchToMainThread(media::NewRunnableFrom( - [that, graph = std::move(gripGraph), aEnable, aMode]() mutable { + [that, graph = std::move(gripGraph), aEnable, aMode]() { class Message : public ControlMessage { public: Message(AudioInputProcessing* aInputProcessing, bool aEnable, @@ -279,7 +278,7 @@ void MediaEngineWebRTCMicrophoneSource::UpdateNSSettings( RefPtr that = this; RefPtr gripGraph = mStream->GraphImpl(); NS_DispatchToMainThread(media::NewRunnableFrom( - [that, graph = std::move(gripGraph), aEnable, aLevel]() mutable { + [that, graph = std::move(gripGraph), aEnable, aLevel]() { class Message : public ControlMessage { public: Message(AudioInputProcessing* aInputProcessing, bool aEnable, @@ -314,9 +313,8 @@ void MediaEngineWebRTCMicrophoneSource::UpdateAPMExtraOptions( RefPtr that = this; RefPtr gripGraph = mStream->GraphImpl(); - NS_DispatchToMainThread( - media::NewRunnableFrom([that, graph = std::move(gripGraph), - aExtendedFilter, aDelayAgnostic]() mutable { + NS_DispatchToMainThread(media::NewRunnableFrom( + [that, graph = std::move(gripGraph), aExtendedFilter, aDelayAgnostic]() { class Message : public ControlMessage { public: Message(AudioInputProcessing* aInputProcessing, bool aExtendedFilter, @@ -370,7 +368,7 @@ void MediaEngineWebRTCMicrophoneSource::ApplySettings( RefPtr that = this; RefPtr graphImpl = mStream->GraphImpl(); NS_DispatchToMainThread(media::NewRunnableFrom( - [that, graph = std::move(graphImpl), prefs = aPrefs]() mutable { + [that, graph = std::move(graphImpl), prefs = aPrefs]() { that->mSettings->mEchoCancellation.Value() = prefs.mAecOn; that->mSettings->mAutoGainControl.Value() = prefs.mAgcOn; that->mSettings->mNoiseSuppression.Value() = prefs.mNoiseOn; @@ -428,14 +426,13 @@ nsresult MediaEngineWebRTCMicrophoneSource::Allocate( } RefPtr that = this; - NS_DispatchToMainThread( - media::NewRunnableFrom([that, prefs = outputPrefs]() mutable { - that->mSettings->mEchoCancellation.Value() = prefs.mAecOn; - that->mSettings->mAutoGainControl.Value() = prefs.mAgcOn; - that->mSettings->mNoiseSuppression.Value() = prefs.mNoiseOn; - that->mSettings->mChannelCount.Value() = prefs.mChannels; - return NS_OK; - })); + NS_DispatchToMainThread(media::NewRunnableFrom([that, prefs = outputPrefs]() { + that->mSettings->mEchoCancellation.Value() = prefs.mAecOn; + that->mSettings->mAutoGainControl.Value() = prefs.mAgcOn; + that->mSettings->mNoiseSuppression.Value() = prefs.mNoiseOn; + that->mSettings->mChannelCount.Value() = prefs.mChannels; + return NS_OK; + })); mCurrentPrefs = outputPrefs; @@ -473,7 +470,7 @@ nsresult MediaEngineWebRTCMicrophoneSource::Deallocate( NS_DispatchToMainThread(media::NewRunnableFrom( [stream = std::move(sourceStream), audioInputProcessing = std::move(inputProcessing), - trackID = mTrackID]() mutable { + trackID = mTrackID]() { if (stream->IsDestroyed()) { // This stream has already been destroyed on main thread by its // DOMMediaStream. No cleanup left to do. @@ -576,7 +573,7 @@ nsresult MediaEngineWebRTCMicrophoneSource::Start( RefPtr gripGraph = mStream->GraphImpl(); NS_DispatchToMainThread( media::NewRunnableFrom([that, graph = std::move(gripGraph), deviceID, - stream = mStream, track = mTrackID]() mutable { + stream = mStream, track = mTrackID]() { if (graph) { graph->AppendMessage(MakeUnique( that->mInputProcessing, StartStopMessage::Start)); @@ -612,7 +609,7 @@ nsresult MediaEngineWebRTCMicrophoneSource::Stop( RefPtr gripGraph = mStream->GraphImpl(); NS_DispatchToMainThread( media::NewRunnableFrom([that, graph = std::move(gripGraph), - stream = mStream, track = mTrackID]() mutable { + stream = mStream, track = mTrackID]() { if (graph) { graph->AppendMessage(MakeUnique( that->mInputProcessing, StartStopMessage::Stop));