WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 170625
Start using MonotonicTime / Seconds in Timer class
https://bugs.webkit.org/show_bug.cgi?id=170625
Summary
Start using MonotonicTime / Seconds in Timer class
Chris Dumez
Reported
2017-04-07 16:13:47 PDT
Start using MonotonicTime / Seconds in Timer class.
Attachments
Patch
(26.45 KB, patch)
2017-04-07 16:16 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(27.75 KB, patch)
2017-04-07 17:03 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2017-04-07 16:16:41 PDT
Created
attachment 306546
[details]
Patch
Simon Fraser (smfr)
Comment 2
2017-04-07 16:55:58 PDT
Comment on
attachment 306546
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=306546&action=review
> Source/WebCore/page/SuspendableTimer.cpp:118 > + m_savedRepeatInterval = Seconds { 0 };
0_s
> Source/WebCore/page/SuspendableTimer.cpp:128 > return 0;
Why not change this function to return a Seconds?
> Source/WebCore/page/SuspendableTimer.cpp:140 > + m_savedRepeatInterval = Seconds { 0 };
0_s
> Source/WebCore/platform/ThreadTimers.cpp:46 > +static const Seconds maxDurationOfFiringTimers { 0.050 };
50_ms
> Source/WebCore/platform/ThreadTimers.cpp:92 > + m_sharedTimer->setFireInterval(std::max(nextFireTime - currentMonotonicTime, Seconds { }));
0_s
> Source/WebCore/platform/ThreadTimers.cpp:122 > + if (!m_firingTimers || timeToQuit < MonotonicTime::now()) > break;
Should we capture MonotonicTime::now() outside the loop?
> Source/WebCore/platform/Timer.cpp:216 > + m_repeatInterval = Seconds { };
0_s
> Source/WebCore/platform/Timer.cpp:220 > + ASSERT(m_repeatInterval == Seconds { 0 });
0_s
> Source/WebCore/platform/Timer.cpp:224 > double TimerBase::nextFireInterval() const
Return a Seconds?
> Source/WebCore/platform/Timer.cpp:416 > + return std::max(m_unalignedNextFireTime - MonotonicTime::now(), Seconds { 0 });
0_s
> Source/WebCore/platform/Timer.h:68 > + void startOneShot(Seconds interval) { start(interval, Seconds { 0 }); }
0_s
Chris Dumez
Comment 3
2017-04-07 17:00:21 PDT
Will update the return values in a follow-up patch to keep patch size small.
Chris Dumez
Comment 4
2017-04-07 17:03:29 PDT
Created
attachment 306551
[details]
Patch
WebKit Commit Bot
Comment 5
2017-04-07 18:33:58 PDT
Comment on
attachment 306551
[details]
Patch Clearing flags on attachment: 306551 Committed
r215136
: <
http://trac.webkit.org/changeset/215136
>
WebKit Commit Bot
Comment 6
2017-04-07 18:33:59 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug