Commit 94d2d9fd authored by abarth@webkit.org's avatar abarth@webkit.org

2010-11-07 Adam Barth <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Rename Cache to MemoryCache
        https://bugs.webkit.org/show_bug.cgi?id=49159

        * public/WebCache.h:
        * src/WebCache.cpp:
        (WebKit::ToResourceTypeStat):
        (WebKit::WebCache::setCapacities):
        (WebKit::WebCache::clear):
        (WebKit::WebCache::getUsageStats):
        (WebKit::WebCache::getResourceTypeStats):
2010-11-07  Adam Barth  <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Rename Cache to MemoryCache
        https://bugs.webkit.org/show_bug.cgi?id=49159

        * Api/qwebpage.cpp:
        * Api/qwebsettings.cpp:
2010-11-07  Adam Barth  <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Rename Cache to MemoryCache
        https://bugs.webkit.org/show_bug.cgi?id=49159

        * webkit/webkitwebview.cpp:
2010-11-07  Adam Barth  <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Rename Cache to MemoryCache
        https://bugs.webkit.org/show_bug.cgi?id=49159

        * WebCache.cpp:
        (WebCache::statistics):
        * WebFrame.cpp:
        * WebView.cpp:
2010-11-07  Adam Barth  <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Rename Cache to MemoryCache
        https://bugs.webkit.org/show_bug.cgi?id=49159

        * WebView.cpp:
        (wxWebView::SetCachePolicy):
        * WebView.h:
2010-11-07  Adam Barth  <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Rename Cache to MemoryCache
        https://bugs.webkit.org/show_bug.cgi?id=49159

        * Misc/WebCache.mm:
        (+[WebCache statistics]):
        * WebCoreSupport/WebDeviceOrientationClient.mm:
        (WebDeviceOrientationClient::setController):
        * WebView/WebView.mm:
2010-11-07  Adam Barth  <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Rename Cache to MemoryCache
        https://bugs.webkit.org/show_bug.cgi?id=49159

        So sayeth the diagram.

        * Android.mk:
        * CMakeLists.txt:
        * GNUmakefile.am:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSImageValue.cpp:
        * dom/ContainerNode.cpp:
        * history/PageCache.cpp:
        * inspector/InspectorCSSStore.h:
        * inspector/InspectorResourceAgent.cpp:
        * loader/FrameLoader.cpp:
        * loader/archive/cf/LegacyWebArchive.cpp:
        * loader/cache/Cache.cpp: Removed.
        * loader/cache/Cache.h: Removed.
        * loader/cache/CachedCSSStyleSheet.cpp:
        (WebCore::CachedCSSStyleSheet::allClientsRemoved):
        * loader/cache/CachedFont.cpp:
        * loader/cache/CachedFont.h:
        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::destroyDecodedData):
        * loader/cache/CachedImage.h:
        * loader/cache/CachedResource.cpp:
        * loader/cache/CachedResource.h:
        * loader/cache/CachedResourceLoader.cpp:
        * loader/cache/CachedResourceLoader.h:
        * loader/cache/CachedScript.cpp:
        (WebCore::CachedScript::destroyDecodedData):
        * loader/cache/MemoryCache.cpp: Copied from WebCore/loader/cache/Cache.cpp.
        (WebCore::cache):
        (WebCore::MemoryCache::MemoryCache):
        (WebCore::MemoryCache::requestResource):
        (WebCore::MemoryCache::requestUserCSSStyleSheet):
        (WebCore::MemoryCache::revalidateResource):
        (WebCore::MemoryCache::revalidationSucceeded):
        (WebCore::MemoryCache::revalidationFailed):
        (WebCore::MemoryCache::resourceForURL):
        (WebCore::MemoryCache::deadCapacity):
        (WebCore::MemoryCache::liveCapacity):
        (WebCore::MemoryCache::pruneLiveResources):
        (WebCore::MemoryCache::pruneDeadResources):
        (WebCore::MemoryCache::setCapacities):
        (WebCore::MemoryCache::makeResourcePurgeable):
        (WebCore::MemoryCache::evict):
        (WebCore::MemoryCache::addCachedResourceLoader):
        (WebCore::MemoryCache::removeCachedResourceLoader):
        (WebCore::MemoryCache::lruListFor):
        (WebCore::MemoryCache::removeFromLRUList):
        (WebCore::MemoryCache::insertInLRUList):
        (WebCore::MemoryCache::resourceAccessed):
        (WebCore::MemoryCache::removeFromLiveDecodedResourcesList):
        (WebCore::MemoryCache::insertInLiveDecodedResourcesList):
        (WebCore::MemoryCache::addToLiveResourcesSize):
        (WebCore::MemoryCache::removeFromLiveResourcesSize):
        (WebCore::MemoryCache::adjustSize):
        (WebCore::MemoryCache::TypeStatistic::addResource):
        (WebCore::MemoryCache::getStatistics):
        (WebCore::MemoryCache::setDisabled):
        (WebCore::MemoryCache::dumpStats):
        (WebCore::MemoryCache::dumpLRULists):
        * loader/cache/MemoryCache.h: Copied from WebCore/loader/cache/Cache.h.
        (WebCore::MemoryCache::shouldMakeResourcePurgeableOnEviction):
        * loader/loader.cpp:
        * page/EventSource.cpp:
        * page/Settings.h:
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::createRequest):
2010-11-07  Adam Barth  <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Rename Cache to MemoryCache
        https://bugs.webkit.org/show_bug.cgi?id=49159

        * WebProcess/WebProcess.cpp:
        * WebProcess/mac/WebProcessMac.mm:
        * WebProcess/win/WebProcessWin.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 76be2dbf
......@@ -387,7 +387,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
loader/appcache/DOMApplicationCache.cpp \
loader/appcache/ManifestParser.cpp \
\
loader/cache/Cache.cpp \
loader/cache/MemoryCache.cpp \
\
loader/icon/IconDatabase.cpp \
loader/icon/IconFetcher.cpp \
......
......@@ -1191,7 +1191,7 @@ SET(WebCore_SOURCES
loader/archive/ArchiveResource.cpp
loader/archive/ArchiveResourceCollection.cpp
loader/cache/Cache.cpp
loader/cache/MemoryCache.cpp
loader/icon/IconDatabase.cpp
loader/icon/IconLoader.cpp
......
2010-11-07 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
Rename Cache to MemoryCache
https://bugs.webkit.org/show_bug.cgi?id=49159
So sayeth the diagram.
* Android.mk:
* CMakeLists.txt:
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSImageValue.cpp:
* dom/ContainerNode.cpp:
* history/PageCache.cpp:
* inspector/InspectorCSSStore.h:
* inspector/InspectorResourceAgent.cpp:
* loader/FrameLoader.cpp:
* loader/archive/cf/LegacyWebArchive.cpp:
* loader/cache/Cache.cpp: Removed.
* loader/cache/Cache.h: Removed.
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::allClientsRemoved):
* loader/cache/CachedFont.cpp:
* loader/cache/CachedFont.h:
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::destroyDecodedData):
* loader/cache/CachedImage.h:
* loader/cache/CachedResource.cpp:
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::destroyDecodedData):
* loader/cache/MemoryCache.cpp: Copied from WebCore/loader/cache/Cache.cpp.
(WebCore::cache):
(WebCore::MemoryCache::MemoryCache):
(WebCore::MemoryCache::requestResource):
(WebCore::MemoryCache::requestUserCSSStyleSheet):
(WebCore::MemoryCache::revalidateResource):
(WebCore::MemoryCache::revalidationSucceeded):
(WebCore::MemoryCache::revalidationFailed):
(WebCore::MemoryCache::resourceForURL):
(WebCore::MemoryCache::deadCapacity):
(WebCore::MemoryCache::liveCapacity):
(WebCore::MemoryCache::pruneLiveResources):
(WebCore::MemoryCache::pruneDeadResources):
(WebCore::MemoryCache::setCapacities):
(WebCore::MemoryCache::makeResourcePurgeable):
(WebCore::MemoryCache::evict):
(WebCore::MemoryCache::addCachedResourceLoader):
(WebCore::MemoryCache::removeCachedResourceLoader):
(WebCore::MemoryCache::lruListFor):
(WebCore::MemoryCache::removeFromLRUList):
(WebCore::MemoryCache::insertInLRUList):
(WebCore::MemoryCache::resourceAccessed):
(WebCore::MemoryCache::removeFromLiveDecodedResourcesList):
(WebCore::MemoryCache::insertInLiveDecodedResourcesList):
(WebCore::MemoryCache::addToLiveResourcesSize):
(WebCore::MemoryCache::removeFromLiveResourcesSize):
(WebCore::MemoryCache::adjustSize):
(WebCore::MemoryCache::TypeStatistic::addResource):
(WebCore::MemoryCache::getStatistics):
(WebCore::MemoryCache::setDisabled):
(WebCore::MemoryCache::dumpStats):
(WebCore::MemoryCache::dumpLRULists):
* loader/cache/MemoryCache.h: Copied from WebCore/loader/cache/Cache.h.
(WebCore::MemoryCache::shouldMakeResourcePurgeableOnEviction):
* loader/loader.cpp:
* page/EventSource.cpp:
* page/Settings.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):
2010-11-07 Eric Seidel <eric@webkit.org>
Unreviewed. Attempt to fix the windows build.
......@@ -1906,7 +1906,7 @@ webcore_sources += \
WebCore/loader/archive/ArchiveResourceCollection.h \
WebCore/loader/archive/ArchiveResource.cpp \
WebCore/loader/archive/ArchiveResource.h \
WebCore/loader/cache/Cache.cpp \
WebCore/loader/cache/MemoryCache.cpp \
WebCore/loader/cache/CachedCSSStyleSheet.cpp \
WebCore/loader/cache/CachedCSSStyleSheet.h \
WebCore/loader/cache/CachedFont.cpp \
......@@ -1926,7 +1926,7 @@ webcore_sources += \
WebCore/loader/cache/CachedScript.h \
WebCore/loader/cache/CachedXSLStyleSheet.cpp \
WebCore/loader/cache/CachedXSLStyleSheet.h \
WebCore/loader/cache/Cache.h \
WebCore/loader/cache/MemoryCache.h \
WebCore/loader/cache/CachePolicy.h \
WebCore/loader/CachedMetadata.h \
WebCore/loader/CrossOriginAccessControl.cpp \
......
......@@ -200,6 +200,9 @@ __ZN7WebCore11HistoryItemC1ERKN3WTF6StringES4_d
__ZN7WebCore11HistoryItemC1ERKNS_4KURLERKN3WTF6StringES7_S7_
__ZN7WebCore11HistoryItemC1Ev
__ZN7WebCore11HistoryItemD1Ev
__ZN7WebCore11MemoryCache13getStatisticsEv
__ZN7WebCore11MemoryCache11setDisabledEb
__ZN7WebCore11MemoryCache13setCapacitiesEjjj
__ZN7WebCore11RenderLayer19scrollRectToVisibleERKNS_7IntRectEbRKNS_15ScrollAlignmentES6_
__ZN7WebCore11globalPointERK8_NSPointP8NSWindow
__ZN7WebCore11toUserSpaceERK7_NSRectP8NSWindow
......@@ -629,9 +632,6 @@ __ZN7WebCore4coreEP20NSURLProtectionSpace
__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_19CSSStyleDeclarationE
__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_5RangeE
__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_8NodeListE
__ZN7WebCore5Cache11setDisabledEb
__ZN7WebCore5Cache13getStatisticsEv
__ZN7WebCore5Cache13setCapacitiesEjjj
__ZN7WebCore5Frame10createViewERKNS_7IntSizeERKNS_5ColorEbS3_bNS_13ScrollbarModeEbS7_b
__ZN7WebCore5Frame14frameForWidgetEPKNS_6WidgetE
__ZN7WebCore5Frame17setPageZoomFactorEf
......
......@@ -2011,8 +2011,8 @@
'loader/archive/ArchiveResource.h',
'loader/archive/ArchiveResourceCollection.cpp',
'loader/archive/ArchiveResourceCollection.h',
'loader/cache/Cache.cpp',
'loader/cache/Cache.h',
'loader/cache/MemoryCache.cpp',
'loader/cache/MemoryCache.h',
'loader/cache/CachedCSSStyleSheet.cpp',
'loader/cache/CachedCSSStyleSheet.h',
'loader/cache/CachedFont.cpp',
......
......@@ -1032,7 +1032,7 @@ SOURCES += \
loader/archive/ArchiveFactory.cpp \
loader/archive/ArchiveResource.cpp \
loader/archive/ArchiveResourceCollection.cpp \
loader/cache/Cache.cpp \
loader/cache/MemoryCache.cpp \
loader/cache/CachedCSSStyleSheet.cpp \
loader/cache/CachedFont.cpp \
loader/cache/CachedImage.cpp \
......@@ -1931,7 +1931,7 @@ HEADERS += \
loader/cache/CachedResourceHandle.h \
loader/cache/CachedScript.h \
loader/cache/CachedXSLStyleSheet.h \
loader/cache/Cache.h \
loader/cache/MemoryCache.h \
loader/CrossOriginAccessControl.h \
loader/CrossOriginPreflightResultCache.h \
loader/cache/CachedResourceLoader.h \
......
......@@ -24163,11 +24163,11 @@
Name="cache"
>
<File
RelativePath="..\loader\cache\Cache.cpp"
RelativePath="..\loader\cache\MemoryCache.cpp"
>
</File>
<File
RelativePath="..\loader\cache\Cache.h"
RelativePath="..\loader\cache\MemoryCache.h"
>
</File>
<File
......@@ -5034,8 +5034,8 @@
BCACF3BC1072921A00C0C8A3 /* UserContentURLPattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCACF3BA1072921A00C0C8A3 /* UserContentURLPattern.cpp */; };
BCACF3BD1072921A00C0C8A3 /* UserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = BCACF3BB1072921A00C0C8A3 /* UserContentURLPattern.h */; settings = {ATTRIBUTES = (Private, ); }; };
BCAEFCAE1016CE4A0040D34E /* DOMRGBColor.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCAEFCAD1016CE4A0040D34E /* DOMRGBColor.mm */; };
BCB16C170979C3BD00467741 /* Cache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16BFE0979C3BD00467741 /* Cache.cpp */; };
BCB16C180979C3BD00467741 /* Cache.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16BFF0979C3BD00467741 /* Cache.h */; settings = {ATTRIBUTES = (Private, ); }; };
BCB16C170979C3BD00467741 /* MemoryCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16BFE0979C3BD00467741 /* MemoryCache.cpp */; };
BCB16C180979C3BD00467741 /* MemoryCache.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16BFF0979C3BD00467741 /* MemoryCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
BCB16C190979C3BD00467741 /* CachedCSSStyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16C000979C3BD00467741 /* CachedCSSStyleSheet.cpp */; };
BCB16C1A0979C3BD00467741 /* CachedCSSStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16C010979C3BD00467741 /* CachedCSSStyleSheet.h */; };
BCB16C1B0979C3BD00467741 /* CachedImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16C020979C3BD00467741 /* CachedImage.cpp */; };
......@@ -11069,8 +11069,8 @@
BCACF3BA1072921A00C0C8A3 /* UserContentURLPattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserContentURLPattern.cpp; sourceTree = "<group>"; };
BCACF3BB1072921A00C0C8A3 /* UserContentURLPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserContentURLPattern.h; sourceTree = "<group>"; };
BCAEFCAD1016CE4A0040D34E /* DOMRGBColor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMRGBColor.mm; sourceTree = "<group>"; };
BCB16BFE0979C3BD00467741 /* Cache.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Cache.cpp; sourceTree = "<group>"; };
BCB16BFF0979C3BD00467741 /* Cache.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Cache.h; sourceTree = "<group>"; };
BCB16BFE0979C3BD00467741 /* MemoryCache.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryCache.cpp; sourceTree = "<group>"; };
BCB16BFF0979C3BD00467741 /* MemoryCache.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MemoryCache.h; sourceTree = "<group>"; };
BCB16C000979C3BD00467741 /* CachedCSSStyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CachedCSSStyleSheet.cpp; sourceTree = "<group>"; };
BCB16C010979C3BD00467741 /* CachedCSSStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CachedCSSStyleSheet.h; sourceTree = "<group>"; };
BCB16C020979C3BD00467741 /* CachedImage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CachedImage.cpp; sourceTree = "<group>"; };
......@@ -16043,8 +16043,8 @@
BCB16C0E0979C3BD00467741 /* CachedXSLStyleSheet.cpp */,
BCB16C0F0979C3BD00467741 /* CachedXSLStyleSheet.h */,
F587864902DE3A9A01EA4122 /* CachePolicy.h */,
BCB16BFE0979C3BD00467741 /* Cache.cpp */,
BCB16BFF0979C3BD00467741 /* Cache.h */,
BCB16BFE0979C3BD00467741 /* MemoryCache.cpp */,
BCB16BFF0979C3BD00467741 /* MemoryCache.h */,
);
path = cache;
sourceTree = "<group>";
......@@ -18564,7 +18564,7 @@
1A569CFA0D7E2B82007C3983 /* c_instance.h in Headers */,
1A569CFC0D7E2B82007C3983 /* c_runtime.h in Headers */,
1A569CFE0D7E2B82007C3983 /* c_utility.h in Headers */,
BCB16C180979C3BD00467741 /* Cache.h in Headers */,
BCB16C180979C3BD00467741 /* MemoryCache.h in Headers */,
BCB16C1A0979C3BD00467741 /* CachedCSSStyleSheet.h in Headers */,
BC64B4CC0CB4295D005F2B62 /* CachedFont.h in Headers */,
51C0AA390F2AA10A001648C2 /* CachedFrame.h in Headers */,
......@@ -21714,7 +21714,7 @@
1A569CF90D7E2B82007C3983 /* c_instance.cpp in Sources */,
1A569CFB0D7E2B82007C3983 /* c_runtime.cpp in Sources */,
1A569CFD0D7E2B82007C3983 /* c_utility.cpp in Sources */,
BCB16C170979C3BD00467741 /* Cache.cpp in Sources */,
BCB16C170979C3BD00467741 /* MemoryCache.cpp in Sources */,
BCB16C190979C3BD00467741 /* CachedCSSStyleSheet.cpp in Sources */,
BC64B4CB0CB4295D005F2B62 /* CachedFont.cpp in Sources */,
51C0AA410F2AA15E001648C2 /* CachedFrame.cpp in Sources */,
......@@ -22,7 +22,7 @@
#include "CSSImageValue.h"
#include "CSSValueKeywords.h"
#include "Cache.h"
#include "MemoryCache.h"
#include "CachedImage.h"
#include "CachedResourceLoader.h"
#include "StyleCachedImage.h"
......
......@@ -24,7 +24,7 @@
#include "ContainerNode.h"
#include "BeforeLoadEvent.h"
#include "Cache.h"
#include "MemoryCache.h"
#include "ContainerNodeAlgorithms.h"
#include "DeleteButtonController.h"
#include "EventNames.h"
......
......@@ -28,7 +28,7 @@
#include "ApplicationCacheHost.h"
#include "BackForwardController.h"
#include "Cache.h"
#include "MemoryCache.h"
#include "CachedPage.h"
#include "DOMWindow.h"
#include "DeviceMotionController.h"
......
......@@ -30,7 +30,7 @@
#define InspectorCSSStore_h
#include "CSSPropertySourceData.h"
#include "Cache.h"
#include "MemoryCache.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
......
......@@ -32,7 +32,7 @@
#include "InspectorResourceAgent.h"
#include "Base64.h"
#include "Cache.h"
#include "MemoryCache.h"
#include "CachedResource.h"
#include "CachedResourceLoader.h"
#include "Document.h"
......
......@@ -38,7 +38,7 @@
#include "ArchiveFactory.h"
#include "BackForwardController.h"
#include "BeforeUnloadEvent.h"
#include "Cache.h"
#include "MemoryCache.h"
#include "CachedPage.h"
#include "CachedResourceLoader.h"
#include "Chrome.h"
......
......@@ -29,7 +29,7 @@
#include "config.h"
#include "LegacyWebArchive.h"
#include "Cache.h"
#include "MemoryCache.h"
#include "Document.h"
#include "DocumentLoader.h"
#include "Frame.h"
......
......@@ -27,7 +27,7 @@
#include "config.h"
#include "CachedCSSStyleSheet.h"
#include "Cache.h"
#include "MemoryCache.h"
#include "CachedResourceClient.h"
#include "CachedResourceClientWalker.h"
#include "HTTPParsers.h"
......@@ -59,7 +59,7 @@ void CachedCSSStyleSheet::didAddClient(CachedResourceClient *c)
void CachedCSSStyleSheet::allClientsRemoved()
{
if (!Cache::shouldMakeResourcePurgeableOnEviction() && isSafeToMakePurgeable())
if (!MemoryCache::shouldMakeResourcePurgeableOnEviction() && isSafeToMakePurgeable())
makePurgeable(true);
}
......
......@@ -31,7 +31,7 @@
#define STORE_FONT_CUSTOM_PLATFORM_DATA
#endif
#include "Cache.h"
#include "MemoryCache.h"
#include "CachedResourceClient.h"
#include "CachedResourceClientWalker.h"
#include "FontPlatformData.h"
......
......@@ -39,7 +39,7 @@
namespace WebCore {
class CachedResourceLoader;
class Cache;
class MemoryCache;
class FontPlatformData;
class SVGFontElement;
......@@ -81,7 +81,7 @@ private:
RefPtr<SVGDocument> m_externalSVGDocument;
#endif
friend class Cache;
friend class MemoryCache;
};
}
......
......@@ -25,7 +25,7 @@
#include "CachedImage.h"
#include "BitmapImage.h"
#include "Cache.h"
#include "MemoryCache.h"
#include "CachedResourceClient.h"
#include "CachedResourceClientWalker.h"
#include "CachedResourceLoader.h"
......@@ -331,7 +331,7 @@ void CachedImage::destroyDecodedData()
// Invoking addClient() will reconstruct the image object.
m_image = 0;
setDecodedSize(0);
if (!Cache::shouldMakeResourcePurgeableOnEviction())
if (!MemoryCache::shouldMakeResourcePurgeableOnEviction())
makePurgeable(true);
} else if (m_image && !errorOccurred())
m_image->destroyDecodedData();
......
......@@ -32,10 +32,10 @@
namespace WebCore {
class CachedResourceLoader;
class Cache;
class MemoryCache;
class CachedImage : public CachedResource, public ImageObserver {
friend class Cache;
friend class MemoryCache;
public:
CachedImage(const String& url);
......
......@@ -24,7 +24,7 @@
#include "config.h"
#include "CachedResource.h"
#include "Cache.h"
#include "MemoryCache.h"
#include "CachedMetadata.h"
#include "CachedResourceClient.h"
#include "CachedResourceClientWalker.h"
......
......@@ -36,7 +36,7 @@
namespace WebCore {
class Cache;
class MemoryCache;
class CachedMetadata;
class CachedResourceClient;
class CachedResourceHandleBase;
......@@ -50,7 +50,7 @@ class Request;
// from CachedResourceClient, to get the function calls in case the requested data has arrived.
// This class also does the actual communication with the loader to obtain the resource from the network.
class CachedResource : public Noncopyable {
friend class Cache;
friend class MemoryCache;
friend class InspectorResource;
public:
......@@ -225,7 +225,7 @@ protected:
private:
void addClientToSet(CachedResourceClient*);
// These are called by the friendly Cache only
// These are called by the friendly MemoryCache only
void setResourceToRevalidate(CachedResource*);
void switchClientsToRevalidatedResource();
void clearResourceToRevalidate();
......
......@@ -27,23 +27,23 @@
#include "config.h"
#include "CachedResourceLoader.h"
#include "loader.h"
#include "Cache.h"
#include "CachedCSSStyleSheet.h"
#include "CachedFont.h"
#include "CachedImage.h"
#include "CachedScript.h"
#include "CachedXSLStyleSheet.h"
#include "Console.h"
#include "Document.h"
#include "DOMWindow.h"
#include "HTMLElement.h"
#include "Document.h"
#include "Frame.h"
#include "FrameLoader.h"
#include "FrameLoaderClient.h"
#include "HTMLElement.h"
#include "MemoryCache.h"
#include "PingLoader.h"
#include "SecurityOrigin.h"
#include "Settings.h"
#include "loader.h"
#include <wtf/text/StringConcatenate.h>
#define PRELOAD_DEBUG 0
......
......@@ -48,7 +48,7 @@ class KURL;
// The CachedResourceLoader manages the loading of scripts/images/stylesheets for a single document.
class CachedResourceLoader : public Noncopyable {
friend class Cache;
friend class MemoryCache;
friend class ImageLoader;
public:
......@@ -109,7 +109,7 @@ private:
void checkCacheObjectStatus(CachedResource*);
bool canRequest(CachedResource::Type, const KURL&);
Cache* m_cache;
MemoryCache* m_cache;
HashSet<String> m_reloadedURLs;
mutable DocumentResourceMap m_documentResources;
Document* m_doc;
......
......@@ -27,7 +27,7 @@
#include "config.h"
#include "CachedScript.h"
#include "Cache.h"
#include "MemoryCache.h"
#include "CachedResourceClient.h"
#include "CachedResourceClientWalker.h"
#include "SharedBuffer.h"
......@@ -111,7 +111,7 @@ void CachedScript::destroyDecodedData()
{
m_script = String();
setDecodedSize(0);
if (!Cache::shouldMakeResourcePurgeableOnEviction() && isSafeToMakePurgeable())
if (!MemoryCache::shouldMakeResourcePurgeableOnEviction() && isSafeToMakePurgeable())
makePurgeable(true);
}
......
......@@ -21,7 +21,7 @@
*/
#include "config.h"
#include "Cache.h"
#include "MemoryCache.h"
#include "CachedCSSStyleSheet.h"
#include "CachedFont.h"
......@@ -49,13 +49,13 @@ static const double cMinDelayBeforeLiveDecodedPrune = 1; // Seconds.
static const float cTargetPrunePercentage = .95f; // Percentage of capacity toward which we prune, to avoid immediately pruning again.
static const double cDefaultDecodedDataDeletionInterval = 0;
Cache* cache()
MemoryCache* cache()
{
static Cache* staticCache = new Cache;
static MemoryCache* staticCache = new MemoryCache;
return staticCache;
}
Cache::Cache()
MemoryCache::MemoryCache()
: m_disabled(false)
, m_pruneEnabled(true)
, m_inPruneDeadResources(false)
......@@ -94,9 +94,9 @@ static CachedResource* createResource(CachedResource::Type type, const KURL& url
return 0;
}
CachedResource* Cache::requestResource(CachedResourceLoader* cachedResourceLoader, CachedResource::Type type, const KURL& url, const String& charset, bool requestIsPreload)
CachedResource* MemoryCache::requestResource(CachedResourceLoader* cachedResourceLoader, CachedResource::Type type, const KURL& url, const String& charset, bool requestIsPreload)
{
LOG(ResourceLoading, "Cache::requestResource '%s', charset '%s', preload=%u", url.string().latin1().data(), charset.latin1().data(), requestIsPreload);
LOG(ResourceLoading, "MemoryCache::requestResource '%s', charset '%s', preload=%u", url.string().latin1().data(), charset.latin1().data(), requestIsPreload);
// FIXME: Do we really need to special-case an empty URL?
// Would it be better to just go on with the cache code and let it fail later?
......@@ -107,7 +107,7 @@ CachedResource* Cache::requestResource(CachedResourceLoader* cachedResourceLoade
CachedResource* resource = resourceForURL(url.string());
if (resource && requestIsPreload && !resource->isPreloaded()) {
LOG(ResourceLoading, "Cache::requestResource already has a preload request for this request, and it hasn't been preloaded yet");
LOG(ResourceLoading, "MemoryCache::requestResource already has a preload request for this request, and it hasn't been preloaded yet");
return 0;
}
......@@ -149,7 +149,7 @@ CachedResource* Cache::requestResource(CachedResourceLoader* cachedResourceLoade
}
if (resource->type() != type) {
LOG(ResourceLoading, "Cache::requestResource cannot use cached resource for '%s' due to type mismatch", url.string().latin1().data());
LOG(ResourceLoading, "MemoryCache::requestResource cannot use cached resource for '%s' due to type mismatch", url.string().latin1().data());
return 0;
}
......@@ -158,12 +158,12 @@ CachedResource* Cache::requestResource(CachedResourceLoader* cachedResourceLoade
resourceAccessed(resource);
}
LOG(ResourceLoading, "Cache::requestResource for '%s' returning resource %p\n", url.string().latin1().data(), resource);
LOG(ResourceLoading, "MemoryCache::requestResource for '%s' returning resource %p\n", url.string().latin1().data(), resource);
return resource;
}
CachedCSSStyleSheet* Cache::requestUserCSSStyleSheet(CachedResourceLoader* cachedResourceLoader, const String& url, const String& charset)
CachedCSSStyleSheet* MemoryCache::requestUserCSSStyleSheet(CachedResourceLoader* cachedResourceLoader, const String& url, const String& charset)
{
CachedCSSStyleSheet* userSheet;
if (CachedResource* existing = resourceForURL(url)) {
......@@ -192,7 +192,7 @@ CachedCSSStyleSheet* Cache::requestUserCSSStyleSheet(CachedResourceLoader* cache
return userSheet;
}
void Cache::revalidateResource(CachedResource* resource, CachedResourceLoader* cachedResourceLoader)
void MemoryCache::revalidateResource(CachedResource* resource, CachedResourceLoader* cachedResourceLoader)
{
ASSERT(resource);
ASSERT(resource->inCache());
......@@ -215,7 +215,7 @@ void Cache::revalidateResource(CachedResource* resource, CachedResourceLoader* c
newResource->load(cachedResourceLoader);
}
void Cache::revalidationSucceeded(CachedResource* revalidatingResource, const ResourceResponse& response)
void MemoryCache::revalidationSucceeded(CachedResource* revalidatingResource, const ResourceResponse& response)
{
CachedResource* resource = revalidatingResource->resourceToRevalidate();
ASSERT(resource);
......@@ -241,17 +241,17 @@ void Cache::revalidationSucceeded(CachedResource* revalidatingResource, const Re
revalidatingResource->clearResourceToRevalidate();
}
void Cache::revalidationFailed(CachedResource* revalidatingResource)
void MemoryCache::revalidationFailed(CachedResource* revalidatingResource)
{
LOG(ResourceLoading, "Revalidation failed for %p", revalidatingResource);
ASSERT(revalidatingResource->resourceToRevalidate());
revalidatingResource->clearResourceToRevalidate();
}
CachedResource* Cache::resourceForURL(const String& url)
CachedResource* MemoryCache::resourceForURL(const String& url)
{
CachedResource* resource = m_resources.get(url);
bool wasPurgeable = Cache::shouldMakeResourcePurgeableOnEviction() && resource && resource->isPurgeable();
bool wasPurgeable = MemoryCache::shouldMakeResourcePurgeableOnEviction() && resource && resource->isPurgeable();
if (resource && !resource->makePurgeable(false)) {
ASSERT(!resource->hasClients());
evict(resource);
......@@ -263,7 +263,7 @@ CachedResource* Cache::resourceForURL(const String& url)
return resource;
}
unsigned Cache::deadCapacity() const
unsigned MemoryCache::deadCapacity() const
{
// Dead resource capacity is whatever space is not occupied by live resources, bounded by an independent minimum and maximum.
unsigned capacity = m_capacity - min(m_liveSize, m_capacity); // Start with available capacity.
......@@ -272,13 +272,13 @@ unsigned Cache::deadCapacity() const
return capacity;
}
unsigned Cache::liveCapacity() const
unsigned MemoryCache::liveCapacity() const
{
// Live resource capacity is whatever is left over after calculating dead resource capacity.
return m_capacity - deadCapacity();
}
void Cache::pruneLiveResources()
void MemoryCache::pruneLiveResources()
{
if (!m_pruneEnabled)
return;
......@@ -322,7 +322,7 @@ void Cache::pruneLiveResources()
}
}
void Cache::pruneDeadResources()
void MemoryCache::pruneDeadResources()
{
if (!m_pruneEnabled)
return;
......@@ -406,7 +406,7 @@ void Cache::pruneDeadResources()
m_inPruneDeadResources = false;
}
void Cache::setCapacities(unsigned minDeadBytes, unsigned maxDeadBytes, unsigned totalBytes)
void MemoryCache::setCapacities(unsigned minDeadBytes, unsigned maxDeadBytes, unsigned totalBytes)
{
ASSERT(minDeadBytes <= maxDeadBytes);
ASSERT(maxDeadBytes <= totalBytes);
......@@ -416,9 +416,9 @@ void Cache::setCapacities(unsigned minDeadBytes, unsigned maxDeadBytes, unsigned
prune();
}
bool Cache::makeResourcePurgeable(CachedResource* resource)