@@ -84,12 +84,12 @@ class RunLoop : public FunctionDispatcher {
8484 WTF_EXPORT_PRIVATE explicit TimerBase (RunLoop&);
8585 WTF_EXPORT_PRIVATE virtual ~TimerBase ();
8686
87- void startRepeating (double repeatInterval) { start (repeatInterval, true ); }
87+ void startRepeating (double repeatInterval) { startInternal (repeatInterval, true ); }
8888 void startRepeating (std::chrono::milliseconds repeatInterval) { startRepeating (repeatInterval.count () * 0.001 ); }
8989 void startRepeating (Seconds repeatInterval) { startRepeating (repeatInterval.value ()); }
90- void startOneShot (double interval) { start (interval, false ); }
91- void startOneShot (std::chrono::milliseconds interval) { start (interval.count () * 0.001 , false ); }
92- void startOneShot (Seconds interval) { start (interval.value (), false ); }
90+ void startOneShot (double interval) { startInternal (interval, false ); }
91+ void startOneShot (std::chrono::milliseconds interval) { startOneShot (interval.count () * 0.001 ); }
92+ void startOneShot (Seconds interval) { startOneShot (interval.value ()); }
9393
9494 WTF_EXPORT_PRIVATE void stop ();
9595 WTF_EXPORT_PRIVATE bool isActive () const ;
@@ -103,6 +103,11 @@ class RunLoop : public FunctionDispatcher {
103103#endif
104104
105105 private:
106+ void startInternal (double nextFireInterval, bool repeat)
107+ {
108+ start (std::max (nextFireInterval, 0.0 ), repeat);
109+ }
110+
106111 WTF_EXPORT_PRIVATE void start (double nextFireInterval, bool repeat);
107112
108113 Ref<RunLoop> m_runLoop;
0 commit comments