Remove PurgeableBuffer since it is not very useful any more
authorpsolanki@apple.com <psolanki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Aug 2014 23:25:49 +0000 (23:25 +0000)
committerpsolanki@apple.com <psolanki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Aug 2014 23:25:49 +0000 (23:25 +0000)
commitc7a647f6593eab34410332fd5b4420a1a1c48203
tree290de39bcfb5dd552476a1751af3bfe9ce86da4d
parenta00f7999e3df701c89605501d899477146a462d7
Remove PurgeableBuffer since it is not very useful any more
https://bugs.webkit.org/show_bug.cgi?id=135939

Reviewed by Geoffrey Garen.

Source/WebCore:

The usefulness of having purgeable memory for cached resources has diminished now that
WebKit uses file backed resources when possible. Since this is read only memory, it is in
essence "purgeable". Having the PurgeableBuffer code adds additional complexity that we
don't need. e.g. on my Mac, I am not seeing any entry for "WebCore purgeable data" when I
run vmmap against the web processes that I have running. It is used on iOS, however even
there much of the purgeable memory we create gets replaced by file backed memory once we get
the notification from CFNetwork.

No new tests because no functional changes.

* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorPageAgent.cpp:
(WebCore::prepareCachedResourceBuffer):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::subresource):
* loader/ResourceBuffer.cpp:
(WebCore::ResourceBuffer::hasPurgeableBuffer): Deleted.
(WebCore::ResourceBuffer::setShouldUsePurgeableMemory): Deleted.
(WebCore::ResourceBuffer::createPurgeableBuffer): Deleted.
(WebCore::ResourceBuffer::releasePurgeableBuffer): Deleted.
* loader/ResourceBuffer.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didFinishLoading):
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::sheetText):
(WebCore::CachedCSSStyleSheet::destroyDecodedData):
* loader/cache/CachedCSSStyleSheet.h:
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::image):
(WebCore::CachedImage::imageForRenderer):
(WebCore::CachedImage::imageSizeForRenderer):
(WebCore::CachedImage::destroyDecodedData):
(WebCore::CachedImage::canUseDiskImageCache):
* loader/cache/CachedImage.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::addClientToSet):
(WebCore::CachedResource::isSafeToMakePurgeable): Deleted.
(WebCore::CachedResource::makePurgeable): Deleted.
(WebCore::CachedResource::isPurgeable): Deleted.
(WebCore::CachedResource::wasPurged): Deleted.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::resourceBuffer):
(WebCore::CachedResource::purgePriority): Deleted.
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::script):
(WebCore::CachedScript::destroyDecodedData):
* loader/cache/CachedScript.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::resourceForRequestImpl):
(WebCore::MemoryCache::pruneDeadResourcesToSize):
(WebCore::MemoryCache::evict):
(WebCore::MemoryCache::TypeStatistic::addResource):
(WebCore::MemoryCache::dumpStats):
(WebCore::MemoryCache::dumpLRULists):
(WebCore::MemoryCache::makeResourcePurgeable): Deleted.
* loader/cache/MemoryCache.h:
(WebCore::MemoryCache::TypeStatistic::TypeStatistic):
(WebCore::MemoryCache::shouldMakeResourcePurgeableOnEviction): Deleted.
* platform/PurgePriority.h: Removed.
* platform/PurgeableBuffer.h: Removed.
* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::SharedBuffer):
(WebCore::SharedBuffer::size):
(WebCore::SharedBuffer::data):
(WebCore::SharedBuffer::append):
(WebCore::SharedBuffer::clear):
(WebCore::SharedBuffer::copy):
(WebCore::SharedBuffer::getSomeData):
(WebCore::SharedBuffer::adoptPurgeableBuffer): Deleted.
(WebCore::SharedBuffer::createPurgeableBuffer): Deleted.
(WebCore::SharedBuffer::releasePurgeableBuffer): Deleted.
* platform/SharedBuffer.h:
(WebCore::SharedBuffer::hasPurgeableBuffer): Deleted.
(WebCore::SharedBuffer::shouldUsePurgeableMemory): Deleted.
* platform/cf/SharedBufferCF.cpp:
(WebCore::SharedBuffer::SharedBuffer):
* platform/mac/PurgeableBufferMac.cpp: Removed.
* platform/mac/SharedBufferMac.mm:
(WebCore::SharedBuffer::createCFData):
* platform/soup/SharedBufferSoup.cpp:

Source/WebKit/mac:

* Misc/WebCache.mm:
(+[WebCache statistics]):

Source/WebKit/win:

* WebCache.cpp:
(WebCache::statistics):

Source/WebKit2:

* WebProcess/WebProcess.cpp:
(WebKit::getWebCoreMemoryCacheStatistics):

Source/WTF:

* wtf/Platform.h: Remove ENABLE_PURGEABLE_MEMORY define.
* wtf/VMTags.h: Remove VM tags used by WebCore for cached resource purgeable memory.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
34 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WTF/wtf/VMTags.h
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/ResourceBuffer.cpp
Source/WebCore/loader/ResourceBuffer.h
Source/WebCore/loader/SubresourceLoader.cpp
Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp
Source/WebCore/loader/cache/CachedCSSStyleSheet.h
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/loader/cache/CachedImage.h
Source/WebCore/loader/cache/CachedResource.cpp
Source/WebCore/loader/cache/CachedResource.h
Source/WebCore/loader/cache/CachedScript.cpp
Source/WebCore/loader/cache/CachedScript.h
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/loader/cache/MemoryCache.h
Source/WebCore/platform/PurgePriority.h [deleted file]
Source/WebCore/platform/PurgeableBuffer.h [deleted file]
Source/WebCore/platform/SharedBuffer.cpp
Source/WebCore/platform/SharedBuffer.h
Source/WebCore/platform/cf/SharedBufferCF.cpp
Source/WebCore/platform/mac/PurgeableBufferMac.cpp [deleted file]
Source/WebCore/platform/mac/SharedBufferMac.mm
Source/WebCore/platform/soup/SharedBufferSoup.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebCache.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCache.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebProcess.cpp