<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&#64;igalia.com" title="Carlos Garcia Campos &lt;cgarcia&#64;igalia.com&gt;"> <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">&gt; Comment on <span class=""><a href="attachment.cgi?id=251937&amp;action=diff" name="attach_251937" title="Patch">attachment 251937</a> <a href="attachment.cgi?id=251937&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=251937&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=251937&amp;action=review</a>
&gt; 
&gt; &gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:130
&gt; &gt; -    auto mappedData = Data::adoptMap(map, size);
&gt; &gt; +    auto mappedData = Data::adoptMap(map, size, fd);
&gt; 
&gt; It would be good to encapsulate the whole &quot;create disk-backed map from
&gt; existing Data&quot; operation and make it a Data function.</span >

Ok.

<span class="quote">&gt; &gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheData.h:42
&gt; &gt;  namespace WebKit {
&gt; &gt; +class SharedMemory;
&gt; 
&gt; empty line after namespace</span >

Sure.

<span class="quote">&gt; &gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheDataCocoa.mm:112
&gt; &gt;  Data mapFile(int fd, size_t offset, size_t size)
&gt; &gt;  {
&gt; &gt; -    if (!size)
&gt; &gt; +    if (!size) {
&gt; &gt; +        close(fd);
&gt; &gt;          return Data::empty();
&gt; &gt; +    }
&gt; 
&gt; It is surprising this function now closes the file. At minimum it should be
&gt; renamed to something like adoptAndMapFile. There are a bunch of clients that
&gt; 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">&gt; We really need better abstactions though.
&gt; 
&gt; &gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheDataCocoa.mm:157
&gt; &gt; +RefPtr&lt;SharedMemory&gt; Data::createSharedMemory() const
&gt; 
&gt; tryCreateSharedMemory?</span >

It makes sense, yes.

<span class="quote">&gt; &gt; Source/WebKit2/Shared/soup/ShareableResourceSoup.cpp:43
&gt; &gt; +PassRefPtr&lt;SharedBuffer&gt; ShareableResource::Handle::tryWrapInSharedBuffer() const
&gt; 
&gt; Adding this Soup-specific stuff is going to make it harder to get rid of
&gt; 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>