<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [SOUP] Add initial implementation of NetworkProcess disk cache"
   href="https://bugs.webkit.org/show_bug.cgi?id=143872#c15">Comment # 15</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [SOUP] Add initial implementation of NetworkProcess disk cache"
   href="https://bugs.webkit.org/show_bug.cgi?id=143872">bug 143872</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=143872#c14">comment #14</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=251154&amp;action=diff" name="attach_251154" title="Another update">attachment 251154</a> <a href="attachment.cgi?id=251154&amp;action=edit" title="Another update">[details]</a></span>
&gt; Another update
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=251154&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=251154&amp;action=review</a>
&gt; 
&gt; &gt;&gt;&gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheDataSoup.cpp:41
&gt; &gt;&gt;&gt; +    : m_buffer(adoptGRef(soup_buffer_new(SOUP_MEMORY_COPY, data, size)))
&gt; &gt;&gt; 
&gt; &gt;&gt; We should probably discuss whether we want to use the WebKit memory allocator.
&gt; &gt; 
&gt; &gt; I'm not sure I get what you mean.
&gt; 
&gt; I'm simply suggesting that it might be worth it to use bmalloc here and then
&gt; to free the memory properly by using soup_buffer_new_with_owner instead.</span >

Ah, ok, I thought you were suggesting to replace soup buffer somehow.

<span class="quote">&gt; &gt;&gt;&gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheDataSoup.cpp:94
&gt; &gt;&gt;&gt; +    uint8_t* data = static_cast&lt;uint8_t*&gt;(g_malloc(size));
&gt; &gt;&gt; 
&gt; &gt;&gt; Ditto.
&gt; &gt; 
&gt; &gt; Soup uses g_free unconditionally, so when it takes the memory it needs to be allocated with g_malloc().
&gt; 
&gt; We would need to use soup_buffer_new_with_owner.</span >

Got it.

<span class="quote">&gt; &gt;&gt;&gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:101
&gt; &gt;&gt;&gt; +    }
&gt; &gt;&gt; 
&gt; &gt;&gt; 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.
&gt; &gt; 
&gt; &gt; 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.
&gt; 
&gt; Hrm. Isn't the first enum member of GFileError (G_FILE_ERROR_EXIST) defined
&gt; to be 0?</span >

My point is that I haven't cared about the actual error codes at this point because the caller use the error as a boolean (just to check whether it failed) or for the debug logs, so it doesn't really matter.</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>