<!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>[177495] 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/177495">177495</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-12-18 06:41:44 -0800 (Thu, 18 Dec 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>[GTK] Allow to build with ENABLE_NETWORK_CACHE
https://bugs.webkit.org/show_bug.cgi?id=139728
Reviewed by Antti Koivisto.
Just make it build for now.
* CMakeLists.txt: Add new files to compilation.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry): Use
ENABLE(SHAREABLE_RESOURCE) when ShareableResource is used.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::decodeStorageEntry): Ditto.
(WebKit::makeCacheKey): Use ENABLE(CACHE_PARTITIONING) for ResourceRequest::cachePartition().
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::NetworkCacheStorage::Data::isNull): Move implementation
to platform specific files.
* NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
(WebKit::NetworkCacheStorage::Data::isNull): Moved from the header.
* NetworkProcess/cache/NetworkCacheStorageSoup.cpp: Added.
(WebKit::NetworkCacheStorage::Data::Data):
(WebKit::NetworkCacheStorage::Data::data):
(WebKit::NetworkCacheStorage::Data::isNull):
(WebKit::NetworkCacheStorage::open):
(WebKit::NetworkCacheStorage::NetworkCacheStorage):
(WebKit::NetworkCacheStorage::initializeKeyFilter):
(WebKit::NetworkCacheStorage::removeEntry):
(WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
(WebKit::NetworkCacheStorage::dispatchPendingRetrieveOperations):
(WebKit::NetworkCacheStorage::retrieve):
(WebKit::NetworkCacheStorage::store):
(WebKit::NetworkCacheStorage::setMaximumSize):
(WebKit::NetworkCacheStorage::clear):
* PlatformGTK.cmake: Add NetworkCacheStorageSoup.cpp.
* config.h:</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="#trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp">trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCachecpp">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheh">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheStorageh">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheStorageCocoamm">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2PlatformGTKcmake">trunk/Source/WebKit2/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebKit2configh">trunk/Source/WebKit2/config.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheStorageSoupcpp">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageSoup.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2CMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/CMakeLists.txt (177494 => 177495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt        2014-12-18 13:41:59 UTC (rev 177494)
+++ trunk/Source/WebKit2/CMakeLists.txt        2014-12-18 14:41:44 UTC (rev 177495)
</span><span class="lines">@@ -157,6 +157,12 @@
</span><span class="cx">
</span><span class="cx"> NetworkProcess/FileAPI/NetworkBlobRegistry.cpp
</span><span class="cx">
</span><ins>+ NetworkProcess/cache/NetworkCache.cpp
+ NetworkProcess/cache/NetworkCacheCoders.cpp
+ NetworkProcess/cache/NetworkCacheEncoder.cpp
+ NetworkProcess/cache/NetworkCacheDecoder.cpp
+ NetworkProcess/cache/NetworkCacheKey.cpp
+
</ins><span class="cx"> Platform/Logging.cpp
</span><span class="cx"> Platform/Module.cpp
</span><span class="cx"> Platform/WorkQueue.cpp
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (177494 => 177495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-12-18 13:41:59 UTC (rev 177494)
+++ trunk/Source/WebKit2/ChangeLog        2014-12-18 14:41:44 UTC (rev 177495)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2014-12-18 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Allow to build with ENABLE_NETWORK_CACHE
+ https://bugs.webkit.org/show_bug.cgi?id=139728
+
+ Reviewed by Antti Koivisto.
+
+ Just make it build for now.
+
+ * CMakeLists.txt: Add new files to compilation.
+ * NetworkProcess/NetworkResourceLoader.cpp:
+ (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): Use
+ ENABLE(SHAREABLE_RESOURCE) when ShareableResource is used.
+ * NetworkProcess/cache/NetworkCache.cpp:
+ (WebKit::decodeStorageEntry): Ditto.
+ (WebKit::makeCacheKey): Use ENABLE(CACHE_PARTITIONING) for ResourceRequest::cachePartition().
+ * NetworkProcess/cache/NetworkCache.h:
+ * NetworkProcess/cache/NetworkCacheStorage.h:
+ (WebKit::NetworkCacheStorage::Data::isNull): Move implementation
+ to platform specific files.
+ * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
+ (WebKit::NetworkCacheStorage::Data::isNull): Moved from the header.
+ * NetworkProcess/cache/NetworkCacheStorageSoup.cpp: Added.
+ (WebKit::NetworkCacheStorage::Data::Data):
+ (WebKit::NetworkCacheStorage::Data::data):
+ (WebKit::NetworkCacheStorage::Data::isNull):
+ (WebKit::NetworkCacheStorage::open):
+ (WebKit::NetworkCacheStorage::NetworkCacheStorage):
+ (WebKit::NetworkCacheStorage::initializeKeyFilter):
+ (WebKit::NetworkCacheStorage::removeEntry):
+ (WebKit::NetworkCacheStorage::dispatchRetrieveOperation):
+ (WebKit::NetworkCacheStorage::dispatchPendingRetrieveOperations):
+ (WebKit::NetworkCacheStorage::retrieve):
+ (WebKit::NetworkCacheStorage::store):
+ (WebKit::NetworkCacheStorage::setMaximumSize):
+ (WebKit::NetworkCacheStorage::clear):
+ * PlatformGTK.cmake: Add NetworkCacheStorageSoup.cpp.
+ * config.h:
+
</ins><span class="cx"> 2014-12-17 Dan Bernstein <mitz@apple.com>
</span><span class="cx">
</span><span class="cx"> <rdar://problem/19282508> WebKitLegacy is unusable due to bad dylib identifier
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (177494 => 177495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2014-12-18 13:41:59 UTC (rev 177494)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2014-12-18 14:41:44 UTC (rev 177495)
</span><span class="lines">@@ -545,14 +545,18 @@
</span><span class="cx"> } else {
</span><span class="cx"> sendAbortingOnFailure(Messages::WebResourceLoader::DidReceiveResponse(entry->response, m_parameters.isMainResource));
</span><span class="cx">
</span><ins>+#if ENABLE(SHAREABLE_RESOURCE)
</ins><span class="cx"> if (!entry->shareableResourceHandle.isNull())
</span><span class="cx"> send(Messages::WebResourceLoader::DidReceiveResource(entry->shareableResourceHandle, currentTime()));
</span><span class="cx"> else {
</span><ins>+#endif
</ins><span class="cx"> bool shouldContinue = sendBufferMaybeAborting(*entry->buffer, entry->buffer->size());
</span><span class="cx"> if (!shouldContinue)
</span><span class="cx"> return;
</span><span class="cx"> send(Messages::WebResourceLoader::DidFinishResourceLoad(currentTime()));
</span><ins>+#if ENABLE(SHAREABLE_RESOURCE)
</ins><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> cleanup();
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp (177494 => 177495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp        2014-12-18 13:41:59 UTC (rev 177494)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp        2014-12-18 14:41:44 UTC (rev 177495)
</span><span class="lines">@@ -176,12 +176,14 @@
</span><span class="cx"> cachedResponse.setSource(needsRevalidation ? WebCore::ResourceResponse::Source::DiskCacheAfterValidation : WebCore::ResourceResponse::Source::DiskCache);
</span><span class="cx"> entry->response = cachedResponse;
</span><span class="cx">
</span><ins>+#if ENABLE(SHAREABLE_RESOURCE)
</ins><span class="cx"> RefPtr<SharedMemory> sharedMemory = storageEntry.body.size() ? SharedMemory::createFromVMBuffer(const_cast<uint8_t*>(storageEntry.body.data()), storageEntry.body.size()) : nullptr;
</span><span class="cx"> RefPtr<ShareableResource> shareableResource = sharedMemory ? ShareableResource::create(sharedMemory.release(), 0, storageEntry.body.size()) : nullptr;
</span><span class="cx">
</span><span class="cx"> if (shareableResource && shareableResource->createHandle(entry->shareableResourceHandle))
</span><span class="cx"> entry->buffer = entry->shareableResourceHandle.tryWrapInSharedBuffer();
</span><span class="cx"> else
</span><ins>+#endif
</ins><span class="cx"> entry->buffer = WebCore::SharedBuffer::create(storageEntry.body.data(), storageEntry.body.size());
</span><span class="cx">
</span><span class="cx"> return entry;
</span><span class="lines">@@ -205,7 +207,11 @@
</span><span class="cx">
</span><span class="cx"> static NetworkCacheKey makeCacheKey(const WebCore::ResourceRequest& request)
</span><span class="cx"> {
</span><ins>+#if ENABLE(CACHE_PARTITIONING)
</ins><span class="cx"> String partition = request.cachePartition();
</span><ins>+#else
+ String partition;
+#endif
</ins><span class="cx"> if (partition.isEmpty())
</span><span class="cx"> partition = ASCIILiteral("No partition");
</span><span class="cx"> return NetworkCacheKey(request.httpMethod(), partition, request.url().string());
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h (177494 => 177495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h        2014-12-18 13:41:59 UTC (rev 177494)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h        2014-12-18 14:41:44 UTC (rev 177495)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx">
</span><span class="cx"> #include "NetworkCacheStorage.h"
</span><span class="cx"> #include "ShareableResource.h"
</span><del>-#include <Webcore/ResourceResponse.h>
</del><ins>+#include <WebCore/ResourceResponse.h>
</ins><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -56,7 +56,9 @@
</span><span class="cx"> struct Entry {
</span><span class="cx"> WebCore::ResourceResponse response;
</span><span class="cx"> RefPtr<WebCore::SharedBuffer> buffer;
</span><ins>+#if ENABLE(SHAREABLE_RESOURCE)
</ins><span class="cx"> ShareableResource::Handle shareableResourceHandle;
</span><ins>+#endif
</ins><span class="cx"> bool needsRevalidation;
</span><span class="cx"> };
</span><span class="cx"> // Completion handler may get called back synchronously on failure.
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheStorageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h (177494 => 177495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h        2014-12-18 13:41:59 UTC (rev 177494)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h        2014-12-18 14:41:44 UTC (rev 177495)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> explicit Data(OSObjectPtr<dispatch_data_t>);
</span><span class="cx"> #endif
</span><del>- bool isNull() const { return !m_dispatchData; }
</del><ins>+ bool isNull() const;
</ins><span class="cx">
</span><span class="cx"> const uint8_t* data() const;
</span><span class="cx"> size_t size() const { return m_size; }
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheStorageCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm (177494 => 177495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm        2014-12-18 13:41:59 UTC (rev 177494)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm        2014-12-18 14:41:44 UTC (rev 177495)
</span><span class="lines">@@ -105,6 +105,11 @@
</span><span class="cx"> return m_data;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool NetworkCacheStorage::Data::isNull() const
+{
+ return !m_dispatchData;
+}
+
</ins><span class="cx"> std::unique_ptr<NetworkCacheStorage> NetworkCacheStorage::open(const String& cachePath)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(RunLoop::isMain());
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheStorageSoupcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageSoup.cpp (0 => 177495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageSoup.cpp         (rev 0)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageSoup.cpp        2014-12-18 14:41:44 UTC (rev 177495)
</span><span class="lines">@@ -0,0 +1,139 @@
</span><ins>+/*
+ * Copyright (C) 2014 Igalia S.L.
+ *
+ * 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 "config.h"
+#include "NetworkCacheStorage.h"
+
+#if ENABLE(NETWORK_CACHE)
+
+#include "Logging.h"
+#include "NetworkCacheCoders.h"
+#include <WebCore/FileSystem.h>
+#include <WebCore/NotImplemented.h>
+#include <wtf/RunLoop.h>
+
+namespace WebKit {
+
+static const char* networkCacheSubdirectory = "WebKitCache";
+
+NetworkCacheStorage::Data::Data()
+ : m_data(nullptr)
+ , m_size(0)
+{
+ notImplemented();
+}
+
+NetworkCacheStorage::Data::Data(const uint8_t* data, size_t size)
+ : m_data(data)
+ , m_size(size)
+{
+ notImplemented();
+}
+
+const uint8_t* NetworkCacheStorage::Data::data() const
+{
+ notImplemented();
+ return nullptr;
+}
+
+bool NetworkCacheStorage::Data::isNull() const
+{
+ notImplemented();
+ return true;
+}
+
+std::unique_ptr<NetworkCacheStorage> NetworkCacheStorage::open(const String& applicationCachePath)
+{
+ ASSERT(RunLoop::isMain());
+ String networkCachePath = WebCore::pathByAppendingComponent(applicationCachePath, networkCacheSubdirectory);
+ if (!WebCore::makeAllDirectories(networkCachePath))
+ return nullptr;
+ return std::unique_ptr<NetworkCacheStorage>(new NetworkCacheStorage(networkCachePath));
+}
+
+NetworkCacheStorage::NetworkCacheStorage(const String& directoryPath)
+ : m_directoryPath(directoryPath)
+ , m_maximumSize(std::numeric_limits<size_t>::max())
+ , m_activeRetrieveOperationCount(0)
+{
+ initializeKeyFilter();
+}
+
+void NetworkCacheStorage::initializeKeyFilter()
+{
+ ASSERT(RunLoop::isMain());
+ notImplemented();
+}
+
+void NetworkCacheStorage::removeEntry(const NetworkCacheKey&)
+{
+ ASSERT(RunLoop::isMain());
+ notImplemented();
+}
+
+void NetworkCacheStorage::dispatchRetrieveOperation(const RetrieveOperation&)
+{
+ ASSERT(RunLoop::isMain());
+ notImplemented();
+}
+
+void NetworkCacheStorage::dispatchPendingRetrieveOperations()
+{
+ ASSERT(RunLoop::isMain());
+ notImplemented();
+}
+
+void NetworkCacheStorage::retrieve(const NetworkCacheKey&, unsigned /* priority */, std::function<bool (std::unique_ptr<Entry>)> completionHandler)
+{
+ ASSERT(RunLoop::isMain());
+ notImplemented();
+ completionHandler(nullptr);
+}
+
+void NetworkCacheStorage::store(const NetworkCacheKey&, const Entry&, std::function<void (bool success)> completionHandler)
+{
+ ASSERT(RunLoop::isMain());
+ notImplemented();
+ completionHandler(false);
+}
+
+void NetworkCacheStorage::setMaximumSize(size_t size)
+{
+ ASSERT(RunLoop::isMain());
+ notImplemented();
+ m_maximumSize = size;
+}
+
+void NetworkCacheStorage::clear()
+{
+ ASSERT(RunLoop::isMain());
+ LOG(NetworkCacheStorage, "(NetworkProcess) clearing cache");
+ notImplemented();
+ m_keyFilter.clear();
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(NETWORK_CACHE)
</ins></span></pre></div>
<a id="trunkSourceWebKit2PlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformGTK.cmake (177494 => 177495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformGTK.cmake        2014-12-18 13:41:59 UTC (rev 177494)
+++ trunk/Source/WebKit2/PlatformGTK.cmake        2014-12-18 14:41:44 UTC (rev 177495)
</span><span class="lines">@@ -15,6 +15,8 @@
</span><span class="cx"> set(WebKit2_USE_PREFIX_HEADER ON)
</span><span class="cx">
</span><span class="cx"> list(APPEND WebKit2_SOURCES
</span><ins>+ NetworkProcess/cache/NetworkCacheStorageSoup.cpp
+
</ins><span class="cx"> NetworkProcess/gtk/NetworkProcessMainGtk.cpp
</span><span class="cx">
</span><span class="cx"> NetworkProcess/soup/NetworkProcessSoup.cpp
</span></span></pre></div>
<a id="trunkSourceWebKit2configh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/config.h (177494 => 177495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/config.h        2014-12-18 13:41:59 UTC (rev 177494)
+++ trunk/Source/WebKit2/config.h        2014-12-18 14:41:44 UTC (rev 177495)
</span><span class="lines">@@ -94,7 +94,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #ifndef ENABLE_NETWORK_CACHE
</span><del>-#if PLATFORM(MAC) && ENABLE(NETWORK_PROCESS)
</del><ins>+#if (PLATFORM(MAC) || PLATFORM(GTK)) && ENABLE(NETWORK_PROCESS)
</ins><span class="cx"> #define ENABLE_NETWORK_CACHE 0
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>
</body>
</html>