<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@igalia.com" title="Carlos Garcia Campos <cgarcia@igalia.com>"> <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">> Comment on <span class=""><a href="attachment.cgi?id=254561&action=diff" name="attach_254561" title="Patch">attachment 254561</a> <a href="attachment.cgi?id=254561&action=edit" title="Patch">[details]</a></span>
> Patch
>
> View in context:
> <a href="https://bugs.webkit.org/attachment.cgi?id=254561&action=review">https://bugs.webkit.org/attachment.cgi?id=254561&action=review</a>
>
> > Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:119
> > + auto asyncData = std::unique_ptr<ReadAsyncData>(asyncDataPtr);
>
> This can be just
>
> std::unique_ptr<ReadAsyncData> asyncData(asyncDataPtr);
>
> Same for the rest of such statements.</span >
Ok, no much difference anyway.
<span class="quote">> > Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:188
> > + Data data;
> > + completionHandler(data, -1);
>
> You could probably just construct the Data object in the completionHandler
> call:
>
> completionHandler(Data(), -1);</span >
No, that doesn't build.
no known conversion for argument 1 from ‘WebKit::NetworkCache::Data’ to ‘WebKit::NetworkCache::Data&’
<span class="quote">> > Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:191
> > + g_cond_wait(&condition, &mutex);
>
> 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">> 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.
>
> > Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:223
> > g_cond_wait(&condition, &mutex);
>
> 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>