RESOLVED FIXED 118598
[WK2][Soup] Use didReceiveBuffer instead of didReceiveData
https://bugs.webkit.org/show_bug.cgi?id=118598
Summary [WK2][Soup] Use didReceiveBuffer instead of didReceiveData
Kwang Yul Seo
Reported 2013-07-12 05:52:43 PDT
Use didReceiveBuffer introduced in Bug 112310.
Attachments
Patch (13.31 KB, patch)
2013-07-12 07:17 PDT, Kwang Yul Seo
no flags
Patch (14.50 KB, patch)
2013-10-11 06:48 PDT, Csaba Osztrogonác
no flags
Patch (23.69 KB, patch)
2013-12-09 00:42 PST, Martin Robinson
no flags
Patch (23.96 KB, patch)
2013-12-09 01:02 PST, Martin Robinson
gustavo: review+
Kwang Yul Seo
Comment 1 2013-07-12 07:17:25 PDT
Gustavo Noronha (kov)
Comment 2 2013-07-15 08:14:14 PDT
Comment on attachment 206544 [details] Patch As discussed in bug 118448, the other approach (using didReceiveData) seems to be more sound for soup, since we already use a data pointer and length instead of a buffer object. Wrapping the data in SoupBuffer just adds unnecessary churn and complexity. I took it from what Brady said that he'd be OK with our having didReceiveData in our own NetworkResourceLoaderSoup.cpp, right? I'm setting r- for that reason, we can re-visit if there is actually opposition to the patch from bug 118448.
Kwang Yul Seo
Comment 3 2013-07-15 08:47:14 PDT
(In reply to comment #2) > (From update of attachment 206544 [details]) > As discussed in bug 118448, the other approach (using didReceiveData) seems to be more sound for soup, since we already use a data pointer and length instead of a buffer object. Wrapping the data in SoupBuffer just adds unnecessary churn and complexity. I took it from what Brady said that he'd be OK with our having didReceiveData in our own NetworkResourceLoaderSoup.cpp, right? I'm setting r- for that reason, we can re-visit if there is actually opposition to the patch from bug 118448. I agree. This approach makes sense only when we use a signal like "got-chunk" which gives us a buffer object instead of a data pointer length. Otherwise it just adds unnecessary complexity. I will revisit this approach after we solve the problem Sergio mentioned https://bugs.webkit.org/show_bug.cgi?id=118448#c12
Kwang Yul Seo
Comment 4 2013-07-25 16:54:34 PDT
Closing this bug as invalid in favor of Bug 118448.
Csaba Osztrogonác
Comment 5 2013-10-10 07:58:08 PDT
Reopen, because we have to use didReceiveBuffer, there is no choice. See https://bugs.webkit.org/show_bug.cgi?id=118448#c32 for details.
Csaba Osztrogonác
Comment 6 2013-10-11 06:23:19 PDT
Comment on attachment 206544 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=206544&action=review > Source/WebCore/platform/SharedBuffer.cpp:318 > -#if !USE(CF) || PLATFORM(QT) > +#if !(USE(CF) || USE(SOUP)) || PLATFORM(QT) It should be updated, because Qt was removed from trunk.
Csaba Osztrogonác
Comment 7 2013-10-11 06:48:31 PDT
Created attachment 213986 [details] Patch Updated to the ToT with the following minor changes: resolved a trivial conflict in Source/WebCore/platform/SharedBuffer.cpp after Qt removal, initialized destination variable in SharedBuffer.cpp (-Wmaybe-uninitialized), added the new SharedBufferSoup.cpp to PlatformGTK.cmake too. It builds and works for me (at least on EFL MiniBrowser)
Csaba Osztrogonác
Comment 8 2013-10-14 10:11:43 PDT
(In reply to comment #2) > (From update of attachment 206544 [details]) > As discussed in bug 118448, the other approach (using didReceiveData) seems to be more sound for soup, since we already use a data pointer and length instead of a buffer object. Wrapping the data in SoupBuffer just adds unnecessary churn and complexity. I took it from what Brady said that he'd be OK with our having didReceiveData in our own NetworkResourceLoaderSoup.cpp, right? I'm setting r- for that reason, we can re-visit if there is actually opposition to the patch from bug 118448. There was strong objection in https://bugs.webkit.org/show_bug.cgi?id=118448#c32, so could you revisit this bug, please?
Gustavo Noronha (kov)
Comment 9 2013-10-16 01:48:23 PDT
Comment on attachment 213986 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=213986&action=review Looks good in general but we should probably deal with the external buffer in a different way. I can give that a go early next week if you don't beat me to it. > Source/WebCore/platform/network/soup/GOwnPtrSoup.h:23 > +#include <libsoup/soup.h> can you use a typedef forward-declaration like the one we have for the other soup types? > Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:1337 > + SoupBuffer* buffer = soup_buffer_new(d->m_useExternalReadBuffer ? SOUP_MEMORY_COPY : SOUP_MEMORY_TAKE, d->m_readBufferPtr, bytesRead); > + handle->client()->didReceiveBuffer(handle.get(), SharedBuffer::wrapSoupBuffer(buffer), bytesRead); The reason why we originally added the 'external buffer' thing was to avoid any copying from the http backend to the media player backend (memcpy may be surprisingly slow in some systems). This breaks that, and I guess a copy is something we'll have to live with in the network process future. So I'm wondering if it still makes sense to keep the external buffer stuff in, or if we should just resimplify this by tearing it out.
Martin Robinson
Comment 10 2013-12-09 00:42:58 PST
EFL EWS Bot
Comment 11 2013-12-09 00:51:55 PST
EFL EWS Bot
Comment 12 2013-12-09 00:58:03 PST
Martin Robinson
Comment 13 2013-12-09 01:02:23 PST
Sergio Villar Senin
Comment 14 2013-12-09 04:27:16 PST
Comment on attachment 218734 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=218734&action=review Looks great to me > Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:150 > + } Shouldn't we keep this for non-NetworkProcess usage?
Gustavo Noronha (kov)
Comment 15 2013-12-09 04:33:00 PST
Comment on attachment 218734 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=218734&action=review >> Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp:150 >> + } > > Shouldn't we keep this for non-NetworkProcess usage? We would need to have #ifdefed code in our ResourceHandle implementation to use it in that case, I don't think it's worth the maintenance cost.
Gustavo Noronha (kov)
Comment 16 2013-12-09 04:40:02 PST
Comment on attachment 218734 [details] Patch Let's do this!
Martin Robinson
Comment 17 2013-12-09 06:07:28 PST
Note You need to log in before you can comment on or make changes to this bug.