[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:57:21 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=143872

--- Comment #13 from Carlos Garcia Campos <cgarcia at igalia.com> ---
(In reply to comment #12)
> Comment on attachment 251154 [details]
> 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.

Please note that this is a first implementation of a feature that is disabled, it's a first step to continue working on it.

> > Source/WebCore/platform/network/soup/GRefPtrSoup.cpp:24
> > +template <> SoupBuffer* refGPtr(SoupBuffer* ptr)
> 
> Nit: Do you mind using 'buffer' here instead of 'ptr'?

Sure, we use ptr in all GRefPtrFoo implementations, though.

> > 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.

I'm not sure I get what you mean.

> > Source/WebKit2/NetworkProcess/cache/NetworkCacheDataSoup.cpp:94
> > +    uint8_t* data = static_cast<uint8_t*>(g_malloc(size));
> 
> Ditto.

Soup uses g_free unconditionally, so when it takes the memory it needs to be allocated with g_malloc(). 

> > 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.

It can be used, but I didn't care about that yet, I don't even know if those errors are actually handled, or just used to check whether it failed or not.

> > Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:144
> > +    gssize bytesRead;
> 
> This can move into the do-while loop, I think.

Yes, I think the first impl used that in the while comparison.

> > 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/459113a2/attachment-0001.html>


More information about the webkit-unassigned mailing list