diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index c4df564256a9..9b6f53cc700b 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -2581,44 +2581,6 @@ void nsJSContext::NotifyDidPaint() { sDidPaintAfterPreviousICCSlice = true; - if (sICCTimer) { - static uint32_t sCount = 0; - // 16 here is the common value for refresh driver tick frequency. - static const uint32_t kTicksPerSliceDelay = kICCIntersliceDelay / 16; - if (++sCount % kTicksPerSliceDelay != 0) { - // Don't trigger CC slice all the time after paint, but often still. - // The key point is to trigger it right after paint, especially when - // we're running RefreshDriver constantly. - return; - } - - sICCTimer->Cancel(); - ICCTimerFired(nullptr, nullptr); - if (sICCTimer) { - sICCTimer->InitWithNamedFuncCallback(ICCTimerFired, nullptr, - kICCIntersliceDelay, - nsITimer::TYPE_REPEATING_SLACK, - "ICCTimerFired"); - } - } else if (sCCTimer) { - static uint32_t sCount = 0; - static const uint32_t kTicksPerForgetSkippableDelay = - NS_CC_SKIPPABLE_DELAY / 16; - if (++sCount % kTicksPerForgetSkippableDelay != 0) { - // The comment above about triggering CC slice applies to forget skippable - // too. - return; - } - - sCCTimer->Cancel(); - CCTimerFired(nullptr, nullptr); - if (sCCTimer) { - sCCTimer->InitWithNamedFuncCallback(CCTimerFired, nullptr, - NS_CC_SKIPPABLE_DELAY, - nsITimer::TYPE_REPEATING_SLACK, - "CCTimerFired"); - } - } } nsScriptNameSpaceManager* diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp index f8c5f2ec2f1e..74f4c34f53f2 100644 --- a/layout/base/nsRefreshDriver.cpp +++ b/layout/base/nsRefreshDriver.cpp @@ -1876,7 +1876,6 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime) } mPresShellsToInvalidateIfHidden.Clear(); - bool notifyGC = false; if (mViewManagerFlushIsPending) { RefPtr timelines = TimelineConsumers::Get(); @@ -1912,7 +1911,10 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime) timelines->AddMarkerForDocShell(docShell, "Paint", MarkerTracingType::END); } - notifyGC = true; + if (nsContentUtils::XPConnect()) { + nsContentUtils::XPConnect()->NotifyDidPaint(); + nsJSContext::NotifyDidPaint(); + } } #ifndef ANDROID /* bug 1142079 */ @@ -1932,11 +1934,6 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime) if (mPresContext->IsRoot() && XRE_IsContentProcess() && gfxPrefs::AlwaysPaint()) { ScheduleViewManagerFlush(); } - - if (notifyGC && nsContentUtils::XPConnect()) { - nsContentUtils::XPConnect()->NotifyDidPaint(); - nsJSContext::NotifyDidPaint(); - } } void