<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] Remove the remaining uses of GMainLoopSource"
href="https://bugs.webkit.org/show_bug.cgi?id=151632#c5">Comment # 5</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] Remove the remaining uses of GMainLoopSource"
href="https://bugs.webkit.org/show_bug.cgi?id=151632">bug 151632</a>
from <span class="vcard"><a class="email" href="mailto:cgarcia@igalia.com" title="Carlos Garcia Campos <cgarcia@igalia.com>"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=266196&action=diff" name="attach_266196" title="Patch">attachment 266196</a> <a href="attachment.cgi?id=266196&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=266196&action=review">https://bugs.webkit.org/attachment.cgi?id=266196&action=review</a>
<span class="quote">>>> 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.</span >
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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>