Bug 1347815 - part2: label LayerActivityTracker. r=heycam

LayerActivityTracker::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: FZHtqicwDG5

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

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

@ -119,9 +119,10 @@ class LayerActivityTracker final : public nsExpirationTracker<LayerActivity,4> {
public:
// 75-100ms is a good timeout period. We use 4 generations of 25ms each.
enum { GENERATION_MS = 100 };
LayerActivityTracker()
explicit LayerActivityTracker(nsIEventTarget* aEventTarget)
: nsExpirationTracker<LayerActivity,4>(GENERATION_MS,
"LayerActivityTracker")
"LayerActivityTracker",
aEventTarget)
, mDestroying(false)
{}
~LayerActivityTracker() {
@ -203,7 +204,8 @@ GetLayerActivityForUpdate(nsIFrame* aFrame)
gLayerActivityTracker->MarkUsed(layerActivity);
} else {
if (!gLayerActivityTracker) {
gLayerActivityTracker = new LayerActivityTracker();
gLayerActivityTracker = new LayerActivityTracker(
SystemGroup::EventTargetFor(TaskCategory::Other));
}
layerActivity = new LayerActivity(aFrame);
gLayerActivityTracker->AddObject(layerActivity);
@ -511,7 +513,8 @@ ActiveLayerTracker::IsContentActive(nsIFrame* aFrame)
ActiveLayerTracker::SetCurrentScrollHandlerFrame(nsIFrame* aFrame)
{
if (!gLayerActivityTracker) {
gLayerActivityTracker = new LayerActivityTracker();
gLayerActivityTracker = new LayerActivityTracker(
SystemGroup::EventTargetFor(TaskCategory::Other));
}
gLayerActivityTracker->mCurrentScrollHandlerFrame = aFrame;
}