From 0e34f56c152cf72e66f582ae0550b49422314349 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Thu, 21 Sep 2023 17:21:43 +0000 Subject: [PATCH] Bug 1688721 uninline AudioEventTimeline::CleanupEventsOlderThan() r=padenot Differential Revision: https://phabricator.services.mozilla.com/D188573 UltraBlame original commit: 7c6496f92bb0572d56513d645f3d6201f77a5653 --- dom/media/webaudio/AudioEventTimeline.cpp | 144 ++++++++++++++++++++++ dom/media/webaudio/AudioEventTimeline.h | 109 ---------------- 2 files changed, 144 insertions(+), 109 deletions(-) diff --git a/dom/media/webaudio/AudioEventTimeline.cpp b/dom/media/webaudio/AudioEventTimeline.cpp index 039d19d24bd8f..d86efed16434f 100644 --- a/dom/media/webaudio/AudioEventTimeline.cpp +++ b/dom/media/webaudio/AudioEventTimeline.cpp @@ -686,6 +686,150 @@ mCurve ; } } +template +void +AudioEventTimeline +: +: +CleanupEventsOlderThan +( +double +) +; +template +void +AudioEventTimeline +: +: +CleanupEventsOlderThan +( +int64_t +) +; +template +< +class +TimeType +> +void +AudioEventTimeline +: +: +CleanupEventsOlderThan +( +TimeType +aTime +) +{ +while +( +mEvents +. +Length +( +) +> +1 +& +& +aTime +> +mEvents +[ +1 +] +. +Time +< +TimeType +> +( +) +) +{ +if +( +mEvents +[ +1 +] +. +mType += += +AudioTimelineEvent +: +: +SetTarget +) +{ +mSetTargetStartValue += +GetValuesAtTimeHelperInternal +( +mEvents +[ +1 +] +. +Time +< +TimeType +> +( +) +& +mEvents +[ +0 +] +nullptr +) +; +} +MOZ_ASSERT +( +! +mEvents +[ +0 +] +. +mTrack +" +AudioParam +tracks +should +never +be +destroyed +on +the +real +- +time +" +" +thread +. +" +) +; +JS +: +: +AutoSuppressGCAnalysis +suppress +; +mEvents +. +RemoveElementAt +( +0 +) +; +} +} / / This diff --git a/dom/media/webaudio/AudioEventTimeline.h b/dom/media/webaudio/AudioEventTimeline.h index 945f81b739180..7ae364e60ca85 100644 --- a/dom/media/webaudio/AudioEventTimeline.h +++ b/dom/media/webaudio/AudioEventTimeline.h @@ -2136,116 +2136,7 @@ CleanupEventsOlderThan TimeType aTime ) -{ -while -( -mEvents -. -Length -( -) -> -1 -& -& -aTime -> -mEvents -[ -1 -] -. -Time -< -TimeType -> -( -) -) -{ -if -( -mEvents -[ -1 -] -. -mType -= -= -AudioTimelineEvent -: -: -SetTarget -) -{ -mSetTargetStartValue -= -GetValuesAtTimeHelperInternal -( -mEvents -[ -1 -] -. -Time -< -TimeType -> -( -) -& -mEvents -[ -0 -] -nullptr -) -; -} -MOZ_ASSERT -( -! -mEvents -[ -0 -] -. -mTrack -" -AudioParam -tracks -should -never -be -destroyed -on -the -real -- -time -" -" -thread -. -" -) -; -JS -: -: -AutoSuppressGCAnalysis -suppress -; -mEvents -. -RemoveElementAt -( -0 -) ; -} -} private : template