Title: [208556] trunk/Source
Revision
208556
Author
commit-qu...@webkit.org
Date
2016-11-10 12:05:52 -0800 (Thu, 10 Nov 2016)

Log Message

Remove unused CFURLCACHE code
https://bugs.webkit.org/show_bug.cgi?id=164551

Patch by Alex Christensen <achristen...@webkit.org> on 2016-11-10
Reviewed by Antti Koivisto.

Source/WebKit2:

WebKit2 doesn't use CFURLCache, but we still have some unused code that seems to use it.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::fetchDiskCacheEntries):
(WebKit::clearDiskCacheEntries):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::partitionName): Deleted.
(WebKit::NetworkProcess::cfURLCacheOrigins): Deleted.
(WebKit::NetworkProcess::clearCFURLCacheForOrigins): Deleted.

Source/WTF:

* wtf/Platform.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (208555 => 208556)


--- trunk/Source/WTF/ChangeLog	2016-11-10 19:44:51 UTC (rev 208555)
+++ trunk/Source/WTF/ChangeLog	2016-11-10 20:05:52 UTC (rev 208556)
@@ -1,3 +1,12 @@
+2016-11-10  Alex Christensen  <achristen...@webkit.org>
+
+        Remove unused CFURLCACHE code
+        https://bugs.webkit.org/show_bug.cgi?id=164551
+
+        Reviewed by Antti Koivisto.
+
+        * wtf/Platform.h:
+
 2016-11-09  Alex Christensen  <achristen...@webkit.org>
 
         Allow RefPtrs of const ThreadSafeRefCounted types

Modified: trunk/Source/WTF/wtf/Platform.h (208555 => 208556)


--- trunk/Source/WTF/wtf/Platform.h	2016-11-10 19:44:51 UTC (rev 208555)
+++ trunk/Source/WTF/wtf/Platform.h	2016-11-10 20:05:52 UTC (rev 208556)
@@ -600,10 +600,6 @@
 #define USE_CFURLCONNECTION 1
 #endif
 
-#if USE(CFURLCONNECTION) || PLATFORM(COCOA)
-#define USE_CFURLCACHE 1
-#endif
-
 #if !defined(HAVE_ACCESSIBILITY)
 #if PLATFORM(COCOA) || PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(EFL)
 #define HAVE_ACCESSIBILITY 1

Modified: trunk/Source/WebKit2/ChangeLog (208555 => 208556)


--- trunk/Source/WebKit2/ChangeLog	2016-11-10 19:44:51 UTC (rev 208555)
+++ trunk/Source/WebKit2/ChangeLog	2016-11-10 20:05:52 UTC (rev 208556)
@@ -1,3 +1,21 @@
+2016-11-10  Alex Christensen  <achristen...@webkit.org>
+
+        Remove unused CFURLCACHE code
+        https://bugs.webkit.org/show_bug.cgi?id=164551
+
+        Reviewed by Antti Koivisto.
+
+        WebKit2 doesn't use CFURLCache, but we still have some unused code that seems to use it.
+
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::fetchDiskCacheEntries):
+        (WebKit::clearDiskCacheEntries):
+        * NetworkProcess/NetworkProcess.h:
+        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
+        (WebKit::partitionName): Deleted.
+        (WebKit::NetworkProcess::cfURLCacheOrigins): Deleted.
+        (WebKit::NetworkProcess::clearCFURLCacheForOrigins): Deleted.
+
 2016-11-10  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [Linux] Memory process values shown by the WebMemorySampler in linux are wrong

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp (208555 => 208556)


--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp	2016-11-10 19:44:51 UTC (rev 208555)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp	2016-11-10 20:05:52 UTC (rev 208556)
@@ -336,15 +336,8 @@
     }
 #endif
 
-    Vector<WebsiteData::Entry> entries;
-
-#if USE(CFURLCACHE)
-    for (auto& origin : NetworkProcess::cfURLCacheOrigins())
-        entries.append(WebsiteData::Entry { WTFMove(origin), WebsiteDataType::DiskCache, 0 });
-#endif
-
-    RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler), entries = WTFMove(entries)] {
-        completionHandler(entries);
+    RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler)] {
+        completionHandler({ });
     });
 }
 
@@ -438,10 +431,6 @@
     }
 #endif
 
-#if USE(CFURLCACHE)
-    NetworkProcess::clearCFURLCacheForOrigins(origins);
-#endif
-
     RunLoop::main().dispatch(WTFMove(completionHandler));
 }
 

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h (208555 => 208556)


--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h	2016-11-10 19:44:51 UTC (rev 208555)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h	2016-11-10 20:05:52 UTC (rev 208556)
@@ -96,11 +96,6 @@
     void logDiagnosticMessageWithResult(uint64_t webPageID, const String& message, const String& description, WebCore::DiagnosticLoggingResultType, WebCore::ShouldSample);
     void logDiagnosticMessageWithValue(uint64_t webPageID, const String& message, const String& description, const String& value, WebCore::ShouldSample);
 
-#if USE(CFURLCACHE)
-    static Vector<Ref<WebCore::SecurityOrigin>> cfURLCacheOrigins();
-    static void clearCFURLCacheForOrigins(const Vector<WebCore::SecurityOriginData>&);
-#endif
-
 #if PLATFORM(COCOA)
     RetainPtr<CFDataRef> sourceApplicationAuditData() const;
     void clearHSTSCache(WebCore::NetworkStorageSession&, std::chrono::system_clock::time_point modifiedSince);

Modified: trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm (208555 => 208556)


--- trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm	2016-11-10 19:44:51 UTC (rev 208555)
+++ trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm	2016-11-10 20:05:52 UTC (rev 208556)
@@ -147,19 +147,6 @@
         [nsurlCache setDiskCapacity:std::max<uint64_t>(urlCacheDiskCapacity, [nsurlCache diskCapacity])]; // Don't shrink a big disk cache, since that would cause churn.
 }
 
-static RetainPtr<CFStringRef> partitionName(CFStringRef domain)
-{
-#if ENABLE(PUBLIC_SUFFIX_LIST)
-    String highLevel = WebCore::topPrivatelyControlledDomain(domain);
-    if (highLevel.isNull())
-        return 0;
-    CString utf8String = highLevel.utf8();
-    return adoptCF(CFStringCreateWithBytes(0, reinterpret_cast<const UInt8*>(utf8String.data()), utf8String.length(), kCFStringEncodingUTF8, false));
-#else
-    return domain;
-#endif
-}
-
 RetainPtr<CFDataRef> NetworkProcess::sourceApplicationAuditData() const
 {
 #if PLATFORM(IOS)
@@ -173,43 +160,6 @@
 #endif
 }
 
-Vector<Ref<WebCore::SecurityOrigin>> NetworkProcess::cfURLCacheOrigins()
-{
-    Vector<Ref<WebCore::SecurityOrigin>> result;
-
-    WKCFURLCacheCopyAllPartitionNames([&result](CFArrayRef partitionNames) {
-        RetainPtr<CFArrayRef> hostNamesInPersistentStore = adoptCF(WKCFURLCacheCopyAllHostNamesInPersistentStoreForPartition(CFSTR("")));
-        RetainPtr<CFMutableArrayRef> hostNames = adoptCF(CFArrayCreateMutableCopy(0, 0, hostNamesInPersistentStore.get()));
-        if (partitionNames) {
-            CFArrayAppendArray(hostNames.get(), partitionNames, CFRangeMake(0, CFArrayGetCount(partitionNames)));
-            CFRelease(partitionNames);
-        }
-
-        for (CFIndex i = 0, size = CFArrayGetCount(hostNames.get()); i < size; ++i) {
-            CFStringRef host = static_cast<CFStringRef>(CFArrayGetValueAtIndex(hostNames.get(), i));
-
-            result.append(WebCore::SecurityOrigin::create("http", host, 0));
-        }
-    });
-
-    return result;
-}
-
-void NetworkProcess::clearCFURLCacheForOrigins(const Vector<WebCore::SecurityOriginData>& origins)
-{
-    auto hostNames = adoptCF(CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks));
-    for (auto& origin : origins)
-        CFArrayAppendValue(hostNames.get(), origin.host.createCFString().get());
-
-    WKCFURLCacheDeleteHostNamesInPersistentStore(hostNames.get());
-
-    for (CFIndex i = 0, size = CFArrayGetCount(hostNames.get()); i < size; ++i) {
-        RetainPtr<CFStringRef> partition = partitionName(static_cast<CFStringRef>(CFArrayGetValueAtIndex(hostNames.get(), i)));
-        RetainPtr<CFArrayRef> partitionHostNames = adoptCF(WKCFURLCacheCopyAllHostNamesInPersistentStoreForPartition(partition.get()));
-        WKCFURLCacheDeleteHostNamesInPersistentStoreForPartition(partitionHostNames.get(), partition.get());
-    }
-}
-
 void NetworkProcess::clearHSTSCache(WebCore::NetworkStorageSession& session, std::chrono::system_clock::time_point modifiedSince)
 {
     NSTimeInterval timeInterval = std::chrono::duration_cast<std::chrono::duration<double>>(modifiedSince.time_since_epoch()).count();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to