<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: Implement ShareableResource for Soup and enable it for GTK platform"
href="https://bugs.webkit.org/show_bug.cgi?id=144380#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [SOUP] Network Cache: Implement ShareableResource for Soup and enable it for GTK platform"
href="https://bugs.webkit.org/show_bug.cgi?id=144380">bug 144380</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=144380#c2">comment #2</a>)
<span class="quote">> Comment on <span class=""><a href="attachment.cgi?id=251937&action=diff" name="attach_251937" title="Patch">attachment 251937</a> <a href="attachment.cgi?id=251937&action=edit" title="Patch">[details]</a></span>
> Patch
>
> View in context:
> <a href="https://bugs.webkit.org/attachment.cgi?id=251937&action=review">https://bugs.webkit.org/attachment.cgi?id=251937&action=review</a>
>
> > Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:130
> > - auto mappedData = Data::adoptMap(map, size);
> > + auto mappedData = Data::adoptMap(map, size, fd);
>
> It would be good to encapsulate the whole "create disk-backed map from
> existing Data" operation and make it a Data function.</span >
Ok.
<span class="quote">> > Source/WebKit2/NetworkProcess/cache/NetworkCacheData.h:42
> > namespace WebKit {
> > +class SharedMemory;
>
> empty line after namespace</span >
Sure.
<span class="quote">> > Source/WebKit2/NetworkProcess/cache/NetworkCacheDataCocoa.mm:112
> > Data mapFile(int fd, size_t offset, size_t size)
> > {
> > - if (!size)
> > + if (!size) {
> > + close(fd);
> > return Data::empty();
> > + }
>
> It is surprising this function now closes the file. At minimum it should be
> renamed to something like adoptAndMapFile. There are a bunch of clients that
> call this and close the file manually.</span >
I agree it's not that obvious that mapFile takes ownership of the fd. I think, I updated all callers to not close the fd, or what clients do you mean?
<span class="quote">> We really need better abstactions though.
>
> > Source/WebKit2/NetworkProcess/cache/NetworkCacheDataCocoa.mm:157
> > +RefPtr<SharedMemory> Data::createSharedMemory() const
>
> tryCreateSharedMemory?</span >
It makes sense, yes.
<span class="quote">> > Source/WebKit2/Shared/soup/ShareableResourceSoup.cpp:43
> > +PassRefPtr<SharedBuffer> ShareableResource::Handle::tryWrapInSharedBuffer() const
>
> Adding this Soup-specific stuff is going to make it harder to get rid of
> these ugly abstractions. :(</span >
Yes, this is because current tryWrapInSharedBuffer() method is CF specific, but implemented in the main cpp file. I just provided a soup implementation, but using its own platform file, I could move it to the cpp file though.</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>