diff options
author | Steve Block <steveblock@google.com> | 2009-10-08 17:19:54 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-10-20 00:41:58 +0100 |
commit | 231d4e3152a9c27a73b6ac7badbe6be673aa3ddf (patch) | |
tree | a6c7e2d6cd7bfa7011cc39abbb436142d7a4a7c8 /WebCore/loader/Cache.cpp | |
parent | e196732677050bd463301566a68a643b6d14b907 (diff) | |
download | external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.zip external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.gz external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.bz2 |
Merge webkit.org at R49305 : Automatic merge by git.
Change-Id: I8968561bc1bfd72b8923b7118d3728579c6dbcc7
Diffstat (limited to 'WebCore/loader/Cache.cpp')
-rw-r--r-- | WebCore/loader/Cache.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/WebCore/loader/Cache.cpp b/WebCore/loader/Cache.cpp index 6eeba77..1f28709 100644 --- a/WebCore/loader/Cache.cpp +++ b/WebCore/loader/Cache.cpp @@ -34,6 +34,7 @@ #include "FrameView.h" #include "Image.h" #include "ResourceHandle.h" +#include "SecurityOrigin.h" #include <stdio.h> #include <wtf/CurrentTime.h> @@ -105,7 +106,7 @@ CachedResource* Cache::requestResource(DocLoader* docLoader, CachedResource::Typ if (resource && requestIsPreload && !resource->isPreloaded()) return 0; - if (FrameLoader::restrictAccessToLocal() && !FrameLoader::canLoad(url, String(), docLoader->doc())) { + if (SecurityOrigin::restrictAccessToLocal() && !SecurityOrigin::canLoad(url, String(), docLoader->doc())) { Document* doc = docLoader->doc(); if (doc && !requestIsPreload) FrameLoader::reportLocalLoadFailed(doc->frame(), url.string()); @@ -183,6 +184,7 @@ void Cache::revalidateResource(CachedResource* resource, DocLoader* docLoader) { ASSERT(resource); ASSERT(resource->inCache()); + ASSERT(resource == m_resources.get(resource->url())); ASSERT(!disabled()); if (resource->resourceToRevalidate()) return; @@ -191,7 +193,7 @@ void Cache::revalidateResource(CachedResource* resource, DocLoader* docLoader) return; } const String& url = resource->url(); - CachedResource* newResource = createResource(resource->type(), KURL(url), resource->encoding()); + CachedResource* newResource = createResource(resource->type(), KURL(ParsedURLString, url), resource->encoding()); newResource->setResourceToRevalidate(resource); evict(resource); m_resources.set(url, newResource); @@ -206,6 +208,7 @@ void Cache::revalidationSucceeded(CachedResource* revalidatingResource, const Re ASSERT(resource); ASSERT(!resource->inCache()); ASSERT(resource->isLoaded()); + ASSERT(revalidatingResource->inCache()); evict(revalidatingResource); @@ -352,7 +355,7 @@ void Cache::pruneDeadResources() current = m_allResources[i].m_tail; while (current) { CachedResource* prev = current->m_prevInAllResourcesList; - if (!current->hasClients() && !current->isPreloaded()) { + if (!current->hasClients() && !current->isPreloaded() && !current->isCacheValidator()) { evict(current); // If evict() caused pruneDeadResources() to be re-entered, bail out. This can happen when removing an // SVG CachedImage that has subresources. |