Bug 1347815 - part1.2: label ScrollFrameActivityTracker. r=heycam

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

--HG--
extra : rebase_source : 06b979835363b9c4288dd218d2a4ca2dc111169b
This commit is contained in:
Jeremy Chen 2017-04-09 16:53:56 +08:00
Родитель bcda6f5517
Коммит d66ae544cc
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -1980,9 +1980,10 @@ public:
// Wait for 3-4s between scrolls before we remove our layers. // Wait for 3-4s between scrolls before we remove our layers.
// That's 4 generations of 1s each. // That's 4 generations of 1s each.
enum { TIMEOUT_MS = 1000 }; enum { TIMEOUT_MS = 1000 };
ScrollFrameActivityTracker() explicit ScrollFrameActivityTracker(nsIEventTarget* aEventTarget)
: nsExpirationTracker<ScrollFrameHelper,4>(TIMEOUT_MS, : nsExpirationTracker<ScrollFrameHelper,4>(TIMEOUT_MS,
"ScrollFrameActivityTracker") "ScrollFrameActivityTracker",
aEventTarget)
{} {}
~ScrollFrameActivityTracker() { ~ScrollFrameActivityTracker() {
AgeAllGenerations(); AgeAllGenerations();
@ -2539,7 +2540,8 @@ void ScrollFrameHelper::MarkRecentlyScrolled()
gScrollFrameActivityTracker->MarkUsed(this); gScrollFrameActivityTracker->MarkUsed(this);
} else { } else {
if (!gScrollFrameActivityTracker) { if (!gScrollFrameActivityTracker) {
gScrollFrameActivityTracker = new ScrollFrameActivityTracker(); gScrollFrameActivityTracker = new ScrollFrameActivityTracker(
SystemGroup::EventTargetFor(TaskCategory::Other));
} }
gScrollFrameActivityTracker->AddObject(this); gScrollFrameActivityTracker->AddObject(this);
} }