<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#c3">Comment # 3</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:zan&#64;falconsigh.net" title="Zan Dobersek &lt;zan&#64;falconsigh.net&gt;"> <span class="fn">Zan Dobersek</span></a>
</span></b>
        <pre>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>
Patch

View in context: <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>

<span class="quote">&gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:119
&gt; +            auto asyncData = std::unique_ptr&lt;ReadAsyncData&gt;(asyncDataPtr);</span >

This can be just

    std::unique_ptr&lt;ReadAsyncData&gt; asyncData(asyncDataPtr);

Same for the rest of such statements.

<span class="quote">&gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:188
&gt; +            Data data;
&gt; +            completionHandler(data, -1);</span >

You could probably just construct the Data object in the completionHandler call:

    completionHandler(Data(), -1);

<span class="quote">&gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:191
&gt; +        g_cond_wait(&amp;condition, &amp;mutex);</span >

Can this function be called on the main thread, with a null queue?

That would schedule the callback in the main context and continue to block the main thread in g_cond_wait(), with the callback never invoked.

<span class="quote">&gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:223
&gt;      g_cond_wait(&amp;condition, &amp;mutex);</span >

Same problem here.</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>