<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[185412] trunk/Source/WebKit2</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/185412">185412</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2015-06-10 06:00:49 -0700 (Wed, 10 Jun 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>NetworkCache: Delete old cache versions
https://bugs.webkit.org/show_bug.cgi?id=145800

Reviewed by Darin Adler.

* CMakeLists.txt:
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
(WebKit::NetworkCache::BlobStorage::synchronize):
* NetworkProcess/cache/NetworkCacheFileSystem.cpp: Added.
(WebKit::NetworkCache::directoryEntryType):
(WebKit::NetworkCache::traverseDirectory):

    Pass entry type as callback argument.

(WebKit::NetworkCache::deleteDirectoryRecursively):

    Add helper.

(WebKit::NetworkCache::fileTimes):
(WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
* NetworkProcess/cache/NetworkCacheFileSystem.h: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h.

    Move code to cpp.

(WebKit::NetworkCache::traverseDirectory): Deleted.
(WebKit::NetworkCache::traverseCacheFiles): Deleted.
(WebKit::NetworkCache::fileTimes): Deleted.
(WebKit::NetworkCache::updateFileModificationTimeIfNeeded): Deleted.
* NetworkProcess/cache/NetworkCacheFileSystemPosix.h: Removed.
* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
* NetworkProcess/cache/NetworkCacheStatistics.cpp:
(WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::makeBlobDirectoryPath):
(WebKit::NetworkCache::traverseRecordsFiles):

    Move cache hierarchy aware traversal code here from NetworkCacheFileSystem (for better layering).
    Rename for clarity.

(WebKit::NetworkCache::deleteEmptyRecordsDirectories):

    Factor to a function.

(WebKit::NetworkCache::Storage::Storage):
(WebKit::NetworkCache::Storage::synchronize):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::Storage::clear):

    Use traverseRecordsFiles for traversal.

(WebKit::NetworkCache::Storage::shrink):
(WebKit::NetworkCache::Storage::deleteOldVersions):

    Delete version subdirectories with version number less than the current version.
    Remove code for clearing unversioned V1 caches. No one should have them.

* NetworkProcess/cache/NetworkCacheStorage.h:
* UIProcess/API/APIUserContentExtensionStore.cpp:
* WebKit2.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2CMakeListstxt">trunk/Source/WebKit2/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheBlobStoragecpp">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheIOChannelCocoamm">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheIOChannelSoupcpp">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheStatisticscpp">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheStoragecpp">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheStorageh">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIUserContentExtensionStorecpp">trunk/Source/WebKit2/UIProcess/API/APIUserContentExtensionStore.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheFileSystemcpp">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystem.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheFileSystemh">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystem.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheFileSystemPosixh">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2CMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/CMakeLists.txt (185411 => 185412)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt        2015-06-10 11:29:33 UTC (rev 185411)
+++ trunk/Source/WebKit2/CMakeLists.txt        2015-06-10 13:00:49 UTC (rev 185412)
</span><span class="lines">@@ -171,6 +171,7 @@
</span><span class="cx">     NetworkProcess/cache/NetworkCacheDecoder.cpp
</span><span class="cx">     NetworkProcess/cache/NetworkCacheEncoder.cpp
</span><span class="cx">     NetworkProcess/cache/NetworkCacheEntry.cpp
</span><ins>+    NetworkProcess/cache/NetworkCacheFileSystem.cpp
</ins><span class="cx">     NetworkProcess/cache/NetworkCacheKey.cpp
</span><span class="cx">     NetworkProcess/cache/NetworkCacheStatistics.cpp
</span><span class="cx">     NetworkProcess/cache/NetworkCacheStorage.cpp
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (185411 => 185412)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-06-10 11:29:33 UTC (rev 185411)
+++ trunk/Source/WebKit2/ChangeLog        2015-06-10 13:00:49 UTC (rev 185412)
</span><span class="lines">@@ -1,3 +1,65 @@
</span><ins>+2015-06-10  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        NetworkCache: Delete old cache versions
+        https://bugs.webkit.org/show_bug.cgi?id=145800
+
+        Reviewed by Darin Adler.
+
+        * CMakeLists.txt:
+        * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
+        (WebKit::NetworkCache::BlobStorage::synchronize):
+        * NetworkProcess/cache/NetworkCacheFileSystem.cpp: Added.
+        (WebKit::NetworkCache::directoryEntryType):
+        (WebKit::NetworkCache::traverseDirectory):
+
+            Pass entry type as callback argument.
+
+        (WebKit::NetworkCache::deleteDirectoryRecursively):
+
+            Add helper.
+
+        (WebKit::NetworkCache::fileTimes):
+        (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
+        * NetworkProcess/cache/NetworkCacheFileSystem.h: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h.
+
+            Move code to cpp.
+
+        (WebKit::NetworkCache::traverseDirectory): Deleted.
+        (WebKit::NetworkCache::traverseCacheFiles): Deleted.
+        (WebKit::NetworkCache::fileTimes): Deleted.
+        (WebKit::NetworkCache::updateFileModificationTimeIfNeeded): Deleted.
+        * NetworkProcess/cache/NetworkCacheFileSystemPosix.h: Removed.
+        * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
+        * NetworkProcess/cache/NetworkCacheStatistics.cpp:
+        (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
+        * NetworkProcess/cache/NetworkCacheStorage.cpp:
+        (WebKit::NetworkCache::makeBlobDirectoryPath):
+        (WebKit::NetworkCache::traverseRecordsFiles):
+
+            Move cache hierarchy aware traversal code here from NetworkCacheFileSystem (for better layering).
+            Rename for clarity.
+
+        (WebKit::NetworkCache::deleteEmptyRecordsDirectories):
+
+            Factor to a function.
+
+        (WebKit::NetworkCache::Storage::Storage):
+        (WebKit::NetworkCache::Storage::synchronize):
+        (WebKit::NetworkCache::Storage::traverse):
+        (WebKit::NetworkCache::Storage::clear):
+
+            Use traverseRecordsFiles for traversal.
+
+        (WebKit::NetworkCache::Storage::shrink):
+        (WebKit::NetworkCache::Storage::deleteOldVersions):
+
+            Delete version subdirectories with version number less than the current version.
+            Remove code for clearing unversioned V1 caches. No one should have them.
+
+        * NetworkProcess/cache/NetworkCacheStorage.h:
+        * UIProcess/API/APIUserContentExtensionStore.cpp:
+        * WebKit2.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2015-06-10  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Web Inspector is broken
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheBlobStoragecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp (185411 => 185412)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp        2015-06-10 11:29:33 UTC (rev 185411)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp        2015-06-10 13:00:49 UTC (rev 185412)
</span><span class="lines">@@ -29,10 +29,11 @@
</span><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><del>-#include &quot;NetworkCacheFileSystemPosix.h&quot;
</del><ins>+#include &quot;NetworkCacheFileSystem.h&quot;
</ins><span class="cx"> #include &lt;WebCore/FileSystem.h&gt;
</span><span class="cx"> #include &lt;fcntl.h&gt;
</span><span class="cx"> #include &lt;sys/mman.h&gt;
</span><ins>+#include &lt;sys/stat.h&gt;
</ins><span class="cx"> #include &lt;wtf/RunLoop.h&gt;
</span><span class="cx"> #include &lt;wtf/SHA1.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringBuilder.h&gt;
</span><span class="lines">@@ -58,7 +59,9 @@
</span><span class="cx"> 
</span><span class="cx">     m_approximateSize = 0;
</span><span class="cx">     auto blobDirectory = blobDirectoryPath();
</span><del>-    traverseDirectory(blobDirectory, DT_REG, [this, &amp;blobDirectory](const String&amp; name) {
</del><ins>+    traverseDirectory(blobDirectory, [this, &amp;blobDirectory](const String&amp; name, DirectoryEntryType type) {
+        if (type != DirectoryEntryType::File)
+            return;
</ins><span class="cx">         auto path = WebCore::pathByAppendingComponent(blobDirectory, name);
</span><span class="cx">         auto filePath = WebCore::fileSystemRepresentation(path);
</span><span class="cx">         struct stat stat;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheFileSystemcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystem.cpp (0 => 185412)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystem.cpp                                (rev 0)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystem.cpp        2015-06-10 13:00:49 UTC (rev 185412)
</span><span class="lines">@@ -0,0 +1,130 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;NetworkCacheFileSystem.h&quot;
+
+#if ENABLE(NETWORK_CACHE)
+
+#include &lt;WebCore/FileSystem.h&gt;
+#include &lt;dirent.h&gt;
+#include &lt;sys/stat.h&gt;
+#include &lt;sys/time.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+
+#if USE(SOUP)
+#include &lt;wtf/gobject/GRefPtr.h&gt;
+#endif
+
+namespace WebKit {
+namespace NetworkCache {
+
+static DirectoryEntryType directoryEntryType(uint8_t dtype)
+{
+    switch (dtype) {
+    case DT_DIR:
+        return DirectoryEntryType::Directory;
+    case DT_REG:
+        return DirectoryEntryType::File;
+    default:
+        ASSERT_NOT_REACHED();
+        return DirectoryEntryType::File;
+    }
+}
+
+void traverseDirectory(const String&amp; path, const std::function&lt;void (const String&amp;, DirectoryEntryType)&gt;&amp; function)
+{
+    DIR* dir = opendir(WebCore::fileSystemRepresentation(path).data());
+    if (!dir)
+        return;
+    dirent* dp;
+    while ((dp = readdir(dir))) {
+        if (dp-&gt;d_type != DT_DIR &amp;&amp; dp-&gt;d_type != DT_REG)
+            continue;
+        const char* name = dp-&gt;d_name;
+        if (!strcmp(name, &quot;.&quot;) || !strcmp(name, &quot;..&quot;))
+            continue;
+        auto nameString = String::fromUTF8(name);
+        if (nameString.isNull())
+            continue;
+        function(nameString, directoryEntryType(dp-&gt;d_type));
+    }
+    closedir(dir);
+}
+
+void deleteDirectoryRecursively(const String&amp; path)
+{
+    traverseDirectory(path, [&amp;path](const String&amp; name, DirectoryEntryType type) {
+        String entryPath = WebCore::pathByAppendingComponent(path, name);
+        switch (type) {
+        case DirectoryEntryType::File:
+            WebCore::deleteFile(entryPath);
+            break;
+        case DirectoryEntryType::Directory:
+            deleteDirectoryRecursively(entryPath);
+            break;
+        // This doesn't follow symlinks.
+        }
+    });
+    WebCore::deleteEmptyDirectory(path);
+}
+
+FileTimes fileTimes(const String&amp; path)
+{
+#if HAVE(STAT_BIRTHTIME)
+    struct stat fileInfo;
+    if (stat(WebCore::fileSystemRepresentation(path).data(), &amp;fileInfo))
+        return { };
+    return { std::chrono::system_clock::from_time_t(fileInfo.st_birthtime), std::chrono::system_clock::from_time_t(fileInfo.st_mtime) };
+#elif USE(SOUP)
+    // There's no st_birthtime in some operating systems like Linux, so we use xattrs to set/get the creation time.
+    GRefPtr&lt;GFile&gt; file = adoptGRef(g_file_new_for_path(WebCore::fileSystemRepresentation(path).data()));
+    GRefPtr&lt;GFileInfo&gt; fileInfo = adoptGRef(g_file_query_info(file.get(), &quot;xattr::birthtime,time::modified&quot;, G_FILE_QUERY_INFO_NONE, nullptr, nullptr));
+    if (!fileInfo)
+        return { };
+    const char* birthtimeString = g_file_info_get_attribute_string(fileInfo.get(), &quot;xattr::birthtime&quot;);
+    if (!birthtimeString)
+        return { };
+    return { std::chrono::system_clock::from_time_t(g_ascii_strtoull(birthtimeString, nullptr, 10)),
+        std::chrono::system_clock::from_time_t(g_file_info_get_attribute_uint64(fileInfo.get(), &quot;time::modified&quot;)) };
+#endif
+}
+
+void updateFileModificationTimeIfNeeded(const String&amp; path)
+{
+    auto times = fileTimes(path);
+    if (times.creation != times.modification) {
+        // Don't update more than once per hour.
+        if (std::chrono::system_clock::now() - times.modification &lt; std::chrono::hours(1))
+            return;
+    }
+    // This really updates both the access time and the modification time.
+    utimes(WebCore::fileSystemRepresentation(path).data(), nullptr);
+}
+
+}
+}
+
+#endif // ENABLE(NETWORK_CACHE)
</ins></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheFileSystemhfromrev185362trunkSourceWebKit2NetworkProcesscacheNetworkCacheFileSystemPosixh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystem.h (from rev 185362, trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h) (0 => 185412)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystem.h                                (rev 0)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystem.h        2015-06-10 13:00:49 UTC (rev 185412)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef NetworkCacheFileSystem_h
+#define NetworkCacheFileSystem_h
+
+#if ENABLE(NETWORK_CACHE)
+
+#include &lt;WebCore/FileSystem.h&gt;
+#include &lt;functional&gt;
+
+namespace WebKit {
+namespace NetworkCache {
+
+enum class DirectoryEntryType { Directory, File };
+void traverseDirectory(const String&amp; path, const std::function&lt;void (const String&amp; fileName, DirectoryEntryType)&gt;&amp;);
+
+void deleteDirectoryRecursively(const String&amp; path);
+
+struct FileTimes {
+    std::chrono::system_clock::time_point creation;
+    std::chrono::system_clock::time_point modification;
+};
+FileTimes fileTimes(const String&amp; path);
+void updateFileModificationTimeIfNeeded(const String&amp; path);
+
+}
+}
+
+#endif 
+
+#endif
+
</ins></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheFileSystemPosixh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h (185411 => 185412)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h        2015-06-10 11:29:33 UTC (rev 185411)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h        2015-06-10 13:00:49 UTC (rev 185412)
</span><span class="lines">@@ -1,117 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef NetworkCacheFileSystemPosix_h
-#define NetworkCacheFileSystemPosix_h
-
-#if ENABLE(NETWORK_CACHE)
-
-#include &lt;WebCore/FileSystem.h&gt;
-#include &lt;dirent.h&gt;
-#include &lt;sys/stat.h&gt;
-#include &lt;sys/time.h&gt;
-#include &lt;wtf/text/CString.h&gt;
-
-#if USE(SOUP)
-#include &lt;wtf/gobject/GRefPtr.h&gt;
-#endif
-
-namespace WebKit {
-namespace NetworkCache {
-
-template &lt;typename Function&gt;
-static void traverseDirectory(const String&amp; path, uint8_t type, const Function&amp; function)
-{
-    DIR* dir = opendir(WebCore::fileSystemRepresentation(path).data());
-    if (!dir)
-        return;
-    struct dirent* dp;
-    while ((dp = readdir(dir))) {
-        if (dp-&gt;d_type != type)
-            continue;
-        const char* name = dp-&gt;d_name;
-        if (!strcmp(name, &quot;.&quot;) || !strcmp(name, &quot;..&quot;))
-            continue;
-        function(String(name));
-    }
-    closedir(dir);
-}
-
-template &lt;typename Function&gt;
-inline void traverseCacheFiles(const String&amp; cachePath, const Function&amp; function)
-{
-    traverseDirectory(cachePath, DT_DIR, [&amp;cachePath, &amp;function](const String&amp; subdirName) {
-        String partitionPath = WebCore::pathByAppendingComponent(cachePath, subdirName);
-        traverseDirectory(partitionPath, DT_REG, [&amp;function, &amp;partitionPath](const String&amp; fileName) {
-            function(fileName, partitionPath);
-        });
-    });
-}
-
-struct FileTimes {
-    std::chrono::system_clock::time_point creation;
-    std::chrono::system_clock::time_point modification;
-};
-
-inline FileTimes fileTimes(const String&amp; path)
-{
-#if HAVE(STAT_BIRTHTIME)
-    struct stat fileInfo;
-    if (stat(WebCore::fileSystemRepresentation(path).data(), &amp;fileInfo))
-        return { };
-    return { std::chrono::system_clock::from_time_t(fileInfo.st_birthtime), std::chrono::system_clock::from_time_t(fileInfo.st_mtime) };
-#elif USE(SOUP)
-    // There's no st_birthtime in some operating systems like Linux, so we use xattrs to set/get the creation time.
-    GRefPtr&lt;GFile&gt; file = adoptGRef(g_file_new_for_path(WebCore::fileSystemRepresentation(path).data()));
-    GRefPtr&lt;GFileInfo&gt; fileInfo = adoptGRef(g_file_query_info(file.get(), &quot;xattr::birthtime,time::modified&quot;, G_FILE_QUERY_INFO_NONE, nullptr, nullptr));
-    if (!fileInfo)
-        return { };
-    const char* birthtimeString = g_file_info_get_attribute_string(fileInfo.get(), &quot;xattr::birthtime&quot;);
-    if (!birthtimeString)
-        return { };
-    return { std::chrono::system_clock::from_time_t(g_ascii_strtoull(birthtimeString, nullptr, 10)),
-        std::chrono::system_clock::from_time_t(g_file_info_get_attribute_uint64(fileInfo.get(), &quot;time::modified&quot;)) };
-#endif
-}
-
-inline void updateFileModificationTimeIfNeeded(const String&amp; path)
-{
-    auto times = fileTimes(path);
-    if (times.creation != times.modification) {
-        // Don't update more than once per hour.
-        if (std::chrono::system_clock::now() - times.modification &lt; std::chrono::hours(1))
-            return;
-    }
-    // This really updates both the access time and the modification time.
-    utimes(WebCore::fileSystemRepresentation(path).data(), 0);
-}
-
-}
-}
-
-#endif // ENABLE(NETWORK_CACHE)
-
-#endif // NetworkCacheFileSystemPosix_h
-
</del></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheIOChannelCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm (185411 => 185412)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm        2015-06-10 11:29:33 UTC (rev 185411)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm        2015-06-10 13:00:49 UTC (rev 185412)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><span class="cx"> 
</span><del>-#include &quot;NetworkCacheFileSystemPosix.h&quot;
</del><ins>+#include &quot;NetworkCacheFileSystem.h&quot;
</ins><span class="cx"> #include &lt;dispatch/dispatch.h&gt;
</span><span class="cx"> #include &lt;mach/vm_param.h&gt;
</span><span class="cx"> #include &lt;sys/mman.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheIOChannelSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp (185411 => 185412)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp        2015-06-10 11:29:33 UTC (rev 185411)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp        2015-06-10 13:00:49 UTC (rev 185412)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><span class="cx"> 
</span><del>-#include &quot;NetworkCacheFileSystemPosix.h&quot;
</del><ins>+#include &quot;NetworkCacheFileSystem.h&quot;
</ins><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/gobject/GMainLoopSource.h&gt;
</span><span class="cx"> #include &lt;wtf/gobject/GMutexLocker.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheStatisticscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.cpp (185411 => 185412)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.cpp        2015-06-10 11:29:33 UTC (rev 185411)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.cpp        2015-06-10 13:00:49 UTC (rev 185412)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;NetworkCache.h&quot;
</span><del>-#include &quot;NetworkCacheFileSystemPosix.h&quot;
</del><ins>+#include &quot;NetworkCacheFileSystem.h&quot;
</ins><span class="cx"> #include &quot;NetworkProcess.h&quot;
</span><span class="cx"> #include &lt;WebCore/DiagnosticLoggingKeys.h&gt;
</span><span class="cx"> #include &lt;WebCore/DiagnosticLoggingResultType.h&gt;
</span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx">     LOG(NetworkCache, &quot;(NetworkProcess) Bootstrapping the network cache statistics database from the network cache...&quot;);
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;StringCapture&gt; hashes;
</span><del>-    traverseCacheFiles(networkCachePath, [&amp;hashes](const String&amp; hashString, const String&amp;) {
</del><ins>+    traverseRecordsFiles(networkCachePath, [&amp;hashes](const String&amp; hashString, const String&amp;) {
</ins><span class="cx">         Key::HashType hash;
</span><span class="cx">         if (!Key::stringToHash(hashString, hash))
</span><span class="cx">             return;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheStoragecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp (185411 => 185412)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp        2015-06-10 11:29:33 UTC (rev 185411)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp        2015-06-10 13:00:49 UTC (rev 185412)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;NetworkCacheCoders.h&quot;
</span><del>-#include &quot;NetworkCacheFileSystemPosix.h&quot;
</del><ins>+#include &quot;NetworkCacheFileSystem.h&quot;
</ins><span class="cx"> #include &quot;NetworkCacheIOChannel.h&quot;
</span><span class="cx"> #include &lt;wtf/PageBlock.h&gt;
</span><span class="cx"> #include &lt;wtf/RandomNumber.h&gt;
</span><span class="lines">@@ -99,6 +99,30 @@
</span><span class="cx">     return WebCore::pathByAppendingComponent(makeVersionedDirectoryPath(baseDirectoryPath), blobsDirectoryName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void traverseRecordsFiles(const String&amp; recordsPath, const std::function&lt;void (const String&amp;, const String&amp;)&gt;&amp; function)
+{
+    traverseDirectory(recordsPath, [&amp;recordsPath, &amp;function](const String&amp; subdirName, DirectoryEntryType type) {
+        if (type != DirectoryEntryType::Directory)
+            return;
+        String partitionPath = WebCore::pathByAppendingComponent(recordsPath, subdirName);
+        traverseDirectory(partitionPath, [&amp;function, &amp;partitionPath](const String&amp; fileName, DirectoryEntryType type) {
+            if (type != DirectoryEntryType::File)
+                return;
+            function(fileName, partitionPath);
+        });
+    });
+}
+
+static void deleteEmptyRecordsDirectories(const String&amp; recordsPath)
+{
+    traverseDirectory(recordsPath, [&amp;recordsPath](const String&amp; subdirName, DirectoryEntryType type) {
+        if (type != DirectoryEntryType::Directory)
+            return;
+        // Let system figure out if it is really empty.
+        WebCore::deleteEmptyDirectory(WebCore::pathByAppendingComponent(recordsPath, subdirName));
+    });
+}
+
</ins><span class="cx"> Storage::Storage(const String&amp; baseDirectoryPath)
</span><span class="cx">     : m_basePath(baseDirectoryPath)
</span><span class="cx">     , m_recordsPath(makeRecordsDirectoryPath(baseDirectoryPath))
</span><span class="lines">@@ -150,7 +174,7 @@
</span><span class="cx">         auto bodyFilter = std::make_unique&lt;ContentsFilter&gt;();
</span><span class="cx">         size_t recordsSize = 0;
</span><span class="cx">         unsigned count = 0;
</span><del>-        traverseCacheFiles(recordsPath(), [&amp;recordFilter, &amp;bodyFilter, &amp;recordsSize, &amp;count](const String&amp; fileName, const String&amp; partitionPath) {
</del><ins>+        traverseRecordsFiles(recordsPath(), [&amp;recordFilter, &amp;bodyFilter, &amp;recordsSize, &amp;count](const String&amp; fileName, const String&amp; partitionPath) {
</ins><span class="cx">             auto filePath = WebCore::pathByAppendingComponent(partitionPath, fileName);
</span><span class="cx"> 
</span><span class="cx">             bool isBody = fileName.endsWith(bodyPostfix);
</span><span class="lines">@@ -664,7 +688,7 @@
</span><span class="cx">     
</span><span class="cx">     ioQueue().dispatch([this, flags, traverseHandlerPtr] {
</span><span class="cx">         auto&amp; traverseHandler = *traverseHandlerPtr;
</span><del>-        traverseCacheFiles(recordsPath(), [this, flags, &amp;traverseHandler](const String&amp; fileName, const String&amp; partitionPath) {
</del><ins>+        traverseRecordsFiles(recordsPath(), [this, flags, &amp;traverseHandler](const String&amp; fileName, const String&amp; partitionPath) {
</ins><span class="cx">             if (fileName.length() != Key::hashStringLength())
</span><span class="cx">                 return;
</span><span class="cx">             auto recordPath = WebCore::pathByAppendingComponent(partitionPath, fileName);
</span><span class="lines">@@ -729,20 +753,18 @@
</span><span class="cx"> 
</span><span class="cx">     ioQueue().dispatch([this, modifiedSinceTime, completionHandlerPtr] {
</span><span class="cx">         auto recordsPath = this-&gt;recordsPath();
</span><del>-        traverseDirectory(recordsPath, DT_DIR, [&amp;recordsPath, modifiedSinceTime](const String&amp; subdirName) {
-            String subdirPath = WebCore::pathByAppendingComponent(recordsPath, subdirName);
-            traverseDirectory(subdirPath, DT_REG, [&amp;subdirPath, modifiedSinceTime](const String&amp; fileName) {
-                auto filePath = WebCore::pathByAppendingComponent(subdirPath, fileName);
-                if (modifiedSinceTime &gt; std::chrono::system_clock::time_point::min()) {
-                    auto times = fileTimes(filePath);
-                    if (times.modification &lt; modifiedSinceTime)
-                        return;
-                }
-                WebCore::deleteFile(filePath);
-            });
-            WebCore::deleteEmptyDirectory(subdirPath);
</del><ins>+        traverseRecordsFiles(recordsPath, [modifiedSinceTime](const String&amp; fileName, const String&amp; partitionPath) {
+            auto filePath = WebCore::pathByAppendingComponent(partitionPath, fileName);
+            if (modifiedSinceTime &gt; std::chrono::system_clock::time_point::min()) {
+                auto times = fileTimes(filePath);
+                if (times.modification &lt; modifiedSinceTime)
+                    return;
+            }
+            WebCore::deleteFile(filePath);
</ins><span class="cx">         });
</span><span class="cx"> 
</span><ins>+        deleteEmptyRecordsDirectories(recordsPath);
+
</ins><span class="cx">         // This cleans unreferences blobs.
</span><span class="cx">         m_blobStorage.synchronize();
</span><span class="cx"> 
</span><span class="lines">@@ -809,7 +831,7 @@
</span><span class="cx"> 
</span><span class="cx">     backgroundIOQueue().dispatch([this] {
</span><span class="cx">         auto recordsPath = this-&gt;recordsPath();
</span><del>-        traverseCacheFiles(recordsPath, [this](const String&amp; fileName, const String&amp; partitionPath) {
</del><ins>+        traverseRecordsFiles(recordsPath, [this](const String&amp; fileName, const String&amp; partitionPath) {
</ins><span class="cx">             if (fileName.length() != Key::hashStringLength())
</span><span class="cx">                 return;
</span><span class="cx">             auto recordPath = WebCore::pathByAppendingComponent(partitionPath, fileName);
</span><span class="lines">@@ -829,11 +851,7 @@
</span><span class="cx">             }
</span><span class="cx">         });
</span><span class="cx"> 
</span><del>-        // Let system figure out if they are really empty.
-        traverseDirectory(recordsPath, DT_DIR, [&amp;recordsPath](const String&amp; subdirName) {
-            auto partitionPath = WebCore::pathByAppendingComponent(recordsPath, subdirName);
-            WebCore::deleteEmptyDirectory(partitionPath);
-        });
</del><ins>+        deleteEmptyRecordsDirectories(recordsPath);
</ins><span class="cx"> 
</span><span class="cx">         RunLoop::main().dispatch([this] {
</span><span class="cx">             m_shrinkInProgress = false;
</span><span class="lines">@@ -847,20 +865,27 @@
</span><span class="cx"> 
</span><span class="cx"> void Storage::deleteOldVersions()
</span><span class="cx"> {
</span><del>-    // Delete V1 cache.
</del><span class="cx">     backgroundIOQueue().dispatch([this] {
</span><span class="cx">         auto cachePath = basePath();
</span><del>-        traverseDirectory(cachePath, DT_DIR, [&amp;cachePath](const String&amp; subdirName) {
-            if (subdirName.startsWith(versionDirectoryPrefix))
</del><ins>+        traverseDirectory(cachePath, [&amp;cachePath](const String&amp; subdirName, DirectoryEntryType type) {
+            if (type != DirectoryEntryType::Directory)
</ins><span class="cx">                 return;
</span><del>-            String partitionPath = WebCore::pathByAppendingComponent(cachePath, subdirName);
-            traverseDirectory(partitionPath, DT_REG, [&amp;partitionPath](const String&amp; fileName) {
-                WebCore::deleteFile(WebCore::pathByAppendingComponent(partitionPath, fileName));
-            });
-            WebCore::deleteEmptyDirectory(partitionPath);
</del><ins>+            if (!subdirName.startsWith(versionDirectoryPrefix))
+                return;
+            auto versionString = subdirName.substring(strlen(versionDirectoryPrefix));
+            bool success;
+            unsigned directoryVersion = versionString.toUIntStrict(&amp;success);
+            if (!success)
+                return;
+            if (directoryVersion &gt;= version)
+                return;
+
+            auto oldVersionPath = WebCore::pathByAppendingComponent(cachePath, subdirName);
+            LOG(NetworkCacheStorage, &quot;(NetworkProcess) deleting old cache version, path %s&quot;, oldVersionPath.utf8().data());
+
+            deleteDirectoryRecursively(oldVersionPath);
</ins><span class="cx">         });
</span><span class="cx">     });
</span><del>-    // FIXME: Delete V2 cache.
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheStorageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h (185411 => 185412)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h        2015-06-10 11:29:33 UTC (rev 185411)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h        2015-06-10 13:00:49 UTC (rev 185412)
</span><span class="lines">@@ -158,6 +158,9 @@
</span><span class="cx">     BlobStorage m_blobStorage;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+// FIXME: Remove, used by NetworkCacheStatistics only.
+void traverseRecordsFiles(const String&amp; recordsPath, const std::function&lt;void (const String&amp;, const String&amp;)&gt;&amp;);
+
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIUserContentExtensionStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIUserContentExtensionStore.cpp (185411 => 185412)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIUserContentExtensionStore.cpp        2015-06-10 11:29:33 UTC (rev 185411)
+++ trunk/Source/WebKit2/UIProcess/API/APIUserContentExtensionStore.cpp        2015-06-10 13:00:49 UTC (rev 185412)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> #include &quot;NetworkCacheData.h&quot;
</span><span class="cx"> #include &quot;NetworkCacheDecoder.h&quot;
</span><span class="cx"> #include &quot;NetworkCacheEncoder.h&quot;
</span><del>-#include &quot;NetworkCacheFileSystemPosix.h&quot;
</del><ins>+#include &quot;NetworkCacheFileSystem.h&quot;
</ins><span class="cx"> #include &quot;SharedMemory.h&quot;
</span><span class="cx"> #include &quot;WebCompiledContentExtension.h&quot;
</span><span class="cx"> #include &lt;WebCore/ContentExtensionCompiler.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (185411 => 185412)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-06-10 11:29:33 UTC (rev 185411)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-06-10 13:00:49 UTC (rev 185412)
</span><span class="lines">@@ -1199,7 +1199,7 @@
</span><span class="cx">                 7CF47FFF17276AE3008ACB91 /* WKBundlePageBannerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CF47FFD17276AE3008ACB91 /* WKBundlePageBannerMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7EC4F0FB18E4ACBB008056AF /* NetworkProcessCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EC4F0F918E4A945008056AF /* NetworkProcessCocoa.mm */; };
</span><span class="cx">                 83048AE61ACA45DC0082C832 /* ProcessThrottlerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 83048AE51ACA45DC0082C832 /* ProcessThrottlerClient.h */; };
</span><del>-                834B250F1A831A8D00CFB150 /* NetworkCacheFileSystemPosix.h in Headers */ = {isa = PBXBuildFile; fileRef = 834B250E1A831A8D00CFB150 /* NetworkCacheFileSystemPosix.h */; };
</del><ins>+                834B250F1A831A8D00CFB150 /* NetworkCacheFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 834B250E1A831A8D00CFB150 /* NetworkCacheFileSystem.h */; };
</ins><span class="cx">                 834B25121A842C8700CFB150 /* NetworkCacheStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = 834B25101A842C8700CFB150 /* NetworkCacheStatistics.h */; };
</span><span class="cx">                 8360349F1ACB34D600626549 /* WebSQLiteDatabaseTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8360349D1ACB34D600626549 /* WebSQLiteDatabaseTracker.cpp */; };
</span><span class="cx">                 836034A01ACB34D600626549 /* WebSQLiteDatabaseTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 8360349E1ACB34D600626549 /* WebSQLiteDatabaseTracker.h */; };
</span><span class="lines">@@ -1805,6 +1805,7 @@
</span><span class="cx">                 E4436ECE1A0D040B00EAD204 /* NetworkCacheKey.h in Headers */ = {isa = PBXBuildFile; fileRef = E4436EC11A0CFDB200EAD204 /* NetworkCacheKey.h */; };
</span><span class="cx">                 E4436ECF1A0D040B00EAD204 /* NetworkCacheStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = E4436EC21A0CFDB200EAD204 /* NetworkCacheStorage.h */; };
</span><span class="cx">                 E4436ED01A0D040B00EAD204 /* NetworkCacheStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4436EC31A0CFDB200EAD204 /* NetworkCacheStorage.cpp */; };
</span><ins>+                E4697CCD1B25EB8F001B0A6C /* NetworkCacheFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4697CCC1B25EB8F001B0A6C /* NetworkCacheFileSystem.cpp */; };
</ins><span class="cx">                 E47D1E981B0649FB002676A8 /* NetworkCacheData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E47D1E961B062B66002676A8 /* NetworkCacheData.cpp */; };
</span><span class="cx">                 E489D28A1A0A2DB80078C06A /* NetworkCacheCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = E489D2831A0A2DB80078C06A /* NetworkCacheCoder.h */; };
</span><span class="cx">                 E489D28B1A0A2DB80078C06A /* NetworkCacheCoders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E489D2841A0A2DB80078C06A /* NetworkCacheCoders.cpp */; };
</span><span class="lines">@@ -3434,7 +3435,7 @@
</span><span class="cx">                 7CF47FFD17276AE3008ACB91 /* WKBundlePageBannerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundlePageBannerMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7EC4F0F918E4A945008056AF /* NetworkProcessCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = NetworkProcessCocoa.mm; path = NetworkProcess/cocoa/NetworkProcessCocoa.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 83048AE51ACA45DC0082C832 /* ProcessThrottlerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessThrottlerClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                834B250E1A831A8D00CFB150 /* NetworkCacheFileSystemPosix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkCacheFileSystemPosix.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                834B250E1A831A8D00CFB150 /* NetworkCacheFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkCacheFileSystem.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 834B25101A842C8700CFB150 /* NetworkCacheStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkCacheStatistics.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 8360349D1ACB34D600626549 /* WebSQLiteDatabaseTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSQLiteDatabaseTracker.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 8360349E1ACB34D600626549 /* WebSQLiteDatabaseTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSQLiteDatabaseTracker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4084,6 +4085,7 @@
</span><span class="cx">                 E4436EC11A0CFDB200EAD204 /* NetworkCacheKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkCacheKey.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E4436EC21A0CFDB200EAD204 /* NetworkCacheStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkCacheStorage.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E4436EC31A0CFDB200EAD204 /* NetworkCacheStorage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkCacheStorage.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                E4697CCC1B25EB8F001B0A6C /* NetworkCacheFileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkCacheFileSystem.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E47D1E961B062B66002676A8 /* NetworkCacheData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkCacheData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E489D2831A0A2DB80078C06A /* NetworkCacheCoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkCacheCoder.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E489D2841A0A2DB80078C06A /* NetworkCacheCoders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkCacheCoders.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -7569,7 +7571,8 @@
</span><span class="cx">                                 E489D2891A0A2DB80078C06A /* NetworkCacheEncoder.h */,
</span><span class="cx">                                 E413F59E1AC1AF9D00345360 /* NetworkCacheEntry.cpp */,
</span><span class="cx">                                 E413F59B1AC1ADB600345360 /* NetworkCacheEntry.h */,
</span><del>-                                834B250E1A831A8D00CFB150 /* NetworkCacheFileSystemPosix.h */,
</del><ins>+                                834B250E1A831A8D00CFB150 /* NetworkCacheFileSystem.h */,
+                                E4697CCC1B25EB8F001B0A6C /* NetworkCacheFileSystem.cpp */,
</ins><span class="cx">                                 E42E060B1AA7440D00B11699 /* NetworkCacheIOChannel.h */,
</span><span class="cx">                                 E42E060D1AA750E500B11699 /* NetworkCacheIOChannelCocoa.mm */,
</span><span class="cx">                                 E4436EC01A0CFDB200EAD204 /* NetworkCacheKey.cpp */,
</span><span class="lines">@@ -7864,7 +7867,7 @@
</span><span class="cx">                                 E489D28E1A0A2DB80078C06A /* NetworkCacheDecoder.h in Headers */,
</span><span class="cx">                                 E489D2901A0A2DB80078C06A /* NetworkCacheEncoder.h in Headers */,
</span><span class="cx">                                 E413F59D1AC1ADC400345360 /* NetworkCacheEntry.h in Headers */,
</span><del>-                                834B250F1A831A8D00CFB150 /* NetworkCacheFileSystemPosix.h in Headers */,
</del><ins>+                                834B250F1A831A8D00CFB150 /* NetworkCacheFileSystem.h in Headers */,
</ins><span class="cx">                                 E42E06101AA7523B00B11699 /* NetworkCacheIOChannel.h in Headers */,
</span><span class="cx">                                 E4436ECE1A0D040B00EAD204 /* NetworkCacheKey.h in Headers */,
</span><span class="cx">                                 834B25121A842C8700CFB150 /* NetworkCacheStatistics.h in Headers */,
</span><span class="lines">@@ -9676,6 +9679,7 @@
</span><span class="cx">                                 E42E06141AA75B7000B11699 /* NetworkCacheDataCocoa.mm in Sources */,
</span><span class="cx">                                 E489D28D1A0A2DB80078C06A /* NetworkCacheDecoder.cpp in Sources */,
</span><span class="cx">                                 E489D28F1A0A2DB80078C06A /* NetworkCacheEncoder.cpp in Sources */,
</span><ins>+                                E4697CCD1B25EB8F001B0A6C /* NetworkCacheFileSystem.cpp in Sources */,
</ins><span class="cx">                                 E413F59F1AC1AF9D00345360 /* NetworkCacheEntry.cpp in Sources */,
</span><span class="cx">                                 E42E060F1AA7523400B11699 /* NetworkCacheIOChannelCocoa.mm in Sources */,
</span><span class="cx">                                 E4436ECD1A0D040B00EAD204 /* NetworkCacheKey.cpp in Sources */,
</span></span></pre>
</div>
</div>

</body>
</html>