Bug 1342863 - (Part 8) DocGroup labeling for timer callback in nsRefreshDriver. r?dholbert
MozReview-Commit-ID: DP7WFkvlrPq
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -1432,21 +1432,27 @@ nsRefreshDriver::SetHighPrecisionTimersE
// Don't jerk us around between high precision and low precision
// timers; instead, only allow leaving high precision timers
// after 90 seconds. This is arbitrary, but hopefully good
// enough.
NS_ASSERTION(!sDisableHighPrecisionTimersTimer, "We shouldn't have an outstanding disable-high-precision timer !");
nsCOMPtr<nsITimer> timer = do_CreateInstance(NS_TIMER_CONTRACTID);
if (timer) {
+ if (nsPresContext* pc = GetPresContext()) {
+ timer->SetTarget(
+ pc->Document()->EventTargetFor(TaskCategory::Other));
+ }
timer.forget(&sDisableHighPrecisionTimersTimer);
- sDisableHighPrecisionTimersTimer->InitWithFuncCallback(DisableHighPrecisionTimersCallback,
- nullptr,
- 90 * 1000,
- nsITimer::TYPE_ONE_SHOT);
+ sDisableHighPrecisionTimersTimer->
+ InitWithNamedFuncCallback(DisableHighPrecisionTimersCallback,
+ nullptr,
+ 90 * 1000,
+ nsITimer::TYPE_ONE_SHOT,
+ "DisableHighPrecisionTimersCallback");
} else {
// might happen if we're shutting down XPCOM; just drop the time period down
// immediately
timeEndPeriod(1);
}
}
#endif
mRequestedHighPrecision = false;