[Webkit-unassigned] [Bug 114696] Wrong use of REALTIME clock causes pages to fail loading

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 18 11:43:34 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=114696





--- Comment #9 from Anderson Fraga <anfraga at qnx.com>  2013-04-18 11:41:51 PST ---
(In reply to comment #8)
> (From update of attachment 198580 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=198580&action=review
> 
> > Source/WebCore/workers/WorkerRunLoop.cpp:56
> >  
> >      // SharedTimer interface.
> >      virtual void setFiredFunction(void (*function)()) { m_sharedTimerFunction = function; }
> > -    virtual void setFireInterval(double interval) { m_nextFireTime = interval + currentTime(); }
> > +    virtual void setFireInterval(double interval) { m_nextFireTime = interval + monotonicallyIncreasingTime(); }
> 
> Wait, but why is this correct?

This is setting up a timer to fire at a given time (which is currently set as interval + currentTime()). Because curretTime() is implemented with REALTIME clock, if the system time changes during the set up of the timer and before the timer expires, you will get the timer to expire before it is supposed to. Which will likely result in undesired behaviour.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list