Changeset 71499 in webkit
- Timestamp:
- Nov 7, 2010 10:46:03 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 53 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/Android.mk
r71496 r71499 388 388 loader/appcache/ManifestParser.cpp \ 389 389 \ 390 loader/cache/ Cache.cpp \390 loader/cache/MemoryCache.cpp \ 391 391 \ 392 392 loader/icon/IconDatabase.cpp \ -
trunk/WebCore/CMakeLists.txt
r71496 r71499 1192 1192 loader/archive/ArchiveResourceCollection.cpp 1193 1193 1194 loader/cache/ Cache.cpp1194 loader/cache/MemoryCache.cpp 1195 1195 1196 1196 loader/icon/IconDatabase.cpp -
trunk/WebCore/ChangeLog
r71497 r71499 1 2010-11-07 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Rename Cache to MemoryCache 6 https://bugs.webkit.org/show_bug.cgi?id=49159 7 8 So sayeth the diagram. 9 10 * Android.mk: 11 * CMakeLists.txt: 12 * GNUmakefile.am: 13 * WebCore.gypi: 14 * WebCore.pro: 15 * WebCore.vcproj/WebCore.vcproj: 16 * WebCore.xcodeproj/project.pbxproj: 17 * css/CSSImageValue.cpp: 18 * dom/ContainerNode.cpp: 19 * history/PageCache.cpp: 20 * inspector/InspectorCSSStore.h: 21 * inspector/InspectorResourceAgent.cpp: 22 * loader/FrameLoader.cpp: 23 * loader/archive/cf/LegacyWebArchive.cpp: 24 * loader/cache/Cache.cpp: Removed. 25 * loader/cache/Cache.h: Removed. 26 * loader/cache/CachedCSSStyleSheet.cpp: 27 (WebCore::CachedCSSStyleSheet::allClientsRemoved): 28 * loader/cache/CachedFont.cpp: 29 * loader/cache/CachedFont.h: 30 * loader/cache/CachedImage.cpp: 31 (WebCore::CachedImage::destroyDecodedData): 32 * loader/cache/CachedImage.h: 33 * loader/cache/CachedResource.cpp: 34 * loader/cache/CachedResource.h: 35 * loader/cache/CachedResourceLoader.cpp: 36 * loader/cache/CachedResourceLoader.h: 37 * loader/cache/CachedScript.cpp: 38 (WebCore::CachedScript::destroyDecodedData): 39 * loader/cache/MemoryCache.cpp: Copied from WebCore/loader/cache/Cache.cpp. 40 (WebCore::cache): 41 (WebCore::MemoryCache::MemoryCache): 42 (WebCore::MemoryCache::requestResource): 43 (WebCore::MemoryCache::requestUserCSSStyleSheet): 44 (WebCore::MemoryCache::revalidateResource): 45 (WebCore::MemoryCache::revalidationSucceeded): 46 (WebCore::MemoryCache::revalidationFailed): 47 (WebCore::MemoryCache::resourceForURL): 48 (WebCore::MemoryCache::deadCapacity): 49 (WebCore::MemoryCache::liveCapacity): 50 (WebCore::MemoryCache::pruneLiveResources): 51 (WebCore::MemoryCache::pruneDeadResources): 52 (WebCore::MemoryCache::setCapacities): 53 (WebCore::MemoryCache::makeResourcePurgeable): 54 (WebCore::MemoryCache::evict): 55 (WebCore::MemoryCache::addCachedResourceLoader): 56 (WebCore::MemoryCache::removeCachedResourceLoader): 57 (WebCore::MemoryCache::lruListFor): 58 (WebCore::MemoryCache::removeFromLRUList): 59 (WebCore::MemoryCache::insertInLRUList): 60 (WebCore::MemoryCache::resourceAccessed): 61 (WebCore::MemoryCache::removeFromLiveDecodedResourcesList): 62 (WebCore::MemoryCache::insertInLiveDecodedResourcesList): 63 (WebCore::MemoryCache::addToLiveResourcesSize): 64 (WebCore::MemoryCache::removeFromLiveResourcesSize): 65 (WebCore::MemoryCache::adjustSize): 66 (WebCore::MemoryCache::TypeStatistic::addResource): 67 (WebCore::MemoryCache::getStatistics): 68 (WebCore::MemoryCache::setDisabled): 69 (WebCore::MemoryCache::dumpStats): 70 (WebCore::MemoryCache::dumpLRULists): 71 * loader/cache/MemoryCache.h: Copied from WebCore/loader/cache/Cache.h. 72 (WebCore::MemoryCache::shouldMakeResourcePurgeableOnEviction): 73 * loader/loader.cpp: 74 * page/EventSource.cpp: 75 * page/Settings.h: 76 * xml/XMLHttpRequest.cpp: 77 (WebCore::XMLHttpRequest::createRequest): 78 1 79 2010-11-07 Eric Seidel <eric@webkit.org> 2 80 -
trunk/WebCore/GNUmakefile.am
r71496 r71499 1907 1907 WebCore/loader/archive/ArchiveResource.cpp \ 1908 1908 WebCore/loader/archive/ArchiveResource.h \ 1909 WebCore/loader/cache/ Cache.cpp \1909 WebCore/loader/cache/MemoryCache.cpp \ 1910 1910 WebCore/loader/cache/CachedCSSStyleSheet.cpp \ 1911 1911 WebCore/loader/cache/CachedCSSStyleSheet.h \ … … 1927 1927 WebCore/loader/cache/CachedXSLStyleSheet.cpp \ 1928 1928 WebCore/loader/cache/CachedXSLStyleSheet.h \ 1929 WebCore/loader/cache/ Cache.h \1929 WebCore/loader/cache/MemoryCache.h \ 1930 1930 WebCore/loader/cache/CachePolicy.h \ 1931 1931 WebCore/loader/CachedMetadata.h \ -
trunk/WebCore/WebCore.exp.in
r71451 r71499 201 201 __ZN7WebCore11HistoryItemC1Ev 202 202 __ZN7WebCore11HistoryItemD1Ev 203 __ZN7WebCore11MemoryCache13getStatisticsEv 204 __ZN7WebCore11MemoryCache11setDisabledEb 205 __ZN7WebCore11MemoryCache13setCapacitiesEjjj 203 206 __ZN7WebCore11RenderLayer19scrollRectToVisibleERKNS_7IntRectEbRKNS_15ScrollAlignmentES6_ 204 207 __ZN7WebCore11globalPointERK8_NSPointP8NSWindow … … 630 633 __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_5RangeE 631 634 __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_8NodeListE 632 __ZN7WebCore5Cache11setDisabledEb633 __ZN7WebCore5Cache13getStatisticsEv634 __ZN7WebCore5Cache13setCapacitiesEjjj635 635 __ZN7WebCore5Frame10createViewERKNS_7IntSizeERKNS_5ColorEbS3_bNS_13ScrollbarModeEbS7_b 636 636 __ZN7WebCore5Frame14frameForWidgetEPKNS_6WidgetE -
trunk/WebCore/WebCore.gypi
r71496 r71499 2012 2012 'loader/archive/ArchiveResourceCollection.cpp', 2013 2013 'loader/archive/ArchiveResourceCollection.h', 2014 'loader/cache/ Cache.cpp',2015 'loader/cache/ Cache.h',2014 'loader/cache/MemoryCache.cpp', 2015 'loader/cache/MemoryCache.h', 2016 2016 'loader/cache/CachedCSSStyleSheet.cpp', 2017 2017 'loader/cache/CachedCSSStyleSheet.h', -
trunk/WebCore/WebCore.pro
r71496 r71499 1033 1033 loader/archive/ArchiveResource.cpp \ 1034 1034 loader/archive/ArchiveResourceCollection.cpp \ 1035 loader/cache/ Cache.cpp \1035 loader/cache/MemoryCache.cpp \ 1036 1036 loader/cache/CachedCSSStyleSheet.cpp \ 1037 1037 loader/cache/CachedFont.cpp \ … … 1932 1932 loader/cache/CachedScript.h \ 1933 1933 loader/cache/CachedXSLStyleSheet.h \ 1934 loader/cache/ Cache.h \1934 loader/cache/MemoryCache.h \ 1935 1935 loader/CrossOriginAccessControl.h \ 1936 1936 loader/CrossOriginPreflightResultCache.h \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r71496 r71499 24164 24164 > 24165 24165 <File 24166 RelativePath="..\loader\cache\ Cache.cpp"24167 > 24168 </File> 24169 <File 24170 RelativePath="..\loader\cache\ Cache.h"24166 RelativePath="..\loader\cache\MemoryCache.cpp" 24167 > 24168 </File> 24169 <File 24170 RelativePath="..\loader\cache\MemoryCache.h" 24171 24171 > 24172 24172 </File> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r71496 r71499 5035 5035 BCACF3BD1072921A00C0C8A3 /* UserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = BCACF3BB1072921A00C0C8A3 /* UserContentURLPattern.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5036 5036 BCAEFCAE1016CE4A0040D34E /* DOMRGBColor.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCAEFCAD1016CE4A0040D34E /* DOMRGBColor.mm */; }; 5037 BCB16C170979C3BD00467741 /* Cache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16BFE0979C3BD00467741 /*Cache.cpp */; };5038 BCB16C180979C3BD00467741 /* Cache.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16BFF0979C3BD00467741 /*Cache.h */; settings = {ATTRIBUTES = (Private, ); }; };5037 BCB16C170979C3BD00467741 /* MemoryCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16BFE0979C3BD00467741 /* MemoryCache.cpp */; }; 5038 BCB16C180979C3BD00467741 /* MemoryCache.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16BFF0979C3BD00467741 /* MemoryCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5039 5039 BCB16C190979C3BD00467741 /* CachedCSSStyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16C000979C3BD00467741 /* CachedCSSStyleSheet.cpp */; }; 5040 5040 BCB16C1A0979C3BD00467741 /* CachedCSSStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16C010979C3BD00467741 /* CachedCSSStyleSheet.h */; }; … … 11070 11070 BCACF3BB1072921A00C0C8A3 /* UserContentURLPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserContentURLPattern.h; sourceTree = "<group>"; }; 11071 11071 BCAEFCAD1016CE4A0040D34E /* DOMRGBColor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMRGBColor.mm; sourceTree = "<group>"; }; 11072 BCB16BFE0979C3BD00467741 /* Cache.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path =Cache.cpp; sourceTree = "<group>"; };11073 BCB16BFF0979C3BD00467741 /* Cache.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path =Cache.h; sourceTree = "<group>"; };11072 BCB16BFE0979C3BD00467741 /* MemoryCache.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryCache.cpp; sourceTree = "<group>"; }; 11073 BCB16BFF0979C3BD00467741 /* MemoryCache.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MemoryCache.h; sourceTree = "<group>"; }; 11074 11074 BCB16C000979C3BD00467741 /* CachedCSSStyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CachedCSSStyleSheet.cpp; sourceTree = "<group>"; }; 11075 11075 BCB16C010979C3BD00467741 /* CachedCSSStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CachedCSSStyleSheet.h; sourceTree = "<group>"; }; … … 16044 16044 BCB16C0F0979C3BD00467741 /* CachedXSLStyleSheet.h */, 16045 16045 F587864902DE3A9A01EA4122 /* CachePolicy.h */, 16046 BCB16BFE0979C3BD00467741 /* Cache.cpp */,16047 BCB16BFF0979C3BD00467741 /* Cache.h */,16046 BCB16BFE0979C3BD00467741 /* MemoryCache.cpp */, 16047 BCB16BFF0979C3BD00467741 /* MemoryCache.h */, 16048 16048 ); 16049 16049 path = cache; … … 18565 18565 1A569CFC0D7E2B82007C3983 /* c_runtime.h in Headers */, 18566 18566 1A569CFE0D7E2B82007C3983 /* c_utility.h in Headers */, 18567 BCB16C180979C3BD00467741 /* Cache.h in Headers */,18567 BCB16C180979C3BD00467741 /* MemoryCache.h in Headers */, 18568 18568 BCB16C1A0979C3BD00467741 /* CachedCSSStyleSheet.h in Headers */, 18569 18569 BC64B4CC0CB4295D005F2B62 /* CachedFont.h in Headers */, … … 21715 21715 1A569CFB0D7E2B82007C3983 /* c_runtime.cpp in Sources */, 21716 21716 1A569CFD0D7E2B82007C3983 /* c_utility.cpp in Sources */, 21717 BCB16C170979C3BD00467741 /* Cache.cpp in Sources */,21717 BCB16C170979C3BD00467741 /* MemoryCache.cpp in Sources */, 21718 21718 BCB16C190979C3BD00467741 /* CachedCSSStyleSheet.cpp in Sources */, 21719 21719 BC64B4CB0CB4295D005F2B62 /* CachedFont.cpp in Sources */, -
trunk/WebCore/css/CSSImageValue.cpp
r66963 r71499 23 23 24 24 #include "CSSValueKeywords.h" 25 #include " Cache.h"25 #include "MemoryCache.h" 26 26 #include "CachedImage.h" 27 27 #include "CachedResourceLoader.h" -
trunk/WebCore/dom/ContainerNode.cpp
r71278 r71499 25 25 26 26 #include "BeforeLoadEvent.h" 27 #include " Cache.h"27 #include "MemoryCache.h" 28 28 #include "ContainerNodeAlgorithms.h" 29 29 #include "DeleteButtonController.h" -
trunk/WebCore/history/PageCache.cpp
r70960 r71499 29 29 #include "ApplicationCacheHost.h" 30 30 #include "BackForwardController.h" 31 #include " Cache.h"31 #include "MemoryCache.h" 32 32 #include "CachedPage.h" 33 33 #include "DOMWindow.h" -
trunk/WebCore/inspector/InspectorCSSStore.h
r69196 r71499 31 31 32 32 #include "CSSPropertySourceData.h" 33 #include " Cache.h"33 #include "MemoryCache.h" 34 34 35 35 #include <wtf/Forward.h> -
trunk/WebCore/inspector/InspectorResourceAgent.cpp
r71215 r71499 33 33 34 34 #include "Base64.h" 35 #include " Cache.h"35 #include "MemoryCache.h" 36 36 #include "CachedResource.h" 37 37 #include "CachedResourceLoader.h" -
trunk/WebCore/loader/FrameLoader.cpp
r71256 r71499 39 39 #include "BackForwardController.h" 40 40 #include "BeforeUnloadEvent.h" 41 #include " Cache.h"41 #include "MemoryCache.h" 42 42 #include "CachedPage.h" 43 43 #include "CachedResourceLoader.h" -
trunk/WebCore/loader/archive/cf/LegacyWebArchive.cpp
r71216 r71499 30 30 #include "LegacyWebArchive.h" 31 31 32 #include " Cache.h"32 #include "MemoryCache.h" 33 33 #include "Document.h" 34 34 #include "DocumentLoader.h" -
trunk/WebCore/loader/cache/CachedCSSStyleSheet.cpp
r71496 r71499 28 28 #include "CachedCSSStyleSheet.h" 29 29 30 #include " Cache.h"30 #include "MemoryCache.h" 31 31 #include "CachedResourceClient.h" 32 32 #include "CachedResourceClientWalker.h" … … 60 60 void CachedCSSStyleSheet::allClientsRemoved() 61 61 { 62 if (! Cache::shouldMakeResourcePurgeableOnEviction() && isSafeToMakePurgeable())62 if (!MemoryCache::shouldMakeResourcePurgeableOnEviction() && isSafeToMakePurgeable()) 63 63 makePurgeable(true); 64 64 } -
trunk/WebCore/loader/cache/CachedFont.cpp
r71496 r71499 32 32 #endif 33 33 34 #include " Cache.h"34 #include "MemoryCache.h" 35 35 #include "CachedResourceClient.h" 36 36 #include "CachedResourceClientWalker.h" -
trunk/WebCore/loader/cache/CachedFont.h
r71496 r71499 40 40 41 41 class CachedResourceLoader; 42 class Cache;42 class MemoryCache; 43 43 class FontPlatformData; 44 44 class SVGFontElement; … … 82 82 #endif 83 83 84 friend class Cache;84 friend class MemoryCache; 85 85 }; 86 86 -
trunk/WebCore/loader/cache/CachedImage.cpp
r71496 r71499 26 26 27 27 #include "BitmapImage.h" 28 #include " Cache.h"28 #include "MemoryCache.h" 29 29 #include "CachedResourceClient.h" 30 30 #include "CachedResourceClientWalker.h" … … 332 332 m_image = 0; 333 333 setDecodedSize(0); 334 if (! Cache::shouldMakeResourcePurgeableOnEviction())334 if (!MemoryCache::shouldMakeResourcePurgeableOnEviction()) 335 335 makePurgeable(true); 336 336 } else if (m_image && !errorOccurred()) -
trunk/WebCore/loader/cache/CachedImage.h
r71496 r71499 33 33 34 34 class CachedResourceLoader; 35 class Cache;35 class MemoryCache; 36 36 37 37 class CachedImage : public CachedResource, public ImageObserver { 38 friend class Cache;38 friend class MemoryCache; 39 39 40 40 public: -
trunk/WebCore/loader/cache/CachedResource.cpp
r71496 r71499 25 25 #include "CachedResource.h" 26 26 27 #include " Cache.h"27 #include "MemoryCache.h" 28 28 #include "CachedMetadata.h" 29 29 #include "CachedResourceClient.h" -
trunk/WebCore/loader/cache/CachedResource.h
r71496 r71499 37 37 namespace WebCore { 38 38 39 class Cache;39 class MemoryCache; 40 40 class CachedMetadata; 41 41 class CachedResourceClient; … … 51 51 // This class also does the actual communication with the loader to obtain the resource from the network. 52 52 class CachedResource : public Noncopyable { 53 friend class Cache;53 friend class MemoryCache; 54 54 friend class InspectorResource; 55 55 … … 226 226 void addClientToSet(CachedResourceClient*); 227 227 228 // These are called by the friendly Cache only228 // These are called by the friendly MemoryCache only 229 229 void setResourceToRevalidate(CachedResource*); 230 230 void switchClientsToRevalidatedResource(); -
trunk/WebCore/loader/cache/CachedResourceLoader.cpp
r71496 r71499 28 28 #include "CachedResourceLoader.h" 29 29 30 #include "loader.h"31 #include "Cache.h"32 30 #include "CachedCSSStyleSheet.h" 33 31 #include "CachedFont.h" … … 36 34 #include "CachedXSLStyleSheet.h" 37 35 #include "Console.h" 36 #include "DOMWindow.h" 38 37 #include "Document.h" 39 #include "DOMWindow.h"40 #include "HTMLElement.h"41 38 #include "Frame.h" 42 39 #include "FrameLoader.h" 43 40 #include "FrameLoaderClient.h" 41 #include "HTMLElement.h" 42 #include "MemoryCache.h" 44 43 #include "PingLoader.h" 45 44 #include "SecurityOrigin.h" 46 45 #include "Settings.h" 46 #include "loader.h" 47 47 #include <wtf/text/StringConcatenate.h> 48 48 -
trunk/WebCore/loader/cache/CachedResourceLoader.h
r71496 r71499 49 49 // The CachedResourceLoader manages the loading of scripts/images/stylesheets for a single document. 50 50 class CachedResourceLoader : public Noncopyable { 51 friend class Cache;51 friend class MemoryCache; 52 52 friend class ImageLoader; 53 53 … … 110 110 bool canRequest(CachedResource::Type, const KURL&); 111 111 112 Cache* m_cache;112 MemoryCache* m_cache; 113 113 HashSet<String> m_reloadedURLs; 114 114 mutable DocumentResourceMap m_documentResources; -
trunk/WebCore/loader/cache/CachedScript.cpp
r71496 r71499 28 28 #include "CachedScript.h" 29 29 30 #include " Cache.h"30 #include "MemoryCache.h" 31 31 #include "CachedResourceClient.h" 32 32 #include "CachedResourceClientWalker.h" … … 112 112 m_script = String(); 113 113 setDecodedSize(0); 114 if (! Cache::shouldMakeResourcePurgeableOnEviction() && isSafeToMakePurgeable())114 if (!MemoryCache::shouldMakeResourcePurgeableOnEviction() && isSafeToMakePurgeable()) 115 115 makePurgeable(true); 116 116 } -
trunk/WebCore/loader/cache/MemoryCache.cpp
r71496 r71499 22 22 23 23 #include "config.h" 24 #include " Cache.h"24 #include "MemoryCache.h" 25 25 26 26 #include "CachedCSSStyleSheet.h" … … 50 50 static const double cDefaultDecodedDataDeletionInterval = 0; 51 51 52 Cache* cache()53 { 54 static Cache* staticCache = newCache;52 MemoryCache* cache() 53 { 54 static MemoryCache* staticCache = new MemoryCache; 55 55 return staticCache; 56 56 } 57 57 58 Cache::Cache()58 MemoryCache::MemoryCache() 59 59 : m_disabled(false) 60 60 , m_pruneEnabled(true) … … 95 95 } 96 96 97 CachedResource* Cache::requestResource(CachedResourceLoader* cachedResourceLoader, CachedResource::Type type, const KURL& url, const String& charset, bool requestIsPreload)98 { 99 LOG(ResourceLoading, " Cache::requestResource '%s', charset '%s', preload=%u", url.string().latin1().data(), charset.latin1().data(), requestIsPreload);97 CachedResource* MemoryCache::requestResource(CachedResourceLoader* cachedResourceLoader, CachedResource::Type type, const KURL& url, const String& charset, bool requestIsPreload) 98 { 99 LOG(ResourceLoading, "MemoryCache::requestResource '%s', charset '%s', preload=%u", url.string().latin1().data(), charset.latin1().data(), requestIsPreload); 100 100 101 101 // FIXME: Do we really need to special-case an empty URL? … … 108 108 109 109 if (resource && requestIsPreload && !resource->isPreloaded()) { 110 LOG(ResourceLoading, " Cache::requestResource already has a preload request for this request, and it hasn't been preloaded yet");110 LOG(ResourceLoading, "MemoryCache::requestResource already has a preload request for this request, and it hasn't been preloaded yet"); 111 111 return 0; 112 112 } … … 150 150 151 151 if (resource->type() != type) { 152 LOG(ResourceLoading, " Cache::requestResource cannot use cached resource for '%s' due to type mismatch", url.string().latin1().data());152 LOG(ResourceLoading, "MemoryCache::requestResource cannot use cached resource for '%s' due to type mismatch", url.string().latin1().data()); 153 153 return 0; 154 154 } … … 159 159 } 160 160 161 LOG(ResourceLoading, " Cache::requestResource for '%s' returning resource %p\n", url.string().latin1().data(), resource);161 LOG(ResourceLoading, "MemoryCache::requestResource for '%s' returning resource %p\n", url.string().latin1().data(), resource); 162 162 163 163 return resource; 164 164 } 165 165 166 CachedCSSStyleSheet* Cache::requestUserCSSStyleSheet(CachedResourceLoader* cachedResourceLoader, const String& url, const String& charset)166 CachedCSSStyleSheet* MemoryCache::requestUserCSSStyleSheet(CachedResourceLoader* cachedResourceLoader, const String& url, const String& charset) 167 167 { 168 168 CachedCSSStyleSheet* userSheet; … … 193 193 } 194 194 195 void Cache::revalidateResource(CachedResource* resource, CachedResourceLoader* cachedResourceLoader)195 void MemoryCache::revalidateResource(CachedResource* resource, CachedResourceLoader* cachedResourceLoader) 196 196 { 197 197 ASSERT(resource); … … 216 216 } 217 217 218 void Cache::revalidationSucceeded(CachedResource* revalidatingResource, const ResourceResponse& response)218 void MemoryCache::revalidationSucceeded(CachedResource* revalidatingResource, const ResourceResponse& response) 219 219 { 220 220 CachedResource* resource = revalidatingResource->resourceToRevalidate(); … … 242 242 } 243 243 244 void Cache::revalidationFailed(CachedResource* revalidatingResource)244 void MemoryCache::revalidationFailed(CachedResource* revalidatingResource) 245 245 { 246 246 LOG(ResourceLoading, "Revalidation failed for %p", revalidatingResource); … … 249 249 } 250 250 251 CachedResource* Cache::resourceForURL(const String& url)251 CachedResource* MemoryCache::resourceForURL(const String& url) 252 252 { 253 253 CachedResource* resource = m_resources.get(url); 254 bool wasPurgeable = Cache::shouldMakeResourcePurgeableOnEviction() && resource && resource->isPurgeable();254 bool wasPurgeable = MemoryCache::shouldMakeResourcePurgeableOnEviction() && resource && resource->isPurgeable(); 255 255 if (resource && !resource->makePurgeable(false)) { 256 256 ASSERT(!resource->hasClients()); … … 264 264 } 265 265 266 unsigned Cache::deadCapacity() const266 unsigned MemoryCache::deadCapacity() const 267 267 { 268 268 // Dead resource capacity is whatever space is not occupied by live resources, bounded by an independent minimum and maximum. … … 273 273 } 274 274 275 unsigned Cache::liveCapacity() const275 unsigned MemoryCache::liveCapacity() const 276 276 { 277 277 // Live resource capacity is whatever is left over after calculating dead resource capacity. … … 279 279 } 280 280 281 void Cache::pruneLiveResources()281 void MemoryCache::pruneLiveResources() 282 282 { 283 283 if (!m_pruneEnabled) … … 323 323 } 324 324 325 void Cache::pruneDeadResources()325 void MemoryCache::pruneDeadResources() 326 326 { 327 327 if (!m_pruneEnabled) … … 407 407 } 408 408 409 void Cache::setCapacities(unsigned minDeadBytes, unsigned maxDeadBytes, unsigned totalBytes)409 void MemoryCache::setCapacities(unsigned minDeadBytes, unsigned maxDeadBytes, unsigned totalBytes) 410 410 { 411 411 ASSERT(minDeadBytes <= maxDeadBytes); … … 417 417 } 418 418 419 bool Cache::makeResourcePurgeable(CachedResource* resource)420 { 421 if (! Cache::shouldMakeResourcePurgeableOnEviction())419 bool MemoryCache::makeResourcePurgeable(CachedResource* resource) 420 { 421 if (!MemoryCache::shouldMakeResourcePurgeableOnEviction()) 422 422 return false; 423 423 … … 439 439 } 440 440 441 void Cache::evict(CachedResource* resource)441 void MemoryCache::evict(CachedResource* resource) 442 442 { 443 443 LOG(ResourceLoading, "Evicting resource %p for '%s' from cache", resource, resource->url().latin1().data()); … … 456 456 // resource purgeable in makeResourcePurgeable(). So adjust the size if we are evicting a 457 457 // resource that was not marked as purgeable. 458 if (! Cache::shouldMakeResourcePurgeableOnEviction() || !resource->isPurgeable())458 if (!MemoryCache::shouldMakeResourcePurgeableOnEviction() || !resource->isPurgeable()) 459 459 adjustSize(resource->hasClients(), -static_cast<int>(resource->size())); 460 460 } else … … 465 465 } 466 466 467 void Cache::addCachedResourceLoader(CachedResourceLoader* cachedResourceLoader)467 void MemoryCache::addCachedResourceLoader(CachedResourceLoader* cachedResourceLoader) 468 468 { 469 469 m_cachedResourceLoaders.add(cachedResourceLoader); 470 470 } 471 471 472 void Cache::removeCachedResourceLoader(CachedResourceLoader* cachedResourceLoader)472 void MemoryCache::removeCachedResourceLoader(CachedResourceLoader* cachedResourceLoader) 473 473 { 474 474 m_cachedResourceLoaders.remove(cachedResourceLoader); … … 493 493 } 494 494 495 Cache::LRUList*Cache::lruListFor(CachedResource* resource)495 MemoryCache::LRUList* MemoryCache::lruListFor(CachedResource* resource) 496 496 { 497 497 unsigned accessCount = max(resource->accessCount(), 1U); … … 505 505 } 506 506 507 void Cache::removeFromLRUList(CachedResource* resource)507 void MemoryCache::removeFromLRUList(CachedResource* resource) 508 508 { 509 509 // If we've never been accessed, then we're brand new and not in any list. … … 552 552 } 553 553 554 void Cache::insertInLRUList(CachedResource* resource)554 void MemoryCache::insertInLRUList(CachedResource* resource) 555 555 { 556 556 // Make sure we aren't in some list already. … … 584 584 } 585 585 586 void Cache::resourceAccessed(CachedResource* resource)586 void MemoryCache::resourceAccessed(CachedResource* resource) 587 587 { 588 588 ASSERT(resource->inCache()); … … 603 603 } 604 604 605 void Cache::removeFromLiveDecodedResourcesList(CachedResource* resource)605 void MemoryCache::removeFromLiveDecodedResourcesList(CachedResource* resource) 606 606 { 607 607 // If we've never been accessed, then we're brand new and not in any list. … … 642 642 } 643 643 644 void Cache::insertInLiveDecodedResourcesList(CachedResource* resource)644 void MemoryCache::insertInLiveDecodedResourcesList(CachedResource* resource) 645 645 { 646 646 // Make sure we aren't in the list already. … … 670 670 } 671 671 672 void Cache::addToLiveResourcesSize(CachedResource* resource)672 void MemoryCache::addToLiveResourcesSize(CachedResource* resource) 673 673 { 674 674 m_liveSize += resource->size(); … … 676 676 } 677 677 678 void Cache::removeFromLiveResourcesSize(CachedResource* resource)678 void MemoryCache::removeFromLiveResourcesSize(CachedResource* resource) 679 679 { 680 680 m_liveSize -= resource->size(); … … 682 682 } 683 683 684 void Cache::adjustSize(bool live, int delta)684 void MemoryCache::adjustSize(bool live, int delta) 685 685 { 686 686 if (live) { … … 693 693 } 694 694 695 void Cache::TypeStatistic::addResource(CachedResource* o)695 void MemoryCache::TypeStatistic::addResource(CachedResource* o) 696 696 { 697 697 bool purged = o->wasPurged(); … … 706 706 } 707 707 708 Cache::StatisticsCache::getStatistics()708 MemoryCache::Statistics MemoryCache::getStatistics() 709 709 { 710 710 Statistics stats; … … 737 737 } 738 738 739 void Cache::setDisabled(bool disabled)739 void MemoryCache::setDisabled(bool disabled) 740 740 { 741 741 m_disabled = disabled; … … 752 752 753 753 #ifndef NDEBUG 754 void Cache::dumpStats()754 void MemoryCache::dumpStats() 755 755 { 756 756 Statistics s = getStatistics(); … … 767 767 } 768 768 769 void Cache::dumpLRULists(bool includeLive) const769 void MemoryCache::dumpLRULists(bool includeLive) const 770 770 { 771 771 printf("LRU-SP lists in eviction order (Kilobytes decoded, Kilobytes encoded, Access count, Referenced, isPurgeable, wasPurged):\n"); -
trunk/WebCore/loader/cache/MemoryCache.h
r71496 r71499 72 72 // more memory use due to this. 73 73 74 class Cache : public Noncopyable {74 class MemoryCache : public Noncopyable { 75 75 public: 76 friend Cache* cache();76 friend MemoryCache* cache(); 77 77 78 78 typedef HashMap<String, CachedResource*> CachedResourceMap; … … 171 171 172 172 private: 173 Cache();174 ~ Cache(); // Not implemented to make sure nobody accidentally calls delete -- WebCore does not delete singletons.173 MemoryCache(); 174 ~MemoryCache(); // Not implemented to make sure nobody accidentally calls delete -- WebCore does not delete singletons. 175 175 176 176 LRUList* lruListFor(CachedResource*); … … 219 219 }; 220 220 221 inline bool Cache::shouldMakeResourcePurgeableOnEviction()221 inline bool MemoryCache::shouldMakeResourcePurgeableOnEviction() 222 222 { 223 223 #if PLATFORM(IOS) … … 229 229 230 230 // Function to obtain the global cache. 231 Cache* cache();231 MemoryCache* cache(); 232 232 233 233 } -
trunk/WebCore/loader/loader.cpp
r71494 r71499 25 25 #include "loader.h" 26 26 27 #include " Cache.h"27 #include "MemoryCache.h" 28 28 #include "CachedImage.h" 29 29 #include "CachedResource.h" -
trunk/WebCore/page/EventSource.cpp
r62696 r71499 37 37 #include "EventSource.h" 38 38 39 #include " Cache.h"39 #include "MemoryCache.h" 40 40 #include "DOMWindow.h" 41 41 #include "Event.h" -
trunk/WebCore/page/Settings.h
r71239 r71499 144 144 // - Icon Database 145 145 // - Console Messages 146 // - Cache146 // - MemoryCache 147 147 // - Application Cache 148 148 // - Back/Forward Page History -
trunk/WebCore/xml/XMLHttpRequest.cpp
r69688 r71499 24 24 25 25 #include "Blob.h" 26 #include " Cache.h"26 #include "MemoryCache.h" 27 27 #include "CrossOriginAccessControl.h" 28 28 #include "DOMFormData.h" … … 601 601 602 602 // For now we should only balance the nonCached request count for main-thread XHRs and not 603 // Worker XHRs, as the Cache is not thread-safe.603 // Worker XHRs, as the MemoryCache is not thread-safe. 604 604 // This will become irrelevant after https://bugs.webkit.org/show_bug.cgi?id=27165 is resolved. 605 605 if (!scriptExecutionContext()->isWorkerContext()) { -
trunk/WebKit/chromium/ChangeLog
r71480 r71499 1 2010-11-07 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Rename Cache to MemoryCache 6 https://bugs.webkit.org/show_bug.cgi?id=49159 7 8 * public/WebCache.h: 9 * src/WebCache.cpp: 10 (WebKit::ToResourceTypeStat): 11 (WebKit::WebCache::setCapacities): 12 (WebKit::WebCache::clear): 13 (WebKit::WebCache::getUsageStats): 14 (WebKit::WebCache::getResourceTypeStats): 15 1 16 2010-11-07 Jay Civelli <jcivelli@chromium.org> 2 17 -
trunk/WebKit/chromium/public/WebCache.h
r50668 r71499 49 49 }; 50 50 51 // A struct mirroring WebCore:: Cache::TypeStatistic.51 // A struct mirroring WebCore::MemoryCache::TypeStatistic. 52 52 struct ResourceTypeStat { 53 53 size_t count; … … 57 57 }; 58 58 59 // A struct mirroring WebCore:: Cache::Statistics.59 // A struct mirroring WebCore::MemoryCache::Statistics. 60 60 struct ResourceTypeStats { 61 61 ResourceTypeStat images; -
trunk/WebKit/chromium/src/WebCache.cpp
r69084 r71499 32 32 #include "WebCache.h" 33 33 34 // Instead of providing accessors, we make all members of Cache public.35 // This will make it easier to track WebCore changes to the Cache class.36 // FIXME: We should introduce public getters on the Cache class.34 // Instead of providing accessors, we make all members of MemoryCache public. 35 // This will make it easier to track WebCore changes to the MemoryCache class. 36 // FIXME: We should introduce public getters on the MemoryCache class. 37 37 #define private public 38 #include " Cache.h"38 #include "MemoryCache.h" 39 39 #undef private 40 40 … … 43 43 namespace WebKit { 44 44 45 // A helper method for coverting a Cache::TypeStatistic to a45 // A helper method for coverting a MemoryCache::TypeStatistic to a 46 46 // WebCache::ResourceTypeStat. 47 static void ToResourceTypeStat(const Cache::TypeStatistic& from,47 static void ToResourceTypeStat(const MemoryCache::TypeStatistic& from, 48 48 WebCache::ResourceTypeStat& to) 49 49 { … … 57 57 size_t minDeadCapacity, size_t maxDeadCapacity, size_t capacity) 58 58 { 59 Cache* cache = WebCore::cache();59 MemoryCache* cache = WebCore::cache(); 60 60 if (cache) 61 61 cache->setCapacities(static_cast<unsigned int>(minDeadCapacity), … … 66 66 void WebCache::clear() 67 67 { 68 Cache* cache = WebCore::cache();68 MemoryCache* cache = WebCore::cache(); 69 69 if (cache && !cache->disabled()) { 70 70 cache->setDisabled(true); … … 77 77 ASSERT(result); 78 78 79 Cache* cache = WebCore::cache();79 MemoryCache* cache = WebCore::cache(); 80 80 if (cache) { 81 81 result->minDeadCapacity = cache->m_minDeadCapacity; … … 90 90 void WebCache::getResourceTypeStats(ResourceTypeStats* result) 91 91 { 92 Cache* cache = WebCore::cache();92 MemoryCache* cache = WebCore::cache(); 93 93 if (cache) { 94 Cache::Statistics stats = cache->getStatistics();94 MemoryCache::Statistics stats = cache->getStatistics(); 95 95 ToResourceTypeStat(stats.images, result->images); 96 96 ToResourceTypeStat(stats.cssStyleSheets, result->cssStyleSheets); -
trunk/WebKit/gtk/ChangeLog
r71466 r71499 1 2010-11-07 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Rename Cache to MemoryCache 6 https://bugs.webkit.org/show_bug.cgi?id=49159 7 8 * webkit/webkitwebview.cpp: 9 1 10 2010-11-05 Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> 2 11 -
trunk/WebKit/gtk/webkit/webkitwebview.cpp
r71466 r71499 44 44 #include "AbstractDatabase.h" 45 45 #include "BackForwardListImpl.h" 46 #include " Cache.h"46 #include "MemoryCache.h" 47 47 #include "ChromeClientGtk.h" 48 48 #include "ClipboardUtilitiesGtk.h" -
trunk/WebKit/mac/ChangeLog
r71467 r71499 1 2010-11-07 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Rename Cache to MemoryCache 6 https://bugs.webkit.org/show_bug.cgi?id=49159 7 8 * Misc/WebCache.mm: 9 (+[WebCache statistics]): 10 * WebCoreSupport/WebDeviceOrientationClient.mm: 11 (WebDeviceOrientationClient::setController): 12 * WebView/WebView.mm: 13 1 14 2010-11-05 Alexey Proskuryakov <ap@apple.com> 2 15 -
trunk/WebKit/mac/Misc/WebCache.mm
r62872 r71499 32 32 #import "WebViewInternal.h" 33 33 #import <WebCore/ApplicationCacheStorage.h> 34 #import <WebCore/ Cache.h>34 #import <WebCore/MemoryCache.h> 35 35 #import <WebCore/CrossOriginPreflightResultCache.h> 36 36 … … 44 44 + (NSArray *)statistics 45 45 { 46 WebCore:: Cache::Statistics s = WebCore::cache()->getStatistics();46 WebCore::MemoryCache::Statistics s = WebCore::cache()->getStatistics(); 47 47 48 48 return [NSArray arrayWithObjects: -
trunk/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm
r67949 r71499 42 42 { 43 43 // This is called by the Page constructor before our WebView has the provider set up. 44 // Cache the controller for later use.44 // MemoryCache the controller for later use. 45 45 m_controller = controller; 46 46 } -
trunk/WebKit/mac/WebView/WebView.mm
r71451 r71499 112 112 #import <WebCore/ApplicationCacheStorage.h> 113 113 #import <WebCore/BackForwardListImpl.h> 114 #import <WebCore/ Cache.h>114 #import <WebCore/MemoryCache.h> 115 115 #import <WebCore/ColorMac.h> 116 116 #import <WebCore/CSSComputedStyleDeclaration.h> -
trunk/WebKit/qt/Api/qwebpage.cpp
r71393 r71499 39 39 #include "ApplicationCacheStorage.h" 40 40 #include "BackForwardListImpl.h" 41 #include " Cache.h"41 #include "MemoryCache.h" 42 42 #include "Chrome.h" 43 43 #include "ChromeClientQt.h" -
trunk/WebKit/qt/Api/qwebsettings.cpp
r69856 r71499 26 26 27 27 #include "AbstractDatabase.h" 28 #include " Cache.h"28 #include "MemoryCache.h" 29 29 #include "CrossOriginPreflightResultCache.h" 30 30 #include "FontCache.h" -
trunk/WebKit/qt/ChangeLog
r71479 r71499 1 2010-11-07 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Rename Cache to MemoryCache 6 https://bugs.webkit.org/show_bug.cgi?id=49159 7 8 * Api/qwebpage.cpp: 9 * Api/qwebsettings.cpp: 10 1 11 2010-11-07 Chang Shu <chang.shu@nokia.com> 2 12 -
trunk/WebKit/win/ChangeLog
r71451 r71499 1 2010-11-07 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Rename Cache to MemoryCache 6 https://bugs.webkit.org/show_bug.cgi?id=49159 7 8 * WebCache.cpp: 9 (WebCache::statistics): 10 * WebFrame.cpp: 11 * WebView.cpp: 12 1 13 2010-11-05 Chris Marrin <cmarrin@apple.com> 2 14 -
trunk/WebKit/win/WebCache.cpp
r50567 r71499 32 32 #pragma warning(push, 0) 33 33 #include <WebCore/ApplicationCacheStorage.h> 34 #include <WebCore/ Cache.h>34 #include <WebCore/MemoryCache.h> 35 35 #include <WebCore/CrossOriginPreflightResultCache.h> 36 36 #pragma warning(pop) … … 101 101 return S_OK; 102 102 103 WebCore:: Cache::Statistics stat = WebCore::cache()->getStatistics();103 WebCore::MemoryCache::Statistics stat = WebCore::cache()->getStatistics(); 104 104 105 105 static CFStringRef imagesKey = CFSTR("images"); -
trunk/WebKit/win/WebFrame.cpp
r71451 r71499 56 56 #pragma warning( push, 0 ) 57 57 #include <WebCore/BString.h> 58 #include <WebCore/ Cache.h>58 #include <WebCore/MemoryCache.h> 59 59 #include <WebCore/Document.h> 60 60 #include <WebCore/DocumentLoader.h> -
trunk/WebKit/win/WebView.cpp
r71401 r71499 70 70 #include <WebCore/BackForwardListImpl.h> 71 71 #include <WebCore/BitmapInfo.h> 72 #include <WebCore/ Cache.h>72 #include <WebCore/MemoryCache.h> 73 73 #include <WebCore/Chrome.h> 74 74 #include <WebCore/ContextMenu.h> -
trunk/WebKit/wx/ChangeLog
r71041 r71499 1 2010-11-07 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Rename Cache to MemoryCache 6 https://bugs.webkit.org/show_bug.cgi?id=49159 7 8 * WebView.cpp: 9 (wxWebView::SetCachePolicy): 10 * WebView.h: 11 1 12 2010-11-01 Brady Eidson <beidson@apple.com> 2 13 -
trunk/WebKit/wx/WebView.cpp
r66577 r71499 25 25 26 26 #include "config.h" 27 #include "Cache.h" 27 #include "WebView.h" 28 28 29 #include "ContextMenu.h" 30 #include "ContextMenuController.h" 29 31 #include "ContextMenuItem.h" 30 #include "ContextMenuController.h"31 32 #include "Document.h" 33 #include "Editor.h" 32 34 #include "Element.h" 33 #include "Editor.h"34 35 #include "EmptyClients.h" 35 36 #include "EventHandler.h" … … 42 43 #include "HTMLFormElement.h" 43 44 #include "Logging.h" 44 #include " markup.h"45 #include "MemoryCache.h" 45 46 #include "Page.h" 46 47 #include "PlatformKeyboardEvent.h" … … 57 58 #include "SubstituteData.h" 58 59 #include "Threading.h" 60 #include "markup.h" 59 61 #if __WXMSW__ 60 62 #include "WebCoreInstanceHandle.h" … … 88 90 89 91 #include "WebFrame.h" 90 #include "WebView.h"91 92 #include "WebViewPrivate.h" 92 93 … … 270 271 void wxWebView::SetCachePolicy(const wxWebViewCachePolicy& cachePolicy) 271 272 { 272 WebCore:: Cache* globalCache = WebCore::cache();273 WebCore::MemoryCache* globalCache = WebCore::cache(); 273 274 globalCache->setCapacities(cachePolicy.GetMinDeadCapacity(), 274 275 cachePolicy.GetMaxDeadCapacity(), 275 276 cachePolicy.GetCapacity()); 276 277 277 // store a copy since there is no getter for Cache values278 // store a copy since there is no getter for MemoryCache values 278 279 gs_cachePolicy = cachePolicy; 279 280 } -
trunk/WebKit/wx/WebView.h
r66314 r71499 55 55 #endif 56 56 57 static const int defaultCacheCapacity = 8192 * 1024; // mirrors Cache.cpp57 static const int defaultCacheCapacity = 8192 * 1024; // mirrors MemoryCache.cpp 58 58 59 59 class WXDLLIMPEXP_WEBKIT wxWebViewCachePolicy -
trunk/WebKit2/ChangeLog
r71471 r71499 1 2010-11-07 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Rename Cache to MemoryCache 6 https://bugs.webkit.org/show_bug.cgi?id=49159 7 8 * WebProcess/WebProcess.cpp: 9 * WebProcess/mac/WebProcessMac.mm: 10 * WebProcess/win/WebProcessWin.cpp: 11 1 12 2010-11-06 Balazs Kelemen <kbalazs@webkit.org> 2 13 -
trunk/WebKit2/WebProcess/WebProcess.cpp
r71423 r71499 50 50 51 51 #ifndef NDEBUG 52 #include <WebCore/ Cache.h>52 #include <WebCore/MemoryCache.h> 53 53 #include <WebCore/GCController.h> 54 54 #endif -
trunk/WebKit2/WebProcess/mac/WebProcessMac.mm
r69021 r71499 26 26 #include "WebProcess.h" 27 27 28 #include <WebCore/ Cache.h>28 #include <WebCore/MemoryCache.h> 29 29 #include <WebCore/PageCache.h> 30 30 #include <WebKitSystemInterface.h> -
trunk/WebKit2/WebProcess/win/WebProcessWin.cpp
r70966 r71499 26 26 #include "WebProcess.h" 27 27 28 #include <WebCore/ Cache.h>28 #include <WebCore/MemoryCache.h> 29 29 #include <WebCore/FileSystem.h> 30 30 #include <WebCore/PageCache.h>
Note: See TracChangeset
for help on using the changeset viewer.