[Webkit-unassigned] [Bug 143872] [SOUP] Add initial implementation of NetworkProcess disk cache
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Apr 23 10:47:42 PDT 2015
https://bugs.webkit.org/show_bug.cgi?id=143872
--- Comment #12 from Martin Robinson <mrobinson at webkit.org> ---
Comment on attachment 251154
--> https://bugs.webkit.org/attachment.cgi?id=251154
Another update
View in context: https://bugs.webkit.org/attachment.cgi?id=251154&action=review
Looks good to me, but we should chat briefly about benefits and drawbacks of using WebKit's builtin memory manager.
> Source/WebCore/platform/network/soup/GRefPtrSoup.cpp:24
> +template <> SoupBuffer* refGPtr(SoupBuffer* ptr)
Nit: Do you mind using 'buffer' here instead of 'ptr'?
> Source/WebKit2/NetworkProcess/cache/NetworkCacheDataSoup.cpp:41
> + : m_buffer(adoptGRef(soup_buffer_new(SOUP_MEMORY_COPY, data, size)))
We should probably discuss whether we want to use the WebKit memory allocator.
> Source/WebKit2/NetworkProcess/cache/NetworkCacheDataSoup.cpp:94
> + uint8_t* data = static_cast<uint8_t*>(g_malloc(size));
Ditto.
> Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:101
> + if (bytesRead == -1) {
> + asyncData->completionHandler(asyncData->data, -1);
> + delete asyncData;
> + return;
> + }
It is annoying that GFileError cannot be used here for the error code, because the enum starts at zero. Perhaps a comment here about that could be informative.
> Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:144
> + gssize bytesRead;
This can move into the do-while loop, I think.
> Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:149
> + bytesRead = g_input_stream_read(m_inputStream.get(), const_cast<char*>(readBuffer->data), bytesToRead, nullptr, nullptr);
Same issue here with GFileError. :(
> Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:181
> + if (bytesWritten == -1) {
> + asyncData->completionHandler(-1);
> + delete asyncData;
> + return;
> + }
Ditto.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150423/3b81720d/attachment.html>
More information about the webkit-unassigned
mailing list