Bug 1641161 - Bug 1285290 alias move() to std::move() in MediaTrackGraph.cpp and AudioContext.cpp r=padenot
authorKarl Tomlinson <karlt+@karlt.net>
Wed, 27 May 2020 08:36:18 +0000
changeset 532351 7bae1eadb123675a0b56815f8fe20002fc8f39cb
parent 532350 c17adfdc55cd8725c7187599cf93d439e1b7d764
child 532352 806573d7d69a90ea111a3b235f5fa1f45bd70b4f
push id37454
push userccoroiu@mozilla.com
push dateWed, 27 May 2020 16:14:31 +0000
treeherdermozilla-central@a1dd9afbfdf5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1641161, 1285290
milestone78.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 1641161 - Bug 1285290 alias move() to std::move() in MediaTrackGraph.cpp and AudioContext.cpp r=padenot Depends on D76799 Differential Revision: https://phabricator.services.mozilla.com/D76800
dom/media/MediaTrackGraph.cpp
dom/media/webaudio/AudioContext.cpp
--- a/dom/media/MediaTrackGraph.cpp
+++ b/dom/media/MediaTrackGraph.cpp
@@ -35,16 +35,17 @@
 #include "GraphRunner.h"
 #include "Tracing.h"
 #include "UnderrunHandler.h"
 #include "mozilla/CycleCollectedJSRuntime.h"
 
 #include "webaudio/blink/DenormalDisabler.h"
 #include "webaudio/blink/HRTFDatabaseLoader.h"
 
+using std::move;
 using namespace mozilla::layers;
 using namespace mozilla::dom;
 using namespace mozilla::gfx;
 using namespace mozilla::media;
 
 namespace mozilla {
 
 LazyLogModule gMediaTrackGraphLog("MediaTrackGraph");
@@ -925,17 +926,17 @@ void MediaTrackGraphImpl::DeviceChanged(
   MOZ_ASSERT(NS_IsMainThread());
   mAudioOutputLatency = 0.0;
 
   // Dispatch to the bg thread to do the (potentially expensive) query of the
   // maximum channel count, and then dispatch back to the main thread, then to
   // the graph, with the new info.
   RefPtr<MediaTrackGraphImpl> self = this;
   NS_DispatchBackgroundTask(NS_NewRunnableFunction(
-      "MaxChannelCountUpdateOnBgThread", [self{std::move(self)}]() {
+      "MaxChannelCountUpdateOnBgThread", [self{move(self)}]() {
         uint32_t maxChannelCount = CubebUtils::MaxNumberOfChannels();
         self->Dispatch(NS_NewRunnableFunction(
             "MaxChannelCountUpdateToMainThread",
             [self{self}, maxChannelCount]() {
               class MessageToGraph : public ControlMessage {
                public:
                 explicit MessageToGraph(MediaTrackGraph* aGraph,
                                         uint32_t aMaxChannelCount)
@@ -1042,17 +1043,17 @@ void MediaTrackGraphImpl::PrepareUpdates
       // tracks that are removed from the graph.
       MOZ_ASSERT(!track || track->GraphImpl() == this);
       if (!track || track->MainThreadNeedsUpdates()) {
         // Discard this update as it has either been cleared when the track
         // was destroyed or there will be a newer update below.
         continue;
       }
       if (keptUpdateCount != i) {
-        mTrackUpdates[keptUpdateCount] = std::move(mTrackUpdates[i]);
+        mTrackUpdates[keptUpdateCount] = move(mTrackUpdates[i]);
         MOZ_ASSERT(!mTrackUpdates[i].mTrack);
       }
       ++keptUpdateCount;
     }
     mTrackUpdates.TruncateLength(keptUpdateCount);
 
     mTrackUpdates.SetCapacity(mTrackUpdates.Length() + mTracks.Length() +
                               mSuspendedTracks.Length());
@@ -1065,17 +1066,17 @@ void MediaTrackGraphImpl::PrepareUpdates
       // No blocking to worry about here, since we've passed
       // UpdateCurrentTimeForTracks.
       update->mNextMainThreadCurrentTime =
           track->GraphTimeToTrackTime(mProcessedTime);
       update->mNextMainThreadEnded = track->mNotifiedEnded;
     }
     mNextMainThreadGraphTime = mProcessedTime;
     if (!mPendingUpdateRunnables.IsEmpty()) {
-      mUpdateRunnables.AppendElements(std::move(mPendingUpdateRunnables));
+      mUpdateRunnables.AppendElements(move(mPendingUpdateRunnables));
     }
   }
 
   // If this is the final update, then a stable state event will soon be
   // posted just before this thread finishes, and so there is no need to also
   // post here.
   if (!aFinalUpdate &&
       // Don't send the message to the main thread if it's not going to have
@@ -1134,17 +1135,17 @@ void MediaTrackGraphImpl::RunMessageAfte
   MOZ_ASSERT(OnGraphThread());
 
   if (mFrontMessageQueue.IsEmpty()) {
     mFrontMessageQueue.AppendElement();
   }
 
   // Only one block is used for messages from the graph thread.
   MOZ_ASSERT(mFrontMessageQueue.Length() == 1);
-  mFrontMessageQueue[0].mMessages.AppendElement(std::move(aMessage));
+  mFrontMessageQueue[0].mMessages.AppendElement(move(aMessage));
 }
 
 void MediaTrackGraphImpl::RunMessagesInQueue() {
   MOZ_ASSERT(OnGraphThread());
   // Calculate independent action times for each batch of messages (each
   // batch corresponding to an event loop task). This isolates the performance
   // of different scripts to some extent.
   for (uint32_t i = 0; i < mFrontMessageQueue.Length(); ++i) {
@@ -1427,17 +1428,17 @@ auto MediaTrackGraphImpl::OneIterationIm
       SwitchAtNextIteration(nullptr);
     }
     return IterationResult::CreateStop(
         NewRunnableMethod("MediaTrackGraphImpl::SignalMainThreadCleanup", this,
                           &MediaTrackGraphImpl::SignalMainThreadCleanup));
   }
 
   if (Switching()) {
-    RefPtr<GraphDriver> nextDriver = std::move(mNextDriver);
+    RefPtr<GraphDriver> nextDriver = move(mNextDriver);
     return IterationResult::CreateSwitchDriver(
         nextDriver, NewRunnableMethod<StoreRefPtrPassByPtr<GraphDriver>>(
                         "MediaTrackGraphImpl::SetCurrentDriver", this,
                         &MediaTrackGraphImpl::SetCurrentDriver, nextDriver));
   }
 
   return IterationResult::CreateStillProcessing();
 }
@@ -1764,18 +1765,17 @@ void MediaTrackGraphImpl::RunInStableSta
     }
 
     if (LifecycleStateRef() == LIFECYCLE_WAITING_FOR_MAIN_THREAD_CLEANUP &&
         mForceShutDownReceived) {
       // Defer calls to RunDuringShutdown() to happen while mMonitor is not
       // held.
       for (uint32_t i = 0; i < mBackMessageQueue.Length(); ++i) {
         MessageBlock& mb = mBackMessageQueue[i];
-        controlMessagesToRunDuringShutdown.AppendElements(
-            std::move(mb.mMessages));
+        controlMessagesToRunDuringShutdown.AppendElements(move(mb.mMessages));
       }
       mBackMessageQueue.Clear();
       MOZ_ASSERT(mCurrentTaskMessageQueue.IsEmpty());
       // Stop MediaTrackGraph threads.
       LifecycleStateRef() = LIFECYCLE_WAITING_FOR_THREAD_SHUTDOWN;
       nsCOMPtr<nsIRunnable> event = new MediaTrackGraphShutDownRunnable(this);
       mAbstractMainThread->Dispatch(event.forget());
     }
@@ -1861,22 +1861,22 @@ void MediaTrackGraphImpl::AppendMessage(
 #endif
     if (IsEmpty() &&
         LifecycleStateRef() >= LIFECYCLE_WAITING_FOR_TRACK_DESTRUCTION) {
       Destroy();
     }
     return;
   }
 
-  mCurrentTaskMessageQueue.AppendElement(std::move(aMessage));
+  mCurrentTaskMessageQueue.AppendElement(move(aMessage));
   EnsureRunInStableState();
 }
 
 void MediaTrackGraphImpl::Dispatch(already_AddRefed<nsIRunnable>&& aRunnable) {
-  mAbstractMainThread->Dispatch(std::move(aRunnable));
+  mAbstractMainThread->Dispatch(move(aRunnable));
 }
 
 MediaTrack::MediaTrack(TrackRate aSampleRate, MediaSegment::Type aType,
                        MediaSegment* aSegment)
     : mSampleRate(aSampleRate),
       mType(aType),
       mSegment(aSegment),
       mStartTime(0),
@@ -2141,17 +2141,17 @@ void MediaTrack::Resume() {
     return;
   }
   GraphImpl()->AppendMessage(MakeUnique<Message>(this));
 }
 
 void MediaTrack::AddListenerImpl(
     already_AddRefed<MediaTrackListener> aListener) {
   RefPtr<MediaTrackListener> l(aListener);
-  mTrackListeners.AppendElement(std::move(l));
+  mTrackListeners.AppendElement(move(l));
 
   PrincipalHandle lastPrincipalHandle = mSegment->GetLastPrincipalHandle();
   mTrackListeners.LastElement()->NotifyPrincipalHandleChanged(
       Graph(), lastPrincipalHandle);
   if (mNotifiedEnded) {
     mTrackListeners.LastElement()->NotifyEnded(Graph());
   }
   if (mDisabledMode == DisabledTrackMode::SILENCE_BLACK) {
@@ -2197,17 +2197,17 @@ RefPtr<GenericPromise> MediaTrack::Remov
       Run();
     }
     RefPtr<MediaTrackListener> mListener;
     MozPromiseHolder<GenericPromise> mRemovedPromise;
   };
 
   UniquePtr<Message> message = MakeUnique<Message>(this, aListener);
   RefPtr<GenericPromise> p = message->mRemovedPromise.Ensure(__func__);
-  GraphImpl()->AppendMessage(std::move(message));
+  GraphImpl()->AppendMessage(move(message));
   return p;
 }
 
 void MediaTrack::AddDirectListenerImpl(
     already_AddRefed<DirectMediaTrackListener> aListener) {
   // Base implementation, for tracks that don't support direct track listeners.
   RefPtr<DirectMediaTrackListener> listener = aListener;
   listener->NotifyDirectListenerInstalled(
@@ -3207,34 +3207,34 @@ void MediaTrackGraphImpl::CollectSizesFo
         already_AddRefed<nsIHandleReportCallback> aHandleReport,
         already_AddRefed<nsISupports> aHandlerData)
         : mozilla::Runnable("FinishCollectRunnable"),
           mHandleReport(aHandleReport),
           mHandlerData(aHandlerData) {}
 
     NS_IMETHOD Run() override {
       MediaTrackGraphImpl::FinishCollectReports(mHandleReport, mHandlerData,
-                                                std::move(mAudioTrackSizes));
+                                                move(mAudioTrackSizes));
       return NS_OK;
     }
 
     nsTArray<AudioNodeSizes> mAudioTrackSizes;
 
    private:
     ~FinishCollectRunnable() = default;
 
     // Avoiding nsCOMPtr because NSCAP_ASSERT_NO_QUERY_NEEDED in its
     // constructor modifies the ref-count, which cannot be done off main
     // thread.
     RefPtr<nsIHandleReportCallback> mHandleReport;
     RefPtr<nsISupports> mHandlerData;
   };
 
-  RefPtr<FinishCollectRunnable> runnable = new FinishCollectRunnable(
-      std::move(aHandleReport), std::move(aHandlerData));
+  RefPtr<FinishCollectRunnable> runnable =
+      new FinishCollectRunnable(move(aHandleReport), move(aHandlerData));
 
   auto audioTrackSizes = &runnable->mAudioTrackSizes;
 
   for (MediaTrack* t : AllTracks()) {
     AudioNodeTrack* track = t->AsAudioNodeTrack();
     if (track) {
       AudioNodeSizes* usage = audioTrackSizes->AppendElement();
       track->SizeOfAudioNodesIncludingThis(MallocSizeOf, *usage);
@@ -3346,29 +3346,27 @@ void MediaTrackGraphImpl::RemoveTrack(Me
 }
 
 auto MediaTrackGraph::NotifyWhenGraphStarted(MediaTrack* aTrack)
     -> RefPtr<GraphStartedPromise> {
   MOZ_ASSERT(NS_IsMainThread());
   MozPromiseHolder<GraphStartedPromise> h;
   RefPtr<GraphStartedPromise> p = h.Ensure(__func__);
   aTrack->GraphImpl()->NotifyWhenGraphStarted(
-      aTrack, std::move(h),
-      MediaTrackGraphImpl::ProcessingThread::FALLBACK_THREAD);
+      aTrack, move(h), MediaTrackGraphImpl::ProcessingThread::FALLBACK_THREAD);
   return p;
 }
 
 auto MediaTrackGraph::NotifyWhenDeviceStarted(MediaTrack* aTrack)
     -> RefPtr<GraphStartedPromise> {
   MOZ_ASSERT(NS_IsMainThread());
   MozPromiseHolder<GraphStartedPromise> h;
   RefPtr<GraphStartedPromise> p = h.Ensure(__func__);
   aTrack->GraphImpl()->NotifyWhenGraphStarted(
-      aTrack, std::move(h),
-      MediaTrackGraphImpl::ProcessingThread::AUDIO_THREAD);
+      aTrack, move(h), MediaTrackGraphImpl::ProcessingThread::AUDIO_THREAD);
   return p;
 }
 
 void MediaTrackGraphImpl::NotifyWhenGraphStarted(
     RefPtr<MediaTrack> aTrack, MozPromiseHolder<GraphStartedPromise>&& aHolder,
     ProcessingThread aProcessingThread) {
   class GraphStartedNotificationControlMessage : public ControlMessage {
     RefPtr<MediaTrack> mMediaTrack;
@@ -3376,59 +3374,59 @@ void MediaTrackGraphImpl::NotifyWhenGrap
     ProcessingThread mProcessingThread = ProcessingThread::FALLBACK_THREAD;
 
    public:
     GraphStartedNotificationControlMessage(
         RefPtr<MediaTrack> aTrack,
         MozPromiseHolder<GraphStartedPromise>&& aHolder,
         ProcessingThread aProcessingThread)
         : ControlMessage(nullptr),
-          mMediaTrack(std::move(aTrack)),
-          mHolder(std::move(aHolder)),
+          mMediaTrack(move(aTrack)),
+          mHolder(move(aHolder)),
           mProcessingThread(aProcessingThread) {}
     void Run() override {
       // This runs on the graph thread, so when this runs, and the current
       // driver is an AudioCallbackDriver, we know the audio hardware is
       // started. If not, we are going to switch soon, keep reposting this
       // ControlMessage.
       MediaTrackGraphImpl* graphImpl = mMediaTrack->GraphImpl();
       if (graphImpl->CurrentDriver()->AsAudioCallbackDriver() &&
           (mProcessingThread == ProcessingThread::FALLBACK_THREAD ||
            (mProcessingThread == ProcessingThread::AUDIO_THREAD &&
             graphImpl->CurrentDriver()->ThreadRunning()))) {
         // Avoid Resolve's locking on the graph thread by doing it on main.
         graphImpl->Dispatch(NS_NewRunnableFunction(
             "MediaTrackGraphImpl::NotifyWhenGraphStarted::Resolver",
-            [holder = std::move(mHolder)]() mutable {
+            [holder = move(mHolder)]() mutable {
               holder.Resolve(true, __func__);
             }));
       } else {
         graphImpl->DispatchToMainThreadStableState(
             NewRunnableMethod<
                 StoreCopyPassByRRef<RefPtr<MediaTrack>>,
                 StoreCopyPassByRRef<MozPromiseHolder<GraphStartedPromise>>,
                 ProcessingThread>(
                 "MediaTrackGraphImpl::NotifyWhenGraphStarted", graphImpl,
-                &MediaTrackGraphImpl::NotifyWhenGraphStarted,
-                std::move(mMediaTrack), std::move(mHolder), mProcessingThread));
+                &MediaTrackGraphImpl::NotifyWhenGraphStarted, move(mMediaTrack),
+                move(mHolder), mProcessingThread));
       }
     }
     void RunDuringShutdown() override {
       mHolder.Reject(NS_ERROR_ILLEGAL_DURING_SHUTDOWN, __func__);
     }
   };
 
   if (aTrack->IsDestroyed()) {
     aHolder.Reject(NS_ERROR_NOT_AVAILABLE, __func__);
     return;
   }
 
   MediaTrackGraphImpl* graph = aTrack->GraphImpl();
   graph->AppendMessage(MakeUnique<GraphStartedNotificationControlMessage>(
-      std::move(aTrack), std::move(aHolder), aProcessingThread));
+      move(aTrack), move(aHolder), aProcessingThread));
 }
 
 void MediaTrackGraphImpl::SuspendOrResumeTracks(
     AudioContextOperation aAudioContextOperation,
     const nsTArray<MediaTrack*>& aTrackSet) {
   MOZ_ASSERT(OnGraphThreadOrNotRunning());
   // For our purpose, Suspend and Close are equivalent: we want to remove the
   // tracks from the set of tracks that are going to be processed.
@@ -3476,26 +3474,25 @@ void MediaTrackGraphImpl::ApplyAudioCont
         driver = NextDriver()->AsAudioCallbackDriver();
       } else {
         driver = new AudioCallbackDriver(
             this, CurrentDriver(), mSampleRate, AudioOutputChannelCount(),
             AudioInputChannelCount(), mOutputDeviceID, mInputDeviceID,
             AudioInputDevicePreference());
         SwitchAtNextIteration(driver);
       }
-      driver->EnqueueTrackAndPromiseForOperation(aDestinationTrack, aOperation,
-                                                 mAbstractMainThread,
-                                                 std::move(aHolder));
+      driver->EnqueueTrackAndPromiseForOperation(
+          aDestinationTrack, aOperation, mAbstractMainThread, move(aHolder));
     } else {
       // We are resuming a context, but we are already using an
       // AudioCallbackDriver, we can resolve the promise now. We do this on main
       // thread to avoid locking the holder's mutex on the graph thread.
       DispatchToMainThreadStableState(NS_NewRunnableFunction(
           "MediaTrackGraphImpl::ApplyAudioContextOperationImpl::Resolve1",
-          [holder = std::move(aHolder)]() mutable {
+          [holder = move(aHolder)]() mutable {
             holder.Resolve(AudioContextState::Running, __func__);
           }));
     }
   } else {
     // Close, suspend: check if we are going to switch to a
     // SystemAudioCallbackDriver, and pass the promise to the
     // AudioCallbackDriver if that's the case, so it can notify the content.
     // This is the same logic as in UpdateTrackOrder, but it's simpler to have
@@ -3513,58 +3510,58 @@ void MediaTrackGraphImpl::ApplyAudioCont
     }
     bool audioTrackPresent = AudioTrackPresent();
 
     if (!audioTrackPresent && CurrentDriver()->AsAudioCallbackDriver()) {
       CurrentDriver()
           ->AsAudioCallbackDriver()
           ->EnqueueTrackAndPromiseForOperation(aDestinationTrack, aOperation,
                                                mAbstractMainThread,
-                                               std::move(aHolder));
+                                               move(aHolder));
 
       SystemClockDriver* driver;
       if (!Switching()) {
         driver = new SystemClockDriver(this, CurrentDriver(), mSampleRate);
         SwitchAtNextIteration(driver);
       }
       // We are closing or suspending an AudioContext, but we just got resumed.
       // Queue the operation on the next driver so that the ordering is
       // preserved.
     } else if (!audioTrackPresent && Switching()) {
       MOZ_ASSERT(NextDriver()->AsAudioCallbackDriver());
       if (NextDriver()->AsAudioCallbackDriver()) {
         NextDriver()
             ->AsAudioCallbackDriver()
             ->EnqueueTrackAndPromiseForOperation(aDestinationTrack, aOperation,
                                                  mAbstractMainThread,
-                                                 std::move(aHolder));
+                                                 move(aHolder));
       } else {
         // If this is not an AudioCallbackDriver, this means we failed opening
         // an AudioCallbackDriver in the past, and we're constantly trying to
         // re-open an new audio track, but are running this graph that has an
         // audio track off a SystemClockDriver for now to keep things moving.
         // This is the case where we're trying to switch an an system driver
         // (because suspend or close have been called on an AudioContext, or
         // we've closed the page), but we're already running one. We can just
         // resolve the promise now: we're already running off a system thread.
         // We do this on main
         // thread to avoid locking the holder's mutex on the graph thread.
         DispatchToMainThreadStableState(NS_NewRunnableFunction(
             "MediaTrackGraphImpl::ApplyAudioContextOperationImpl::Resolve2",
-            [holder = std::move(aHolder), state]() mutable {
+            [holder = move(aHolder), state]() mutable {
               holder.Resolve(state, __func__);
             }));
       }
     } else {
       // We are closing or suspending an AudioContext, but something else is
       // using the audio track, we can resolve the promise now. We do this on
       // main thread to avoid locking the holder's mutex on the graph thread.
       DispatchToMainThreadStableState(NS_NewRunnableFunction(
           "MediaTrackGraphImpl::ApplyAudioContextOperationImpl::Resolve3",
-          [holder = std::move(aHolder), state]() mutable {
+          [holder = move(aHolder), state]() mutable {
             holder.Resolve(state, __func__);
           }));
     }
   }
 }
 
 class AudioContextOperationControlMessage : public ControlMessage {
   using AudioContextOperationPromise =
@@ -3573,20 +3570,20 @@ class AudioContextOperationControlMessag
  public:
   AudioContextOperationControlMessage(
       MediaTrack* aDestinationTrack, const nsTArray<MediaTrack*>& aTracks,
       AudioContextOperation aOperation,
       MozPromiseHolder<AudioContextOperationPromise>&& aHolder)
       : ControlMessage(aDestinationTrack),
         mTracks(aTracks.Clone()),
         mAudioContextOperation(aOperation),
-        mHolder(std::move(aHolder)) {}
+        mHolder(move(aHolder)) {}
   void Run() override {
     mTrack->GraphImpl()->ApplyAudioContextOperationImpl(
-        mTrack, mTracks, mAudioContextOperation, std::move(mHolder));
+        mTrack, mTracks, mAudioContextOperation, move(mHolder));
   }
   void RunDuringShutdown() override {
     MOZ_ASSERT(mAudioContextOperation == AudioContextOperation::Close,
                "We should be reviving the graph?");
     mHolder.Resolve(AudioContextState::Closed, __func__);
   }
 
  private:
@@ -3599,17 +3596,17 @@ class AudioContextOperationControlMessag
 
 auto MediaTrackGraph::ApplyAudioContextOperation(
     MediaTrack* aDestinationTrack, const nsTArray<MediaTrack*>& aTracks,
     AudioContextOperation aOperation) -> RefPtr<AudioContextOperationPromise> {
   MozPromiseHolder<AudioContextOperationPromise> holder;
   RefPtr<AudioContextOperationPromise> p = holder.Ensure(__func__);
   MediaTrackGraphImpl* graphImpl = static_cast<MediaTrackGraphImpl*>(this);
   graphImpl->AppendMessage(MakeUnique<AudioContextOperationControlMessage>(
-      aDestinationTrack, aTracks, aOperation, std::move(holder)));
+      aDestinationTrack, aTracks, aOperation, move(holder)));
   return p;
 }
 
 uint32_t MediaTrackGraphImpl::AudioOutputChannelCount() const {
   MOZ_ASSERT(OnGraphThread());
   // The audio output channel count for a graph is the maximum of the output
   // channel count of all the tracks that are in mAudioOutputs, or the max audio
   // output channel count the machine can do, whichever is smaller.
@@ -3806,17 +3803,17 @@ already_AddRefed<MediaInputPort> MediaTr
   }
   return nullptr;
 }
 
 void MediaTrackGraph::DispatchToMainThreadStableState(
     already_AddRefed<nsIRunnable> aRunnable) {
   AssertOnGraphThreadOrNotRunning();
   static_cast<MediaTrackGraphImpl*>(this)
-      ->mPendingUpdateRunnables.AppendElement(std::move(aRunnable));
+      ->mPendingUpdateRunnables.AppendElement(move(aRunnable));
 }
 
 Watchable<mozilla::GraphTime>& MediaTrackGraphImpl::CurrentTime() {
   MOZ_ASSERT(NS_IsMainThread());
   return mMainThreadGraphTime;
 }
 
 GraphTime MediaTrackGraph::ProcessedTime() const {
--- a/dom/media/webaudio/AudioContext.cpp
+++ b/dom/media/webaudio/AudioContext.cpp
@@ -80,16 +80,18 @@
 #include "StereoPannerNode.h"
 #include "WaveShaperNode.h"
 
 extern mozilla::LazyLogModule gAutoplayPermissionLog;
 
 #define AUTOPLAY_LOG(msg, ...) \
   MOZ_LOG(gAutoplayPermissionLog, LogLevel::Debug, (msg, ##__VA_ARGS__))
 
+using std::move;
+
 namespace mozilla {
 namespace dom {
 
 // 0 is a special value that MediaTracks use to denote they are not part of a
 // AudioContext.
 static dom::AudioContext::AudioContextId gAudioContextId = 1;
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(AudioContext)
@@ -644,17 +646,17 @@ already_AddRefed<Promise> AudioContext::
   }
   if (aSuccessCallback.WasPassed()) {
     successCallback = &aSuccessCallback.Value();
   }
   UniquePtr<WebAudioDecodeJob> job(
       new WebAudioDecodeJob(this, promise, successCallback, failureCallback));
   AsyncDecodeWebAudio(contentType.get(), data, length, *job);
   // Transfer the ownership to mDecodeJobs
-  mDecodeJobs.AppendElement(std::move(job));
+  mDecodeJobs.AppendElement(move(job));
 
   return promise.forget();
 }
 
 void AudioContext::RemoveFromDecodeQueue(WebAudioDecodeJob* aDecodeJob) {
   // Since UniquePtr doesn't provide an operator== which allows you to compare
   // against raw pointers, we need to iterate manually.
   for (uint32_t i = 0; i < mDecodeJobs.Length(); ++i) {
@@ -805,17 +807,17 @@ class OnStateChangeTask final : public R
 
 void AudioContext::Dispatch(already_AddRefed<nsIRunnable>&& aRunnable) {
   MOZ_ASSERT(NS_IsMainThread());
   nsCOMPtr<nsIGlobalObject> parentObject = do_QueryInterface(GetParentObject());
   // It can happen that this runnable took a long time to reach the main thread,
   // and the global is not valid anymore.
   if (parentObject) {
     parentObject->AbstractMainThreadFor(TaskCategory::Other)
-        ->Dispatch(std::move(aRunnable));
+        ->Dispatch(move(aRunnable));
   } else {
     RefPtr<nsIRunnable> runnable(aRunnable);
     runnable = nullptr;
   }
 }
 
 void AudioContext::OnStateChanged(void* aPromise, AudioContextState aNewState) {
   MOZ_ASSERT(NS_IsMainThread());
@@ -1231,18 +1233,17 @@ void AudioContext::Unmute() const {
   if (mDestination) {
     mDestination->Unmute();
   }
 }
 
 void AudioContext::SetParamMapForWorkletName(
     const nsAString& aName, AudioParamDescriptorMap* aParamMap) {
   MOZ_ASSERT(!mWorkletParamDescriptors.GetValue(aName));
-  Unused << mWorkletParamDescriptors.Put(aName, std::move(*aParamMap),
-                                         fallible);
+  Unused << mWorkletParamDescriptors.Put(aName, move(*aParamMap), fallible);
 }
 
 size_t AudioContext::SizeOfIncludingThis(
     mozilla::MallocSizeOf aMallocSizeOf) const {
   // AudioNodes are tracked separately because we do not want the AudioContext
   // to track all of the AudioNodes it creates, so we wouldn't be able to
   // traverse them from here.