Diff
Modified: trunk/Source/WebKit2/ChangeLog (148328 => 148329)
--- trunk/Source/WebKit2/ChangeLog 2013-04-13 01:02:54 UTC (rev 148328)
+++ trunk/Source/WebKit2/ChangeLog 2013-04-13 01:09:47 UTC (rev 148329)
@@ -1,3 +1,24 @@
+2013-04-12 Jeffrey Pfau <jp...@apple.com>
+
+ Query directly for cache partition names
+ https://bugs.webkit.org/show_bug.cgi?id=114538
+
+ Reviewed by David Kilzer.
+
+ Call back into WebKitSystemInterface to ask it for the cache
+ partition names instead of trying to figure them out.
+
+ * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
+ (WebKit::WebResourceCacheManager::getCacheOrigins):
+ (WebKit):
+ (WebKit::WebResourceCacheManager::returnCacheOrigins):
+ * WebProcess/ResourceCache/WebResourceCacheManager.h:
+ (WebResourceCacheManager):
+ * WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.cpp:
+ (WebKit::WebResourceCacheManager::cfURLCacheHostNames):
+ (WebKit):
+ (WebKit::WebResourceCacheManager::cfURLCacheHostNamesWithCallback):
+
2013-04-12 Gavin Barraclough <barraclo...@apple.com>
Build fix - too soon!
Modified: trunk/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp (148328 => 148329)
--- trunk/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp 2013-04-13 01:02:54 UTC (rev 148328)
+++ trunk/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp 2013-04-13 01:09:47 UTC (rev 148329)
@@ -53,20 +53,37 @@
void WebResourceCacheManager::getCacheOrigins(uint64_t callbackID) const
{
+#if USE(CFURLCACHE) && ENABLE(CACHE_PARTITIONING)
+ __block MemoryCache::SecurityOriginSet origins;
+#else
MemoryCache::SecurityOriginSet origins;
+#endif
memoryCache()->getOriginsWithCache(origins);
#if USE(CFURLCACHE)
- RetainPtr<CFArrayRef> cfURLHosts = cfURLCacheHostNames();
- CFIndex size = cfURLHosts ? CFArrayGetCount(cfURLHosts.get()) : 0;
+#if ENABLE(CACHE_PARTITIONING)
+ cfURLCacheHostNamesWithCallback(^(RetainPtr<CFArrayRef> cfURLHosts) {
+#else
+ RetainPtr<CFArrayRef> cfURLHosts = cfURLCacheHostNames();
+#endif
+ CFIndex size = cfURLHosts ? CFArrayGetCount(cfURLHosts.get()) : 0;
- String httpString("http");
- for (CFIndex i = 0; i < size; ++i) {
- CFStringRef host = static_cast<CFStringRef>(CFArrayGetValueAtIndex(cfURLHosts.get(), i));
- origins.add(SecurityOrigin::create(httpString, host, 0));
- }
+ String httpString("http");
+ for (CFIndex i = 0; i < size; ++i) {
+ CFStringRef host = static_cast<CFStringRef>(CFArrayGetValueAtIndex(cfURLHosts.get(), i));
+ origins.add(SecurityOrigin::create(httpString, host, 0));
+ }
#endif
+ returnCacheOrigins(callbackID, origins);
+
+#if USE(CFURLCACHE) && ENABLE(CACHE_PARTITIONING)
+ });
+#endif
+}
+
+void WebResourceCacheManager::returnCacheOrigins(uint64_t callbackID, const MemoryCache::SecurityOriginSet& origins) const
+{
// Create a list with the origins in both of the caches.
Vector<SecurityOriginData> identifiers;
identifiers.reserveCapacity(origins.size());
Modified: trunk/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.h (148328 => 148329)
--- trunk/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.h 2013-04-13 01:02:54 UTC (rev 148328)
+++ trunk/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.h 2013-04-13 01:09:47 UTC (rev 148329)
@@ -29,6 +29,7 @@
#include "MessageReceiver.h"
#include "ResourceCachesToClear.h"
#include "WebProcessSupplement.h"
+#include <WebCore/MemoryCache.h>
#include <wtf/Noncopyable.h>
#include <wtf/RetainPtr.h>
#include <wtf/text/WTFString.h>
@@ -51,11 +52,16 @@
virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) OVERRIDE;
void getCacheOrigins(uint64_t callbackID) const;
+ void returnCacheOrigins(uint64_t callbackID, const WebCore::MemoryCache::SecurityOriginSet&) const;
void clearCacheForOrigin(const SecurityOriginData&, uint32_t cachesToClear) const;
void clearCacheForAllOrigins(uint32_t cachesToClear) const;
#if USE(CFURLCACHE)
static RetainPtr<CFArrayRef> cfURLCacheHostNames();
+#if ENABLE(CACHE_PARTITIONING)
+ typedef void (^CacheCallback)(RetainPtr<CFArrayRef>);
+ static void cfURLCacheHostNamesWithCallback(CacheCallback);
+#endif
static void clearCFURLCacheForHostNames(CFArrayRef);
#endif
Modified: trunk/Source/WebKit2/WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.cpp (148328 => 148329)
--- trunk/Source/WebKit2/WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.cpp 2013-04-13 01:02:54 UTC (rev 148328)
+++ trunk/Source/WebKit2/WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.cpp 2013-04-13 01:09:47 UTC (rev 148329)
@@ -57,24 +57,20 @@
RetainPtr<CFArrayRef> WebResourceCacheManager::cfURLCacheHostNames()
{
- RetainPtr<CFArrayRef> hostNames(AdoptCF, WKCFURLCacheCopyAllHostNamesInPersistentStore());
-#if ENABLE(CACHE_PARTITIONING)
- RetainPtr<CFMutableArrayRef> partitions(AdoptCF, CFArrayCreateMutable(0, 0, &kCFTypeArrayCallBacks));
- CFIndex size = CFArrayGetCount(hostNames.get());
- for (CFIndex i = 0; i < size; ++i) {
- RetainPtr<CFStringRef> partition = partitionName(static_cast<CFStringRef>(CFArrayGetValueAtIndex(hostNames.get(), i)));
- RetainPtr<CFArrayRef> partitionHostNames(AdoptCF, WKCFURLCacheCopyAllHostNamesInPersistentStoreForPartition(partition.get()));
- if (CFArrayGetCount(partitionHostNames.get()))
- CFArrayAppendValue(partitions.get(), partition.get());
- }
+ return RetainPtr<CFArrayRef>(AdoptCF, WKCFURLCacheCopyAllHostNamesInPersistentStore());
+}
- RetainPtr<CFArrayRef> rootHostNames(AdoptCF, WKCFURLCacheCopyAllHostNamesInPersistentStoreForPartition(CFSTR("")));
- CFArrayAppendArray(partitions.get(), rootHostNames.get(), CFRangeMake(0, CFArrayGetCount(rootHostNames.get())));
- return partitions;
-#else
- return hostNames;
-#endif
+#if ENABLE(CACHE_PARTITIONING)
+void WebResourceCacheManager::cfURLCacheHostNamesWithCallback(CacheCallback callback)
+{
+ WKCFURLCacheCopyAllPartitionNames(^(CFArrayRef partitionNames) {
+ CFMutableArrayRef hostNames = CFArrayCreateMutableCopy(0, 0, WKCFURLCacheCopyAllHostNamesInPersistentStoreForPartition(CFSTR("")));
+ CFArrayAppendArray(hostNames, partitionNames, CFRangeMake(0, CFArrayGetCount(partitionNames)));
+ CFRelease(partitionNames);
+ callback(adoptCF(hostNames));
+ });
}
+#endif
void WebResourceCacheManager::clearCFURLCacheForHostNames(CFArrayRef hostNames)
{
Modified: trunk/WebKitLibraries/ChangeLog (148328 => 148329)
--- trunk/WebKitLibraries/ChangeLog 2013-04-13 01:02:54 UTC (rev 148328)
+++ trunk/WebKitLibraries/ChangeLog 2013-04-13 01:09:47 UTC (rev 148329)
@@ -1,3 +1,14 @@
+2013-04-12 Jeffrey Pfau <jp...@apple.com>
+
+ Query directly for cache partition names
+ https://bugs.webkit.org/show_bug.cgi?id=114538
+
+ Reviewed by David Kilzer.
+
+ * WebKitSystemInterface.h:
+ * libWebKitSystemInterfaceLion.a:
+ * libWebKitSystemInterfaceMountainLion.a:
+
2013-04-08 Roger Fong <roger_f...@apple.com>
Build fix.
Modified: trunk/WebKitLibraries/WebKitSystemInterface.h (148328 => 148329)
--- trunk/WebKitLibraries/WebKitSystemInterface.h 2013-04-13 01:02:54 UTC (rev 148328)
+++ trunk/WebKitLibraries/WebKitSystemInterface.h 2013-04-13 01:09:47 UTC (rev 148329)
@@ -501,8 +501,11 @@
bool WKIsPublicSuffix(NSString *domain);
CFArrayRef WKCFURLCacheCopyAllHostNamesInPersistentStoreForPartition(CFStringRef partition);
+typedef void (^CFURLCacheCopyAllPartitionNamesResultsNotification)(CFArrayRef partitionNames);
+
void WKCFURLCacheDeleteHostNamesInPersistentStoreForPartition(CFArrayRef hostArray, CFStringRef partition);
CFStringRef WKCachePartitionKey(void);
+void WKCFURLCacheCopyAllPartitionNames(CFURLCacheCopyAllPartitionNamesResultsNotification resultsBlock);
#endif
#ifdef __cplusplus
Modified: trunk/WebKitLibraries/libWebKitSystemInterfaceLion.a
(Binary files differ)
Modified: trunk/WebKitLibraries/libWebKitSystemInterfaceMountainLion.a
(Binary files differ)