Summary: | [WTF] Clean up RunLoop and WorkQueue with Seconds and Function | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||||||
Component: | New Bugs | Assignee: | 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
Yusuke Suzuki
2017-03-12 21:08:07 PDT
Created attachment 304220 [details]
Patch
Comment on attachment 304220 [details]
Patch
Thanks!
Comment on attachment 304220 [details] Patch Clearing flags on attachment: 304220 Committed r213858: <http://trac.webkit.org/changeset/213858> All reviewed patches have been landed. Closing bug. 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 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. Reopening to attach new patch. Created attachment 304372 [details]
Patch
Created attachment 304373 [details]
Patch
Comment on attachment 304373 [details]
Patch
This looks good to me. Thanks.
Committed r213896: <http://trac.webkit.org/changeset/213896> |