diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 5b00b61ec0463..6bac48da4a4ac 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -88766,56 +88766,6 @@ mirror : always # -ifdef -XP_WIN -# -Controls -whether -or -not -TimerThread -will -automatically -increase -the -Windows -timer -# -resolution -when -appropriate -conditions -are -met -. -- -name -: -timer -. -auto_increase_timer_resolution -type -: -RelaxedAtomicBool -# -ifdef -NIGHTLY_BUILD -value -: -true -# -else -value -: -false -# -endif -mirror -: -always -# -endif -# - - - diff --git a/xpcom/threads/TimerThread.cpp b/xpcom/threads/TimerThread.cpp index d72e959c0e9e4..dc4e19bfc4737 100644 --- a/xpcom/threads/TimerThread.cpp +++ b/xpcom/threads/TimerThread.cpp @@ -152,13 +152,6 @@ h # include " -nsIPropertyBag2 -. -h -" -# -include -" mozilla / Services @@ -228,263 +221,6 @@ math . h > -# -ifdef -XP_WIN -/ -/ -Include -Windows -header -required -for -enabling -high -- -precision -timers -. -# -include -< -windows -. -h -> -# -include -< -mmsystem -. -h -> -static -constexpr -UINT -kTimerPeriodHiRes -= -1 -; -static -constexpr -UINT -kTimerPeriodLowRes -= -16 -; -/ -/ -Helper -functions -to -determine -what -Windows -timer -resolution -to -target -. -static -constexpr -UINT -GetDesiredTimerPeriod -( -const -bool -aOnBatteryPower -const -bool -aLowProcessPriority -) -{ -const -bool -useLowResTimer -= -aOnBatteryPower -| -| -aLowProcessPriority -; -return -useLowResTimer -? -kTimerPeriodLowRes -: -kTimerPeriodHiRes -; -} -static_assert -( -GetDesiredTimerPeriod -( -true -false -) -= -= -kTimerPeriodLowRes -) -; -static_assert -( -GetDesiredTimerPeriod -( -false -true -) -= -= -kTimerPeriodLowRes -) -; -static_assert -( -GetDesiredTimerPeriod -( -true -true -) -= -= -kTimerPeriodLowRes -) -; -static_assert -( -GetDesiredTimerPeriod -( -false -false -) -= -= -kTimerPeriodHiRes -) -; -UINT -TimerThread -: -: -ComputeDesiredTimerPeriod -( -) -const -{ -const -bool -lowPriorityProcess -= -mCachedPriority -. -load -( -std -: -: -memory_order_relaxed -) -< -hal -: -: -PROCESS_PRIORITY_FOREGROUND -; -/ -/ -NOTE -: -Using -short -- -circuiting -here -to -avoid -call -to -GetSystemPowerStatus -( -) -/ -/ -when -we -know -that -that -result -will -not -affect -the -final -result -. -( -As -/ -/ -confirmed -by -the -static_assert -' -s -above -onBatteryPower -does -not -affect -the -/ -/ -result -when -the -lowPriorityProcess -is -true -. -) -SYSTEM_POWER_STATUS -status -; -const -bool -onBatteryPower -= -! -lowPriorityProcess -& -& -GetSystemPowerStatus -( -& -status -) -& -& -( -status -. -ACLineStatus -= -= -0 -) -; -return -GetDesiredTimerPeriod -( -onBatteryPower -lowPriorityProcess -) -; -} -# -endif using namespace mozilla @@ -1476,24 +1212,6 @@ resume_process_notification false ) ; -observerService -- -> -AddObserver -( -mObserver -" -ipc -: -process -- -priority -- -changed -" -false -) -; } return NS_OK @@ -5103,123 +4821,6 @@ SetLengthAndRetainStorage kMaxQueuedTimerFired ) ; -# -ifdef -XP_WIN -/ -/ -kTimerPeriodEvalIntervalSec -is -the -minimum -amount -of -time -that -must -pass -/ -/ -before -we -will -consider -changing -the -timer -period -again -. -static -constexpr -float -kTimerPeriodEvalIntervalSec -= -2 -. -0f -; -const -TimeDuration -timerPeriodEvalInterval -= -TimeDuration -: -: -FromSeconds -( -kTimerPeriodEvalIntervalSec -) -; -TimeStamp -nextTimerPeriodEval -= -TimeStamp -: -: -Now -( -) -+ -timerPeriodEvalInterval -; -/ -/ -If -this -is -false -we -will -perform -all -of -the -logic -but -will -stop -short -of -/ -/ -actually -changing -the -timer -period -. -const -bool -adjustTimerPeriod -= -StaticPrefs -: -: -timer_auto_increase_timer_resolution -( -) -; -UINT -lastTimePeriodSet -= -ComputeDesiredTimerPeriod -( -) -; -if -( -adjustTimerPeriod -) -{ -timeBeginPeriod -( -lastTimePeriodSet -) -; -} -# -endif uint64_t timersFiredThisWakeup = @@ -5344,63 +4945,6 @@ Now ) ; # -ifdef -XP_WIN -if -( -now -> -= -nextTimerPeriodEval -) -{ -const -UINT -newTimePeriod -= -ComputeDesiredTimerPeriod -( -) -; -if -( -newTimePeriod -! -= -lastTimePeriodSet -) -{ -if -( -adjustTimerPeriod -) -{ -timeEndPeriod -( -lastTimePeriodSet -) -; -timeBeginPeriod -( -newTimePeriod -) -; -} -lastTimePeriodSet -= -newTimePeriod -; -} -nextTimerPeriodEval -= -now -+ -timerPeriodEvalInterval -; -} -# -endif -# if TIMER_THREAD_STATISTICS if @@ -6617,42 +6161,6 @@ queuedTimersFiredPerWakeup ) ; } -# -ifdef -XP_WIN -/ -/ -About -to -shut -down -- -let -' -s -finish -off -the -last -time -period -that -we -set -. -if -( -adjustTimerPeriod -) -{ -timeEndPeriod -( -lastTimePeriodSet -) -; -} -# -endif return NS_OK ; @@ -9229,7 +8737,11 @@ Observe ( nsISupports * +/ +* aSubject +* +/ const char * @@ -9237,99 +8749,15 @@ aTopic const char16_t * +/ +* aData +* +/ ) { if ( -strcmp -( -aTopic -" -ipc -: -process -- -priority -- -changed -" -) -= -= -0 -) -{ -nsCOMPtr -< -nsIPropertyBag2 -> -props -= -do_QueryInterface -( -aSubject -) -; -MOZ_ASSERT -( -props -! -= -nullptr -) -; -int32_t -priority -= -static_cast -< -int32_t -> -( -hal -: -: -PROCESS_PRIORITY_UNKNOWN -) -; -props -- -> -GetPropertyAsInt32 -( -u -" -priority -" -_ns -& -priority -) -; -mCachedPriority -. -store -( -static_cast -< -hal -: -: -ProcessPriority -> -( -priority -) -std -: -: -memory_order_relaxed -) -; -} -if -( StaticPrefs : : diff --git a/xpcom/threads/TimerThread.h b/xpcom/threads/TimerThread.h index 4c9fe67ca4f9a..dcc1f1a970d6f 100644 --- a/xpcom/threads/TimerThread.h +++ b/xpcom/threads/TimerThread.h @@ -176,15 +176,6 @@ include " mozilla / -HalTypes -. -h -" -# -include -" -mozilla -/ Monitor . h @@ -528,103 +519,6 @@ MOZ_REQUIRES mMonitor ) ; -/ -/ -Using -atomic -because -this -value -is -written -to -in -one -place -and -read -from -/ -/ -in -another -and -those -two -locations -are -likely -to -be -executed -from -separate -/ -/ -threads -. -Reads -/ -writes -to -an -aligned -value -this -size -should -be -atomic -even -/ -/ -without -using -std -: -: -atomic -but -doing -this -explicitly -provides -a -good -/ -/ -reminder -that -this -is -accessed -from -multiple -threads -. -std -: -: -atomic -< -mozilla -: -: -hal -: -: -ProcessPriority -> -mCachedPriority -= -mozilla -: -: -hal -: -: -PROCESS_PRIORITY_UNKNOWN -; nsCOMPtr < nsIThread @@ -1289,17 +1183,6 @@ const ; # ifdef -XP_WIN -UINT -ComputeDesiredTimerPeriod -( -) -const -; -# -endif -# -ifdef DEBUG / /