<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Network Cache: Deduplicate body data"
   href="https://bugs.webkit.org/show_bug.cgi?id=143652#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Network Cache: Deduplicate body data"
   href="https://bugs.webkit.org/show_bug.cgi?id=143652">bug 143652</a>
              from <span class="vcard"><a class="email" href="mailto:cdumez&#64;apple.com" title="Chris Dumez &lt;cdumez&#64;apple.com&gt;"> <span class="fn">Chris Dumez</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=250632&amp;action=diff" name="attach_250632" title="patch">attachment 250632</a> <a href="attachment.cgi?id=250632&amp;action=edit" title="patch">[details]</a></span>
patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=250632&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=250632&amp;action=review</a>

<span class="quote">&gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:37
&gt; +#if ENABLE(NETWORK_CACHE)</span >

Usually between the main header include (#include &quot;NetworkCacheBlobStorage.h&quot;) and the remaining includes (#include &quot;Logging.h&quot; ...)

<span class="quote">&gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:43
&gt; +    : m_blobDirectoryPath(blobDirectoryPath.utf8())</span >

Why are we storing the path as a CString when we always use it as a String? I am guessing this has to do with thread-safety somehow?

<span class="quote">&gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:60
&gt; +            unlink(filePath.data());</span >

Why aren't we using WebCore::deleteFile()?

<span class="quote">&gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:85
&gt; +    unlink(linkPath.data());</span >

Why aren't we using WebCore::deleteFile()?

<span class="quote">&gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:87
&gt; +    bool blobExists = access(blobPath.data(), F_OK) != -1;</span >

WebCore::fileExists() ?

<span class="quote">&gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:94
&gt; +        unlink(blobPath.data());</span >

WebCore::deleteFile()?

<span class="quote">&gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:144
&gt; +    unlink(linkPath.data());</span >

WebCore::deleteFile()?

<span class="quote">&gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:155
&gt; +    return stat.st_nlink - 1;</span >

Why the - 1 ? Maybe add a comment for clarity.

<span class="quote">&gt; Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:310
&gt; +static Data encodeRecordHeader(const Storage::Record&amp; record, SHA1::Digest bodyHash)</span >

Why are we copying the Digest? (it is an std::array&lt;uint8_t, 20&gt;).</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>