<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - REGRESSION (r188642): All pages are blank when printing a webpage in iOS Safari"
   href="https://bugs.webkit.org/show_bug.cgi?id=157924#c6">Comment # 6</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - REGRESSION (r188642): All pages are blank when printing a webpage in iOS Safari"
   href="https://bugs.webkit.org/show_bug.cgi?id=157924">bug 157924</a>
              from <span class="vcard"><a class="email" href="mailto:fpizlo&#64;apple.com" title="Filip Pizlo &lt;fpizlo&#64;apple.com&gt;"> <span class="fn">Filip Pizlo</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=157924#c5">comment #5</a>)
<span class="quote">&gt; (In reply to <a href="show_bug.cgi?id=157924#c4">comment #4</a>)
&gt; &gt; There are two issues I think:
&gt; &gt; 
&gt; &gt; 1) The functional style would have you let WTF::Condition do the time math
&gt; &gt; for you.  Instead of having a wait loop, do:
&gt; &gt; 
&gt; &gt; m_condition.waitFor(m_lock, timeout, [&amp;] () -&gt; bool { loop body });
&gt; 
&gt; Unfortunately this would just move the overflow into
&gt; Condition::absoluteFromRelative(), where have these two lines:
&gt; 
&gt;     Clock::duration myRelativeTimeout =
&gt;         std::chrono::duration_cast&lt;Clock::duration&gt;(relativeTimeout);
&gt; 
&gt;     return Clock::now() + myRelativeTimeout;
&gt; 
&gt; libc++ represents both nanoseconds and milliseconds using the same type
&gt; (long long), so the duration_cast will overflow trying to convert the
&gt; largest long long into an even larger number of nanosecond ticks. Now we're
&gt; right back where we started, subtracting from Clock::now() instead of adding.</span >

Can you file a bug about that? :-)

<span class="quote">&gt; 
&gt; &gt; 
&gt; &gt; 2) The style that I've been settling on is to just use doubles for time. 
&gt; &gt; Maybe when I have time to mess around I'll propose that we do this.  I've
&gt; &gt; encountered so many bugs due to std::chrono having overflows where our old
&gt; &gt; double-based time code would have recovered like a champ.  In fact, one of
&gt; &gt; those overflows was in GCC's version of libstdc++!  It would cause some uses
&gt; &gt; of std::condition_variable to freak out on Linux but not anywhere else.
&gt; &gt; 
&gt; &gt; In this case, we could just go back to using a double timeout. 
&gt; &gt; waitForSeconds(+Inf) should correctly cause our code to recognize that you
&gt; &gt; want to timeout forever.
&gt; &gt; 
&gt; &gt; I'm also fine with Geoff's proposed solution.
&gt; 
&gt; Yeah, this is basically what I proposed doing in Radar, although now Geoff
&gt; made me realize that my patch has a totally unnecessary subtraction in it!
&gt; 
&gt; Thanks for the feedback, Geoff and Phil.</span ></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>