<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:darin@apple.com" title="Darin Adler <darin@apple.com>"> <span class="fn">Darin Adler</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - NetworkCache: Delete old cache versions"
href="https://bugs.webkit.org/show_bug.cgi?id=145800">bug 145800</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #254568 Flags</td>
<td>review?
</td>
<td>review+
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - NetworkCache: Delete old cache versions"
href="https://bugs.webkit.org/show_bug.cgi?id=145800#c5">Comment # 5</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - NetworkCache: Delete old cache versions"
href="https://bugs.webkit.org/show_bug.cgi?id=145800">bug 145800</a>
from <span class="vcard"><a class="email" href="mailto:darin@apple.com" title="Darin Adler <darin@apple.com>"> <span class="fn">Darin Adler</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=254568&action=diff" name="attach_254568" title="patch">attachment 254568</a> <a href="attachment.cgi?id=254568&action=edit" title="patch">[details]</a></span>
patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=254568&action=review">https://bugs.webkit.org/attachment.cgi?id=254568&action=review</a>
Looks like this does not build on GTK yet.
<span class="quote">> Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystem.cpp:69
> + function(String(name), directoryEntryType(dp->d_type));</span >
Doing String(name) here interprets the filename as Latin-1. That’s not right. This needs to be the reverse of WebCore::fileSystemRepresentation. I see some code using String::fromUTF8 for this; openTemporaryFile on the Mac for example. This only works because we are lucky enough to not have any non-ASCII filenames in the directory. Of course, decoding UTF-8 has the inverse problem if there are some file names that we can’t represent as String. I suppose we have to just skip those files. This can’t happen in normal circumstances on OS X, but might happen in other cases on other platforms perhaps.
<span class="quote">> Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystem.h:57
> + function(String(name));</span >
Same String(name) issue here.
<span class="quote">> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:123
> + auto partitionPath = WebCore::pathByAppendingComponent(recordsPath, subdirName);
> + WebCore::deleteEmptyDirectory(partitionPath);</span >
Not sure the local variable makes this easier to read
<span class="quote">> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:878
> + String versionString = subdirName.substring(strlen(versionDirectoryPrefix));
> + bool success;
> + unsigned directoryVersion = versionString.toUIntStrict(&success);</span >
Should do this with a StringView. No need to copy out a new string just to convert to integer.</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>