mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18:39 +09:00
Issue #2453 - Simplify CalculateTargetTime() code and fix typo.
We should always be on a worker thread so the MainThread call isn't needed. Also: DOMMinTimoutValue -> DOMMinTimeoutValue
This commit is contained in:
parent
8b7021f216
commit
aa2e80e571
2 changed files with 7 additions and 12 deletions
|
|
@ -1999,18 +1999,13 @@ struct WorkerPrivate::TimeoutInfo
|
|||
auto target = mInterval;
|
||||
int32_t minTimeoutValue;
|
||||
|
||||
if (NS_IsMainThread()) {
|
||||
// We can get the pref value directly.
|
||||
minTimeoutValue = Preferences::GetInt("dom.min_timeout_value");
|
||||
// We're on a worker thread; go through WorkerPrivate for the pref.
|
||||
WorkerPrivate* workerPrivate = GetWorkerPrivateFromContext(aCx);
|
||||
if (workerPrivate) {
|
||||
minTimeoutValue = workerPrivate->DOMMinTimeoutValue();
|
||||
} else {
|
||||
// We're on a worker thread; go through WorkerPrivate.
|
||||
WorkerPrivate* workerPrivate = GetWorkerPrivateFromContext(aCx);
|
||||
if (workerPrivate) {
|
||||
minTimeoutValue = workerPrivate->DOMMinTimoutValue();
|
||||
} else {
|
||||
// fall back to default 4 ms
|
||||
minTimeoutValue = 4;
|
||||
}
|
||||
// fall back to default 4 ms
|
||||
minTimeoutValue = 4;
|
||||
}
|
||||
|
||||
// Clamp timeout for workers, except chrome workers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue