WebKit level persistent caching
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Dec 2014 10:08:13 +0000 (10:08 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Dec 2014 10:08:13 +0000 (10:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=30322

Minor cleanups based on comments by Joseph Pecoraro.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::decodeStorageEntry):
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheStorage.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177356 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp
Source/WebKit2/NetworkProcess/cache/NetworkCache.h
Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h
Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm

index 287ce06..bb5c4f5 100644 (file)
@@ -1,3 +1,17 @@
+2014-12-16  Antti Koivisto  <antti@apple.com>
+
+        WebKit level persistent caching
+        https://bugs.webkit.org/show_bug.cgi?id=30322
+
+        Minor cleanups based on comments by Joseph Pecoraro.
+
+        * NetworkProcess/cache/NetworkCache.cpp:
+        (WebKit::decodeStorageEntry):
+        * NetworkProcess/cache/NetworkCache.h:
+        * NetworkProcess/cache/NetworkCacheStorage.h:
+        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
+        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
+
 2014-12-15  Bartlomiej Gajda  <b.gajda@samsung.com>
 
         Build fix after r177301.
index 087f368..38e7c3b 100644 (file)
@@ -147,7 +147,7 @@ static std::unique_ptr<NetworkCache::Entry> decodeStorageEntry(const NetworkCach
             return nullptr;
 
         if (!verifyVaryingRequestHeaders(varyingRequestHeaders, request)) {
-            LOG(NetworkCache, "(NetworkProcess) varying header mistmatch\n");
+            LOG(NetworkCache, "(NetworkProcess) varying header mismatch\n");
             return nullptr;
         }
     }
index f6deaf4..9036750 100644 (file)
@@ -31,9 +31,6 @@
 #include "NetworkCacheStorage.h"
 #include "ShareableResource.h"
 #include <Webcore/ResourceResponse.h>
-#include <wtf/BloomFilter.h>
-#include <wtf/Deque.h>
-#include <wtf/HashSet.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -70,10 +67,6 @@ public:
     void clear();
 
 private:
-    String fileNameForURL(const WebCore::URL&);
-    String directoryPathForCachePartition(const String&);
-    String filePathForRequest(const WebCore::ResourceRequest&);
-
     std::unique_ptr<NetworkCacheStorage> m_storage;
 };
 
index 0bf6da1..1d96f79 100644 (file)
 #include <WebCore/ResourceResponse.h>
 #include <wtf/BloomFilter.h>
 #include <wtf/Deque.h>
-#include <wtf/OSObjectPtr.h>
-#include <wtf/RetainPtr.h>
 #include <wtf/text/WTFString.h>
 
+#if PLATFORM(COCOA)
+#include <wtf/OSObjectPtr.h>
+#endif
+
 namespace WebCore {
 class SharedBuffer;
 }
index 2f47a2b..8660c27 100644 (file)
@@ -65,8 +65,8 @@ void NetworkProcess::platformInitializeNetworkProcessCocoa(const NetworkProcessC
         SandboxExtension::consumePermanently(parameters.diskCacheDirectoryExtensionHandle);
 #if ENABLE(NETWORK_CACHE)
         if (NetworkCache::shared().initialize(m_diskCacheDirectory)) {
-            NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil];
-            [NSURLCache setSharedURLCache:URLCache];
+            RetainPtr<NSURLCache> urlCache(adoptNS([[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil]));
+            [NSURLCache setSharedURLCache:urlCache.get()];
             return;
         }
 #endif