Bug 169537

Summary: [WTF] Clean up RunLoop and WorkQueue with Seconds and Function
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, commit-queue, dbates, keith_miller, mark.lam, msaboff, saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch cgarcia: review+

Yusuke Suzuki
Reported 2017-03-12 21:08:07 PDT
[WTF] Clean up RunLoop and WorkQueue with Seconds and Function
Attachments
Patch (27.10 KB, patch)
2017-03-12 21:09 PDT, Yusuke Suzuki
no flags
Patch (4.12 KB, patch)
2017-03-14 04:52 PDT, Yusuke Suzuki
no flags
Patch (8.92 KB, patch)
2017-03-14 05:38 PDT, Yusuke Suzuki
cgarcia: review+
Yusuke Suzuki
Comment 1 2017-03-12 21:09:42 PDT
Yusuke Suzuki
Comment 2 2017-03-13 11:27:21 PDT
Comment on attachment 304220 [details] Patch Thanks!
WebKit Commit Bot
Comment 3 2017-03-13 11:56:58 PDT
Comment on attachment 304220 [details] Patch Clearing flags on attachment: 304220 Committed r213858: <http://trac.webkit.org/changeset/213858>
WebKit Commit Bot
Comment 4 2017-03-13 11:57:05 PDT
All reviewed patches have been landed. Closing bug.
Carlos Garcia Campos
Comment 5 2017-03-14 04:05:11 PDT
Comment on attachment 304220 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=304220&action=review > Source/WTF/wtf/glib/RunLoopGLib.cpp:-198 > - auto intervalDuration = std::chrono::duration<double>(fireInterval); > - auto safeDuration = std::chrono::microseconds::max(); > - if (intervalDuration < safeDuration) > - safeDuration = std::chrono::duration_cast<std::chrono::microseconds>(intervalDuration); Something like this is still needed. GSoure works with microseconds, when std::numeric_limits<double>::infinity() is passed here (like XMLHttpRequest does to disable network timeouts), we will overflow later when trying to convert infinity to microseconds
Carlos Garcia Campos
Comment 6 2017-03-14 04:18:46 PDT
Comment on attachment 304220 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=304220&action=review > Source/WTF/wtf/cocoa/WorkQueueCocoa.cpp:42 > - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, duration.count()), m_dispatchQueue, BlockPtr<void ()>::fromCallable([protectedThis = makeRef(*this), function = WTFMove(function)] { > + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, duration.nanoseconds()), m_dispatchQueue, BlockPtr<void()>::fromCallable([protectedThis = makeRef(*this), function = WTFMove(function)] { This could also overflow now, I think. It doesn't probably happen because dispatchAfter is never called with infinity or a long enough value.
Yusuke Suzuki
Comment 7 2017-03-14 04:52:10 PDT
Reopening to attach new patch.
Yusuke Suzuki
Comment 8 2017-03-14 04:52:15 PDT
Yusuke Suzuki
Comment 9 2017-03-14 05:38:04 PDT
Carlos Garcia Campos
Comment 10 2017-03-14 06:09:56 PDT
Comment on attachment 304373 [details] Patch This looks good to me. Thanks.
Yusuke Suzuki
Comment 11 2017-03-14 06:21:07 PDT
Note You need to log in before you can comment on or make changes to this bug.