tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 032a210793e3e217eea63b389f4918fc486f93b4
parent 2d48f93a48dde3764d68f02da10c67dfce7c891f
Author: Karl Tomlinson <karlt+@karlt.net>
Date:   Tue,  7 Oct 2025 20:25:46 +0000

Bug 1992922 Remove unused IterationEnd() from MediaTrackGraphImpl and GraphRunner r=pehrsons

Differential Revision: https://phabricator.services.mozilla.com/D267731

Diffstat:
Mdom/media/GraphRunner.cpp | 8+++-----
Mdom/media/GraphRunner.h | 8++------
Mdom/media/MediaTrackGraph.cpp | 13++++++-------
Mdom/media/MediaTrackGraphImpl.h | 5-----
4 files changed, 11 insertions(+), 23 deletions(-)

diff --git a/dom/media/GraphRunner.cpp b/dom/media/GraphRunner.cpp @@ -62,15 +62,14 @@ void GraphRunner::Shutdown() { mThread->Shutdown(); } -auto GraphRunner::OneIteration(GraphTime aStateTime, GraphTime aIterationEnd, +auto GraphRunner::OneIteration(GraphTime aStateTime, MixerCallbackReceiver* aMixerReceiver) -> IterationResult { TRACE("GraphRunner::OneIteration"); MonitorAutoLock lock(mMonitor); MOZ_ASSERT(mThreadState == ThreadState::Wait); - mIterationState = - Some(IterationState(aStateTime, aIterationEnd, aMixerReceiver)); + mIterationState = Some(IterationState(aStateTime, aMixerReceiver)); #ifdef DEBUG if (const auto* audioDriver = @@ -142,8 +141,7 @@ NS_IMETHODIMP GraphRunner::Run() { MOZ_DIAGNOSTIC_ASSERT(mIterationState.isSome()); TRACE("GraphRunner::Run"); mIterationResult = mGraph->OneIterationImpl( - mIterationState->StateTime(), mIterationState->IterationEnd(), - mIterationState->MixerReceiver()); + mIterationState->StateTime(), mIterationState->MixerReceiver()); // Signal that mIterationResult was updated mThreadState = ThreadState::Wait; mMonitor.Notify(); diff --git a/dom/media/GraphRunner.h b/dom/media/GraphRunner.h @@ -35,7 +35,7 @@ class GraphRunner final : public Runnable { * Signals one iteration of mGraph. Hands state over to mThread and runs * the iteration there. */ - IterationResult OneIteration(GraphTime aStateTime, GraphTime aIterationEnd, + IterationResult OneIteration(GraphTime aStateTime, MixerCallbackReceiver* aMixerReceiver); /** @@ -63,18 +63,14 @@ class GraphRunner final : public Runnable { class IterationState { GraphTime mStateTime; - GraphTime mIterationEnd; MixerCallbackReceiver* MOZ_NON_OWNING_REF mMixerReceiver; public: - IterationState(GraphTime aStateTime, GraphTime aIterationEnd, - MixerCallbackReceiver* aMixerReceiver) + IterationState(GraphTime aStateTime, MixerCallbackReceiver* aMixerReceiver) : mStateTime(aStateTime), - mIterationEnd(aIterationEnd), mMixerReceiver(aMixerReceiver) {} IterationState& operator=(const IterationState& aOther) = default; GraphTime StateTime() const { return mStateTime; } - GraphTime IterationEnd() const { return mIterationEnd; } MixerCallbackReceiver* MixerReceiver() const { return mMixerReceiver; } }; diff --git a/dom/media/MediaTrackGraph.cpp b/dom/media/MediaTrackGraph.cpp @@ -1424,8 +1424,8 @@ void MediaTrackGraphImpl::UpdateGraph(GraphTime aEndBlockingDecisions) { track->mStartBlocking = mStateComputedTime; } - // If the loop is woken up so soon that IterationEnd() barely advances or - // if an offline graph is not currently rendering, we end up having + // If the loop is woken up so soon that mStateComputedTime does not advance + // or if an offline graph is not currently rendering, we end up having // aEndBlockingDecisions == mStateComputedTime. // Since the process interval [mStateComputedTime, aEndBlockingDecision) is // empty, Process() will not find any unblocked track and so will not @@ -1635,16 +1635,15 @@ auto MediaTrackGraphImpl::OneIteration(GraphTime aStateTime, MixerCallbackReceiver* aMixerReceiver) -> IterationResult { if (mGraphRunner) { - return mGraphRunner->OneIteration(aStateTime, aIterationEnd, - aMixerReceiver); + return mGraphRunner->OneIteration(aStateTime, aMixerReceiver); } - return OneIterationImpl(aStateTime, aIterationEnd, aMixerReceiver); + return OneIterationImpl(aStateTime, aMixerReceiver); } auto MediaTrackGraphImpl::OneIterationImpl( - GraphTime aStateTime, GraphTime aIterationEnd, - MixerCallbackReceiver* aMixerReceiver) -> IterationResult { + GraphTime aStateTime, MixerCallbackReceiver* aMixerReceiver) + -> IterationResult { TRACE("MTG::OneIterationImpl"); TRACE_AUDIO_CALLBACK_FRAME_COUNT( "MTG graph advance", aStateTime - mStateComputedTime, mSampleRate); diff --git a/dom/media/MediaTrackGraphImpl.h b/dom/media/MediaTrackGraphImpl.h @@ -302,7 +302,6 @@ class MediaTrackGraphImpl : public MediaTrackGraph, * Returns true if this MediaTrackGraph should keep running */ IterationResult OneIterationImpl(GraphTime aStateTime, - GraphTime aIterationEnd, MixerCallbackReceiver* aMixerReceiver); /** @@ -313,10 +312,6 @@ class MediaTrackGraphImpl : public MediaTrackGraph, */ void SignalMainThreadCleanup(); - /* This is the end of the current iteration, that is, the current time of the - * graph. */ - GraphTime IterationEnd() const; - /** * Ensure there is an event posted to the main thread to run RunInStableState. * mMonitor must be held.