<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [SOUP] Network Cache: run the IO completion handler in the given queue instead of the whole operation"
   href="https://bugs.webkit.org/show_bug.cgi?id=145797#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [SOUP] Network Cache: run the IO completion handler in the given queue instead of the whole operation"
   href="https://bugs.webkit.org/show_bug.cgi?id=145797">bug 145797</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>(In reply to <a href="show_bug.cgi?id=145797#c3">comment #3</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=254561&amp;action=diff" name="attach_254561" title="Patch">attachment 254561</a> <a href="attachment.cgi?id=254561&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=254561&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=254561&amp;action=review</a>
&gt; 
&gt; &gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:119
&gt; &gt; +            auto asyncData = std::unique_ptr&lt;ReadAsyncData&gt;(asyncDataPtr);
&gt; 
&gt; This can be just
&gt; 
&gt;     std::unique_ptr&lt;ReadAsyncData&gt; asyncData(asyncDataPtr);
&gt; 
&gt; Same for the rest of such statements.</span >

Ok, no much difference anyway.

<span class="quote">&gt; &gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:188
&gt; &gt; +            Data data;
&gt; &gt; +            completionHandler(data, -1);
&gt; 
&gt; You could probably just construct the Data object in the completionHandler
&gt; call:
&gt; 
&gt;     completionHandler(Data(), -1);</span >

No, that doesn't build.

no known conversion for argument 1 from ‘WebKit::NetworkCache::Data’ to ‘WebKit::NetworkCache::Data&amp;’

<span class="quote">&gt; &gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:191
&gt; &gt; +        g_cond_wait(&amp;condition, &amp;mutex);
&gt; 
&gt; Can this function be called on the main thread, with a null queue?</span >

No this, is always called from a thread. I'll add an assert to ensure it.

<span class="quote">&gt; That would schedule the callback in the main context and continue to block
&gt; the main thread in g_cond_wait(), with the callback never invoked.
&gt; 
&gt; &gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:223
&gt; &gt;      g_cond_wait(&amp;condition, &amp;mutex);
&gt; 
&gt; Same problem here.</span >

Yes, we definitely don't want to block the main thread ever.</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>