summaryrefslogtreecommitdiffstats
path: root/WebCore/loader/Cache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/loader/Cache.cpp')
-rw-r--r--WebCore/loader/Cache.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/WebCore/loader/Cache.cpp b/WebCore/loader/Cache.cpp
index 6eeba77..391790f 100644
--- a/WebCore/loader/Cache.cpp
+++ b/WebCore/loader/Cache.cpp
@@ -34,10 +34,10 @@
#include "FrameView.h"
#include "Image.h"
#include "ResourceHandle.h"
+#include "SecurityOrigin.h"
#include <stdio.h>
#include <wtf/CurrentTime.h>
-
using namespace std;
namespace WebCore {
@@ -105,7 +105,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 +183,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 +192,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 +207,7 @@ void Cache::revalidationSucceeded(CachedResource* revalidatingResource, const Re
ASSERT(resource);
ASSERT(!resource->inCache());
ASSERT(resource->isLoaded());
+ ASSERT(revalidatingResource->inCache());
evict(revalidatingResource);
@@ -352,7 +354,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.