Changeset 145419 in webkit


Ignore:
Timestamp:
Mar 11, 2013 3:38:27 PM (11 years ago)
Author:
jpfau@apple.com
Message:

List cache partitions as units instead of as their contents
https://bugs.webkit.org/show_bug.cgi?id=111909

Reviewed by Maciej Stachowiak.

Source/WebCore:

Not possible to test with current automated test tools, must be tested manually.

  • loader/cache/MemoryCache.cpp:

(WebCore::MemoryCache::getOriginsWithCache): List a cache item as a member of a partition, if possible

Source/WebKit2:

  • WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.cpp:

(WebKit::WebResourceCacheManager::cfURLCacheHostNames): Attempt to enumerate cache partitions based on information we have

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r145416 r145419  
     12013-03-11  Jeffrey Pfau  <jpfau@apple.com>
     2
     3        List cache partitions as units instead of as their contents
     4        https://bugs.webkit.org/show_bug.cgi?id=111909
     5
     6        Reviewed by Maciej Stachowiak.
     7
     8        Not possible to test with current automated test tools, must be tested manually.
     9
     10        * loader/cache/MemoryCache.cpp:
     11        (WebCore::MemoryCache::getOriginsWithCache): List a cache item as a member of a partition, if possible
     12
    1132013-03-11  Alexey Proskuryakov  <ap@apple.com>
    214
  • trunk/Source/WebCore/loader/cache/MemoryCache.cpp

    r145161 r145419  
    601601void MemoryCache::getOriginsWithCache(SecurityOriginSet& origins)
    602602{
     603#if ENABLE(CACHE_PARTITIONING)
     604    DEFINE_STATIC_LOCAL(String, httpString, ("http"));
     605#endif
    603606    CachedResourceMap::iterator e = m_resources.end();
    604     for (CachedResourceMap::iterator it = m_resources.begin(); it != e; ++it)
    605 #if ENABLE(CACHE_PARTITIONING)
    606         origins.add(SecurityOrigin::createFromString(it->value->begin()->value->url()));
     607    for (CachedResourceMap::iterator it = m_resources.begin(); it != e; ++it) {
     608#if ENABLE(CACHE_PARTITIONING)
     609        if (it->value->begin()->key == emptyString())
     610            origins.add(SecurityOrigin::createFromString(it->value->begin()->value->url()));
     611        else
     612            origins.add(SecurityOrigin::create(httpString, it->value->begin()->key, 0));
    607613#else
    608614        origins.add(SecurityOrigin::createFromString(it->value->url()));
    609615#endif
     616    }
    610617}
    611618
  • trunk/Source/WebKit2/ChangeLog

    r145409 r145419  
     12013-03-11  Jeffrey Pfau  <jpfau@apple.com>
     2
     3        List cache partitions as units instead of as their contents
     4        https://bugs.webkit.org/show_bug.cgi?id=111909
     5
     6        Reviewed by Maciej Stachowiak.
     7
     8        * WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.cpp:
     9        (WebKit::WebResourceCacheManager::cfURLCacheHostNames): Attempt to enumerate cache partitions based on information we have
     10
    1112013-01-30  Jer Noble  <jer.noble@apple.com>
    212
  • trunk/Source/WebKit2/WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.cpp

    r145161 r145419  
    5858RetainPtr<CFArrayRef> WebResourceCacheManager::cfURLCacheHostNames()
    5959{
    60     return RetainPtr<CFArrayRef>(AdoptCF, WKCFURLCacheCopyAllHostNamesInPersistentStore());
     60    RetainPtr<CFArrayRef> hostNames(AdoptCF, WKCFURLCacheCopyAllHostNamesInPersistentStore());
     61#if ENABLE(CACHE_PARTITIONING)
     62    RetainPtr<CFMutableArrayRef> partitions(AdoptCF, CFArrayCreateMutable(0, 0, &kCFTypeArrayCallBacks));
     63    CFIndex size = CFArrayGetCount(hostNames.get());
     64    for (CFIndex i = 0; i < size; ++i) {
     65        RetainPtr<CFStringRef> partition = partitionName(static_cast<CFStringRef>(CFArrayGetValueAtIndex(hostNames.get(), i)));
     66        RetainPtr<CFArrayRef> partitionHostNames(AdoptCF, WKCFURLCacheCopyAllHostNamesInPersistentStoreForPartition(partition.get()));
     67        if (CFArrayGetCount(partitionHostNames.get()))
     68            CFArrayAppendValue(partitions.get(), partition.get());
     69    }
     70
     71    RetainPtr<CFArrayRef> rootHostNames(AdoptCF, WKCFURLCacheCopyAllHostNamesInPersistentStoreForPartition(CFSTR("")));
     72    CFArrayAppendArray(partitions.get(), rootHostNames.get(), CFRangeMake(0, CFArrayGetCount(rootHostNames.get())));
     73    return partitions;
     74#else
     75    return hostNames;
     76#endif
    6177}
    6278
Note: See TracChangeset for help on using the changeset viewer.