Commit b70f724c authored by Jamie Nicol's avatar Jamie Nicol
Browse files

Bug 1896024 - Ensure PerformanceHintSession is valid before reporting work duration. r=jesup,smaug

parent ada64fca
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -831,12 +831,12 @@ class VsyncRefreshDriverTimer : public RefreshDriverTimer {
    const TimeDuration previousRate = mVsyncRate;
    const TimeDuration rate = GetTimerRate();

    hal::PerformanceHintSession* const performanceHintSession =
        GetPerformanceHintSession();
    if (performanceHintSession && rate != previousRate) {
    if (rate != previousRate) {
      if (auto* const performanceHintSession = GetPerformanceHintSession()) {
        performanceHintSession->UpdateTargetWorkDuration(
            ContentChild::GetPerformanceHintTarget(rate));
      }
    }

    if (TimeDuration::FromMilliseconds(nsRefreshDriver::DefaultInterval()) >
        rate) {
@@ -862,7 +862,7 @@ class VsyncRefreshDriverTimer : public RefreshDriverTimer {

    TimeStamp tickEnd = TimeStamp::Now();

    if (performanceHintSession) {
    if (auto* const performanceHintSession = GetPerformanceHintSession()) {
      performanceHintSession->ReportActualWorkDuration(tickEnd - tickStart);
    }