RESOLVED FIXED 170656
Drop Timer::startRepeating() overload taking a double
https://bugs.webkit.org/show_bug.cgi?id=170656
Summary Drop Timer::startRepeating() overload taking a double
Chris Dumez
Reported 2017-04-09 10:12:02 PDT
Drop Timer::startRepeating() overload taking a double as people should use Seconds type now.
Attachments
Patch (36.73 KB, patch)
2017-04-09 10:14 PDT, Chris Dumez
no flags
Patch (36.75 KB, patch)
2017-04-09 10:29 PDT, Chris Dumez
no flags
Patch (37.35 KB, patch)
2017-04-09 10:51 PDT, Chris Dumez
no flags
Patch (37.24 KB, patch)
2017-04-09 14:35 PDT, Chris Dumez
no flags
Patch (37.25 KB, patch)
2017-04-09 14:51 PDT, Chris Dumez
no flags
Patch (37.25 KB, patch)
2017-04-09 15:22 PDT, Chris Dumez
no flags
Patch (37.25 KB, patch)
2017-04-09 15:49 PDT, Chris Dumez
no flags
Patch (37.21 KB, patch)
2017-04-09 15:58 PDT, Chris Dumez
no flags
Follow-up fix (1.10 KB, patch)
2017-04-10 19:38 PDT, Chris Dumez
ysuzuki: review+
Chris Dumez
Comment 1 2017-04-09 10:14:29 PDT
Chris Dumez
Comment 2 2017-04-09 10:29:07 PDT
Chris Dumez
Comment 3 2017-04-09 10:51:58 PDT
Yusuke Suzuki
Comment 4 2017-04-09 14:11:43 PDT
Comment on attachment 306626 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=306626&action=review r=me with nits > Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:91 > + m_requestFrameTimer.startRepeating(Seconds { 1. / m_frameRequestRate.value() }); I like `1_s / m_frameRequestRate.value()` rather. > Source/WebCore/page/Frame.cpp:124 > +const Seconds scrollFrequency { 1000 / 60. }; Ditto. I think `1000_s / 60` is more descriptive. > Source/WebCore/page/WheelEventTestTrigger.cpp:63 > + m_testTriggerTimer.startRepeating(Seconds { 1. / 60 }); Ditto. > Source/WebCore/platform/cocoa/ScrollController.mm:389 > + m_snapRubberbandTimer.startRepeating(Seconds { 1. / 60 }); Ditto. > Source/WebCore/platform/cocoa/ScrollController.mm:565 > + m_scrollSnapTimer.startRepeating(Seconds { 1. / 60 }); Ditto. > Source/WebCore/rendering/RenderMarquee.cpp:171 > + m_timer.startRepeating(Seconds { speed() * 0.001 }); I think `1_ms * speed()` is better. > Source/WebCore/rendering/RenderMarquee.cpp:233 > + m_timer.startRepeating(Seconds { speed() * 0.001 }); Ditto.
Simon Fraser (smfr)
Comment 5 2017-04-09 14:34:01 PDT
Comment on attachment 306626 [details] Patch I agree with the comments.
Chris Dumez
Comment 6 2017-04-09 14:35:16 PDT
Chris Dumez
Comment 7 2017-04-09 14:35:56 PDT
Yes, much nicer indeed. Thank you.
Chris Dumez
Comment 8 2017-04-09 14:51:05 PDT
Chris Dumez
Comment 9 2017-04-09 15:22:26 PDT
Yusuke Suzuki
Comment 10 2017-04-09 15:44:35 PDT
I think annotating Seconds' members & operators with constexpr will solve the compiling issue.
Chris Dumez
Comment 11 2017-04-09 15:49:35 PDT
Chris Dumez
Comment 12 2017-04-09 15:58:57 PDT
Chris Dumez
Comment 13 2017-04-09 16:42:07 PDT
Comment on attachment 306635 [details] Patch Clearing flags on attachment: 306635 Committed r215167: <http://trac.webkit.org/changeset/215167>
Chris Dumez
Comment 14 2017-04-09 16:42:09 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 15 2017-04-10 18:35:50 PDT
Comment on attachment 306635 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=306635&action=review > Source/WebCore/rendering/RenderThemeGtk.cpp:1817 > - return time / 2000.; > + return 2_ms * time; That’s not right. It should be be 1/2 ms, not 2 ms.
Chris Dumez
Comment 16 2017-04-10 19:38:00 PDT
Created attachment 306769 [details] Follow-up fix
Chris Dumez
Comment 17 2017-04-10 19:38:22 PDT
(In reply to Darin Adler from comment #15) > Comment on attachment 306635 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=306635&action=review > > > Source/WebCore/rendering/RenderThemeGtk.cpp:1817 > > - return time / 2000.; > > + return 2_ms * time; > > That’s not right. It should be be 1/2 ms, not 2 ms. Thank you, will fix.
Chris Dumez
Comment 18 2017-04-10 19:46:58 PDT
Reopen to fix bad change.
Yusuke Suzuki
Comment 19 2017-04-10 21:30:47 PDT
Comment on attachment 306769 [details] Follow-up fix View in context: https://bugs.webkit.org/attachment.cgi?id=306769&action=review r=me > Source/WebCore/rendering/RenderThemeGtk.cpp:1817 > + return 1_ms * time / 2.; `500_ns * time` could be simpler, but the both are ok to me.
Chris Dumez
Comment 20 2017-04-10 22:43:13 PDT
(In reply to Yusuke Suzuki from comment #19) > Comment on attachment 306769 [details] > Follow-up fix > > View in context: > https://bugs.webkit.org/attachment.cgi?id=306769&action=review > > r=me > > > Source/WebCore/rendering/RenderThemeGtk.cpp:1817 > > + return 1_ms * time / 2.; > > `500_ns * time` could be simpler, but the both are ok to me. Assuming you mean 500_us * time.
Chris Dumez
Comment 21 2017-04-10 22:46:37 PDT
Note You need to log in before you can comment on or make changes to this bug.