mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 07:48:38 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
b0345ff809
35 changed files with 789 additions and 133 deletions
|
|
@ -1995,13 +1995,22 @@ struct WorkerPrivate::TimeoutInfo
|
|||
mNestingLevel = kClampTimeoutNestingLevel;
|
||||
}
|
||||
|
||||
void CalculateTargetTime() {
|
||||
void CalculateTargetTime(JSContext* aCx) {
|
||||
auto target = mInterval;
|
||||
int32_t minTimeoutValue;
|
||||
|
||||
// We're on a worker thread; go through WorkerPrivate for the pref.
|
||||
WorkerPrivate* workerPrivate = GetWorkerPrivateFromContext(aCx);
|
||||
if (workerPrivate) {
|
||||
minTimeoutValue = workerPrivate->DOMMinTimeoutValue();
|
||||
} else {
|
||||
// fall back to default 4 ms
|
||||
minTimeoutValue = 4;
|
||||
}
|
||||
|
||||
// Clamp timeout for workers, except chrome workers
|
||||
if (mNestingLevel >= kClampTimeoutNestingLevel && !mOnChromeWorker) {
|
||||
target = TimeDuration::Max(
|
||||
mInterval,
|
||||
TimeDuration::FromMilliseconds(Preferences::GetInt("dom.min_timeout_value")));
|
||||
target = TimeDuration::Max(mInterval,TimeDuration::FromMilliseconds(minTimeoutValue));
|
||||
}
|
||||
mTargetTime = TimeStamp::Now() + target;
|
||||
}
|
||||
|
|
@ -6387,7 +6396,7 @@ WorkerPrivate::RunExpiredTimeouts(JSContext* aCx)
|
|||
// Reschedule intervals.
|
||||
// Reschedule a timeout and, if needed, increase the nesting level.
|
||||
info->AccumulateNestingLevel(info->mNestingLevel);
|
||||
info->CalculateTargetTime();
|
||||
info->CalculateTargetTime(aCx);
|
||||
// Don't re-sort the list here, we'll do that at the end.
|
||||
++index;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue