<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&#64;igalia.com" title="Carlos Garcia Campos &lt;cgarcia&#64;igalia.com&gt;"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=266196&amp;action=diff" name="attach_266196" title="Patch">attachment 266196</a> <a href="attachment.cgi?id=266196&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=266196&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=266196&amp;action=review</a>

<span class="quote">&gt;&gt;&gt; Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp:80
&gt;&gt;&gt; +        g_source_set_ready_time(timeoutSource(), g_get_monotonic_time() + std::chrono::duration_cast&lt;std::chrono::microseconds&gt;(std::chrono::duration&lt;double&gt;(timeout)).count());
&gt;&gt; 
&gt;&gt; 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.
&gt; 
&gt; 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.
&gt; 
&gt; 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>