diff --git a/dom/workers/WorkerPrefs.h b/dom/workers/WorkerPrefs.h index 31a00e4290..a8a1e61f4f 100644 --- a/dom/workers/WorkerPrefs.h +++ b/dom/workers/WorkerPrefs.h @@ -26,7 +26,7 @@ WORKER_SIMPLE_PREF("browser.dom.window.dump.enabled", DumpEnabled, DUMP) WORKER_SIMPLE_PREF("canvas.imagebitmap_extensions.enabled", ImageBitmapExtensionsEnabled, IMAGEBITMAP_EXTENSIONS_ENABLED) WORKER_SIMPLE_PREF("dom.caches.enabled", DOMCachesEnabled, DOM_CACHES) WORKER_SIMPLE_PREF("dom.caches.testing.enabled", DOMCachesTestingEnabled, DOM_CACHES_TESTING) -WORKER_SIMPLE_PREF("dom.min_timeout_value", DOMMinTimoutValue, DOM_MIN_TIMEOUT_VALUE) +WORKER_SIMPLE_PREF("dom.min_timeout_value", DOMMinTimeoutValue, DOM_MIN_TIMEOUT_VALUE) WORKER_SIMPLE_PREF("dom.performance.enable_user_timing_logging", PerformanceLoggingEnabled, PERFORMANCE_LOGGING_ENABLED) WORKER_SIMPLE_PREF("dom.webnotifications.enabled", DOMWorkerNotificationEnabled, DOM_WORKERNOTIFICATION) WORKER_SIMPLE_PREF("dom.webnotifications.serviceworker.enabled", DOMServiceWorkerNotificationEnabled, DOM_SERVICEWORKERNOTIFICATION) diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 35d8dd744b..9c52c789cc 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -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