diff options
Diffstat (limited to 'WebCore/loader/DocumentLoader.cpp')
-rw-r--r-- | WebCore/loader/DocumentLoader.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/WebCore/loader/DocumentLoader.cpp b/WebCore/loader/DocumentLoader.cpp index d0443e8..ffc61df 100644 --- a/WebCore/loader/DocumentLoader.cpp +++ b/WebCore/loader/DocumentLoader.cpp @@ -411,6 +411,10 @@ void DocumentLoader::setupForReplaceByMIMEType(const String& newMIMEType) void DocumentLoader::updateLoading() { + if (!m_frame) { + setLoading(false); + return; + } ASSERT(this == frameLoader()->activeDocumentLoader()); setLoading(frameLoader()->isLoading()); } @@ -556,13 +560,20 @@ PassRefPtr<ArchiveResource> DocumentLoader::subresource(const KURL& url) const if (!isCommitted()) return 0; - Document* doc = m_frame->document(); - - CachedResource* resource = doc->docLoader()->cachedResource(url); - if (!resource || resource->preloadResult() == CachedResource::PreloadReferenced) + CachedResource* resource = m_frame->document()->docLoader()->cachedResource(url); + if (!resource || !resource->isLoaded()) return archiveResourceForURL(url); - - return ArchiveResource::create(resource->data(), url, resource->response()); + + // FIXME: This has the side effect of making the resource non-purgeable. + // It would be better if it didn't have this permanent effect. + if (!resource->makePurgeable(false)) + return 0; + + RefPtr<SharedBuffer> data = resource->data(); + if (!data) + return 0; + + return ArchiveResource::create(data.release(), url, resource->response()); } void DocumentLoader::getSubresources(Vector<PassRefPtr<ArchiveResource> >& subresources) const |