Bug 170659 - Drop Timer::startOneShot() overload taking a double
Summary: Drop Timer::startOneShot() overload taking a double
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-09 16:20 PDT by Chris Dumez
Modified: 2017-04-10 01:02 PDT (History)
5 users (show)

See Also:


Attachments
Patch (146.59 KB, patch)
2017-04-09 21:58 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (146.58 KB, patch)
2017-04-09 22:07 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (146.56 KB, patch)
2017-04-09 22:14 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (146.54 KB, patch)
2017-04-09 22:19 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (147.09 KB, patch)
2017-04-09 22:31 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (147.00 KB, patch)
2017-04-09 22:38 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (147.39 KB, patch)
2017-04-09 22:44 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (147.58 KB, patch)
2017-04-09 23:06 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2017-04-09 16:20:33 PDT
Drop Timer::startOneShot() overload taking a double as people should use Seconds type now.
Comment 1 Chris Dumez 2017-04-09 21:58:32 PDT
Created attachment 306650 [details]
Patch
Comment 2 Chris Dumez 2017-04-09 22:07:46 PDT
Created attachment 306652 [details]
Patch
Comment 3 Chris Dumez 2017-04-09 22:14:38 PDT
Created attachment 306653 [details]
Patch
Comment 4 Chris Dumez 2017-04-09 22:19:08 PDT
Created attachment 306654 [details]
Patch
Comment 5 Chris Dumez 2017-04-09 22:31:29 PDT
Created attachment 306655 [details]
Patch
Comment 6 Chris Dumez 2017-04-09 22:38:27 PDT
Created attachment 306656 [details]
Patch
Comment 7 Chris Dumez 2017-04-09 22:44:06 PDT
Created attachment 306659 [details]
Patch
Comment 8 Chris Dumez 2017-04-09 23:06:43 PDT
Created attachment 306661 [details]
Patch
Comment 9 Yusuke Suzuki 2017-04-10 00:34:37 PDT
Comment on attachment 306661 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=306661&action=review

r=me with future clean up suggestion. Basically, I think `1_s * xxx` should be removed in the future.

> Source/WebCore/page/EventSource.cpp:141
> +    m_connectTimer.startOneShot(1_ms * m_reconnectDelay);

Nice.

> Source/WebCore/platform/ScrollAnimationSmooth.cpp:403
> +    Seconds deltaToNextFrame = 1_s * ceil((currentTime - m_startTime).value() * frameRate) / frameRate - (currentTime - m_startTime);

Looking the code, I think ceil, round, floor etc. overloading for Seconds would be nice.
We already have several overloading functions, like, isnan, isinf, isfinite for Seconds.

> Source/WebCore/platform/graphics/BitmapImage.cpp:342
> +    m_desiredFrameStartTime = std::max(time, m_desiredFrameStartTime + Seconds { frameDurationAtIndex(m_currentFrame) });

In a separate patch, we should return Seconds from frameDurationAtIndex.

> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:774
> +        d->m_timeoutSource.startOneShot(1_s * d->m_firstRequest.timeoutInterval());

In a separate patch, we should change this timeoutInterval() to Seconds.

> Source/WebCore/replay/EventLoopInputDispatcher.cpp:121
> +    m_timer.startOneShot(1_s * waitInterval);

In a separate patch, we should change this waitInterval (and related ones) to Seconds.

> Source/WebKit/mac/Plugins/WebNetscapePluginView.mm:133
> +        Seconds timeInterval = 1_ms * m_interval;

In a separate patch, we should change this m_interval to Seconds.

> Source/WebKit/mac/Storage/WebStorageManager.mm:118
>  + (void)setStorageDatabaseIdleInterval:(double)interval

In a separate patch, we should change this interval to Seconds.

> Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:155
>          nextUpdateTime = std::max((1 / targetFPS) - (monotonicallyIncreasingTime() - m_lastUpdateTime), 0.0);

In a separate patch, we should change this m_lastUpdateTime to MonotonicTime and change nextUpdateTime to Seconds.

> Source/WebKit2/Shared/WebMemorySampler.cpp:91
>      m_sampleTimer.startRepeating(1_s);

In a separate patch, we should chnage this initializeTimers's double to Seconds.
Comment 10 WebKit Commit Bot 2017-04-10 01:02:26 PDT
Comment on attachment 306661 [details]
Patch

Clearing flags on attachment: 306661

Committed r215173: <http://trac.webkit.org/changeset/215173>
Comment 11 WebKit Commit Bot 2017-04-10 01:02:28 PDT
All reviewed patches have been landed.  Closing bug.