[Webkit-unassigned] [Bug 151632] [GTK] Remove the remaining uses of GMainLoopSource

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 27 08:33:53 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=151632

--- Comment #5 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 266196
  --> https://bugs.webkit.org/attachment.cgi?id=266196
Patch

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

>>> Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp:80
>>> +        g_source_set_ready_time(timeoutSource(), g_get_monotonic_time() + std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::duration<double>(timeout)).count());
>> 
>> That summation can overflow. It likely won't, but it's possible. Also, using std::chrono also maybe isn't a requirement here, G_USEC_PER_SEC would work just fine.
> 
> The complete overflow protection (the one that roundtrips to std::chrono::microseconds) could be abstracted and put in WTF, in a small header. It's now used in maybe 5 places in the code.
> 
> Otherwise the patch looks fine.

I didn't add the overflow check because here the timeout is a fixed value, not something calculated, but I agree it would be better to move it a common place and use it everywhere else. Thanks for the review.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20151127/ed6bdfc7/attachment-0001.html>


More information about the webkit-unassigned mailing list