From 2738241549f2b762cba8a0f81aaefee4dd524cb5 Mon Sep 17 00:00:00 2001 From: Jeremy Chen Date: Sun, 9 Apr 2017 16:53:56 +0800 Subject: [PATCH] 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 --- layout/painting/ActiveLayerTracker.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/layout/painting/ActiveLayerTracker.cpp b/layout/painting/ActiveLayerTracker.cpp index 2ed3b297c613..636ed16a4e4a 100644 --- a/layout/painting/ActiveLayerTracker.cpp +++ b/layout/painting/ActiveLayerTracker.cpp @@ -119,9 +119,10 @@ class LayerActivityTracker final : public nsExpirationTracker { 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(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; }