[Webkit-unassigned] [Bug 143652] Network Cache: Deduplicate body data

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 13 09:49:28 PDT 2015


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

--- Comment #3 from Chris Dumez <cdumez at apple.com> ---
Comment on attachment 250632
  --> https://bugs.webkit.org/attachment.cgi?id=250632
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=250632&action=review

> Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:37
> +#if ENABLE(NETWORK_CACHE)

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

> Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:43
> +    : m_blobDirectoryPath(blobDirectoryPath.utf8())

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?

> Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:60
> +            unlink(filePath.data());

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

> Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:85
> +    unlink(linkPath.data());

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

> Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:87
> +    bool blobExists = access(blobPath.data(), F_OK) != -1;

WebCore::fileExists() ?

> Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:94
> +        unlink(blobPath.data());

WebCore::deleteFile()?

> Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:144
> +    unlink(linkPath.data());

WebCore::deleteFile()?

> Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp:155
> +    return stat.st_nlink - 1;

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

> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:310
> +static Data encodeRecordHeader(const Storage::Record& record, SHA1::Digest bodyHash)

Why are we copying the Digest? (it is an std::array<uint8_t, 20>).

-- 
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/20150413/b0810b99/attachment-0001.html>


More information about the webkit-unassigned mailing list