Bug 1513973 - Remove mutable keyword from MediaEngineWebRTCMicrophoneSource runnables. r=jib, a=RyanVM
authorAndreas Pehrson <apehrson@mozilla.com>
Fri, 04 Jan 2019 06:40:05 +0000
changeset 506550 61fc844e1f4848cdc47c8056f8d9e76795cecaca
parent 506549 7fcc850b0e9ee55583626e9a40ea830bfdb72307
child 506551 dac16eb67fd6c9fc34d50269a064c8c9a9dbca76
push id10457
push userryanvm@gmail.com
push dateMon, 07 Jan 2019 15:23:57 +0000
treeherdermozilla-beta@dac16eb67fd6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib, RyanVM
bugs1513973
milestone65.0
Bug 1513973 - Remove mutable keyword from MediaEngineWebRTCMicrophoneSource runnables. r=jib, a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D15220
dom/media/webrtc/MediaEngineWebRTCAudio.cpp
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -201,19 +201,18 @@ void MediaEngineWebRTCMicrophoneSource::
 
 void MediaEngineWebRTCMicrophoneSource::UpdateAECSettings(
     bool aEnable, bool aUseAecMobile,
     EchoCancellation::SuppressionLevel aLevel) {
   AssertIsOnOwningThread();
 
   RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
   RefPtr<MediaStreamGraphImpl> 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,
                   bool aUseAecMobile, EchoCancellation::SuppressionLevel aLevel)
               : ControlMessage(nullptr),
                 mInputProcessing(aInputProcessing),
                 mEnable(aEnable),
                 mUseAecMobile(aUseAecMobile),
@@ -241,17 +240,17 @@ void MediaEngineWebRTCMicrophoneSource::
 
 void MediaEngineWebRTCMicrophoneSource::UpdateAGCSettings(
     bool aEnable, GainControl::Mode aMode) {
   AssertIsOnOwningThread();
 
   RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
   RefPtr<MediaStreamGraphImpl> 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,
                   GainControl::Mode aMode)
               : ControlMessage(nullptr),
                 mInputProcessing(aInputProcessing),
                 mEnable(aEnable),
                 mMode(aMode) {}
@@ -277,17 +276,17 @@ void MediaEngineWebRTCMicrophoneSource::
 
 void MediaEngineWebRTCMicrophoneSource::UpdateNSSettings(
     bool aEnable, webrtc::NoiseSuppression::Level aLevel) {
   AssertIsOnOwningThread();
 
   RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
   RefPtr<MediaStreamGraphImpl> 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,
                   webrtc::NoiseSuppression::Level aLevel)
               : ControlMessage(nullptr),
                 mInputProcessing(aInputProcessing),
                 mEnable(aEnable),
                 mLevel(aLevel) {}
@@ -312,19 +311,18 @@ void MediaEngineWebRTCMicrophoneSource::
 }
 
 void MediaEngineWebRTCMicrophoneSource::UpdateAPMExtraOptions(
     bool aExtendedFilter, bool aDelayAgnostic) {
   AssertIsOnOwningThread();
 
   RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
   RefPtr<MediaStreamGraphImpl> 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,
                   bool aDelayAgnostic)
               : ControlMessage(nullptr),
                 mInputProcessing(aInputProcessing),
                 mExtendedFilter(aExtendedFilter),
                 mDelayAgnostic(aDelayAgnostic) {}
@@ -368,17 +366,17 @@ void MediaEngineWebRTCMicrophoneSource::
         static_cast<webrtc::EchoCancellation::SuppressionLevel>(aPrefs.mAec));
 
     UpdateAPMExtraOptions(mExtendedFilter, mDelayAgnostic);
   }
 
   RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
   RefPtr<MediaStreamGraphImpl> 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;
         that->mSettings->mChannelCount.Value() = prefs.mChannels;
 
         class Message : public ControlMessage {
          public:
           Message(AudioInputProcessing* aInputProcessing, bool aPassThrough,
@@ -426,24 +424,23 @@ nsresult MediaEngineWebRTCMicrophoneSour
   MediaEnginePrefs outputPrefs;
   nsresult rv =
       EvaluateSettings(normalized, aPrefs, &outputPrefs, aOutBadConstraint);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   RefPtr<MediaEngineWebRTCMicrophoneSource> 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;
 
   return rv;
 }
 
 nsresult MediaEngineWebRTCMicrophoneSource::Deallocate(
     const RefPtr<const AllocationHandle>&) {
@@ -471,17 +468,17 @@ nsresult MediaEngineWebRTCMicrophoneSour
   };
 
   if (mStream && IsTrackIDExplicit(mTrackID)) {
     RefPtr<MediaStream> sourceStream = mStream;
     RefPtr<AudioInputProcessing> inputProcessing = mInputProcessing;
     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.
             return NS_OK;
           }
           MOZ_ASSERT(stream->GraphImpl());
           stream->GraphImpl()->AppendMessage(MakeUnique<EndTrackMessage>(
               stream, audioInputProcessing, trackID));
@@ -576,17 +573,17 @@ nsresult MediaEngineWebRTCMicrophoneSour
 
   mInputProcessing = new AudioInputProcessing(mDeviceMaxChannelCount, mStream,
                                               mTrackID, mPrincipal);
 
   RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
   RefPtr<MediaStreamGraphImpl> 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<StartStopMessage>(
               that->mInputProcessing, StartStopMessage::Start));
         }
 
         stream->OpenAudioInput(deviceID, that->mInputProcessing);
         stream->SetPullingEnabled(track, true);
 
@@ -613,17 +610,17 @@ nsresult MediaEngineWebRTCMicrophoneSour
     // Already stopped - this is allowed
     return NS_OK;
   }
 
   RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
   RefPtr<MediaStreamGraphImpl> 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<StartStopMessage>(
               that->mInputProcessing, StartStopMessage::Stop));
         }
 
         CubebUtils::AudioDeviceID deviceID = that->mDeviceInfo->DeviceID();
         Maybe<CubebUtils::AudioDeviceID> id = Some(deviceID);
         stream->CloseAudioInput(id, that->mInputProcessing);