Bug 1347815 - part1.2: label ScrollFrameActivityTracker.
ScrollFrameActivityTracker::NotifyExpired() will be invoked by
nsExpirationTracker::TimerCallback() from an unlabeled runnable.
We provide a SystemGroup EventTarget for the invocation of this
callback since there's nothing within a page that would rely on
the timer firing at a particular time (i.e., it doesn't matter
when this timer's callback is scheduled, relative to other
runnables dispatched for the page).
MozReview-Commit-ID: 9QEjxCtFhve
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1975,19 +1975,20 @@ ScrollFrameHelper::IsSmoothScrollingEnab
return Preferences::GetBool(SMOOTH_SCROLL_PREF_NAME, false);
}
class ScrollFrameActivityTracker final : public nsExpirationTracker<ScrollFrameHelper,4> {
public:
// Wait for 3-4s between scrolls before we remove our layers.
// That's 4 generations of 1s each.
enum { TIMEOUT_MS = 1000 };
- ScrollFrameActivityTracker()
+ explicit ScrollFrameActivityTracker(nsIEventTarget* aEventTarget)
: nsExpirationTracker<ScrollFrameHelper,4>(TIMEOUT_MS,
- "ScrollFrameActivityTracker")
+ "ScrollFrameActivityTracker",
+ aEventTarget)
{}
~ScrollFrameActivityTracker() {
AgeAllGenerations();
}
virtual void NotifyExpired(ScrollFrameHelper *aObject) {
RemoveObject(aObject);
aObject->MarkNotRecentlyScrolled();
@@ -2534,17 +2535,18 @@ void ScrollFrameHelper::MarkRecentlyScro
if (IsAlwaysActive()) {
return;
}
if (mActivityExpirationState.IsTracked()) {
gScrollFrameActivityTracker->MarkUsed(this);
} else {
if (!gScrollFrameActivityTracker) {
- gScrollFrameActivityTracker = new ScrollFrameActivityTracker();
+ gScrollFrameActivityTracker = new ScrollFrameActivityTracker(
+ SystemGroup::EventTargetFor(TaskCategory::Other));
}
gScrollFrameActivityTracker->AddObject(this);
}
// If we just scrolled and there's a displayport expiry timer in place,
// reset the timer.
ResetDisplayPortExpiryTimer();
}