diff options
Diffstat (limited to 'WebCore/loader/cache/MemoryCache.cpp')
-rw-r--r-- | WebCore/loader/cache/MemoryCache.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/WebCore/loader/cache/MemoryCache.cpp b/WebCore/loader/cache/MemoryCache.cpp index ae8e53a..79dfc03 100644 --- a/WebCore/loader/cache/MemoryCache.cpp +++ b/WebCore/loader/cache/MemoryCache.cpp @@ -39,7 +39,6 @@ #include "SecurityOrigin.h" #include <stdio.h> #include <wtf/CurrentTime.h> -#include <wtf/text/CString.h> using namespace std; @@ -127,13 +126,7 @@ CachedResource* MemoryCache::requestResource(CachedResourceLoader* cachedResourc FrameLoader::reportLocalLoadFailed(cachedResourceLoader->document()->frame(), url.string()); return 0; } - - if (resource && resource->type() != type) { - LOG(ResourceLoading, "Cache::requestResource found a cache resource with matching url but different type, evicting and loading with new type."); - evict(resource); - resource = 0; - } - + if (!resource) { LOG(ResourceLoading, "CachedResource for '%s' wasn't found in cache. Creating it", url.string().latin1().data()); // The resource does not exist. Create it. @@ -164,6 +157,11 @@ CachedResource* MemoryCache::requestResource(CachedResourceLoader* cachedResourc } } + if (resource->type() != type) { + LOG(ResourceLoading, "MemoryCache::requestResource cannot use cached resource for '%s' due to type mismatch", url.string().latin1().data()); + return 0; + } + if (!disabled()) { // This will move the resource to the front of its LRU list and increase its access count. resourceAccessed(resource); |