Lines Matching refs:CachedResource
58 static CachedResource* createResource(CachedResource::Type type, const KURL& url, const String& charset)
61 case CachedResource::ImageResource:
63 case CachedResource::CSSStyleSheet:
65 case CachedResource::Script:
67 case CachedResource::FontResource:
70 case CachedResource::XSLStyleSheet:
74 case CachedResource::LinkResource:
75 return new CachedResource(url.string(), CachedResource::LinkResource);
109 CachedResource* CachedResourceLoader::cachedResource(const String& resourceURL) const
112 return cachedResource(url);
115 CachedResource* CachedResourceLoader::cachedResource(const KURL& resourceURL) const
135 if (completeURL.isValid() && canRequest(CachedResource::ImageResource, completeURL))
140 CachedImage* resource = static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, url, String()));
162 return static_cast<CachedFont*>(requestResource(CachedResource::FontResource, url, String()));
167 return static_cast<CachedCSSStyleSheet*>(requestResource(CachedResource::CSSStyleSheet, url, charset, priority));
174 if (CachedResource* existing = memoryCache()->resourceForURL(url)) {
175 if (existing->type() == CachedResource::CSSStyleSheet)
195 return static_cast<CachedScript*>(requestResource(CachedResource::Script, url, charset));
201 return static_cast<CachedXSLStyleSheet*>(requestResource(CachedResource::XSLStyleSheet, url, String()));
206 CachedResource* CachedResourceLoader::requestLinkResource(const String& url, ResourceLoadPriority priority)
209 return requestResource(CachedResource::LinkResource, url, String(), priority);
213 bool CachedResourceLoader::canRequest(CachedResource::Type type, const KURL& url)
219 case CachedResource::ImageResource:
220 case CachedResource::CSSStyleSheet:
221 case CachedResource::Script:
222 case CachedResource::FontResource:
224 case CachedResource::LinkResource:
227 // FIXME: Are we sure about CachedResource::FontResource?
230 case CachedResource::XSLStyleSheet:
247 case CachedResource::Script:
249 case CachedResource::XSLStyleSheet:
255 case CachedResource::ImageResource:
256 case CachedResource::CSSStyleSheet:
257 case CachedResource::FontResource: {
266 case CachedResource::LinkResource:
274 case CachedResource::Script:
279 case CachedResource::XSLStyleSheet:
281 case CachedResource::CSSStyleSheet:
285 case CachedResource::ImageResource:
289 case CachedResource::FontResource: {
295 case CachedResource::LinkResource:
303 CachedResource* CachedResourceLoader::requestResource(CachedResource::Type type, const String& resourceURL, const String& charset, ResourceLoadPriority priority, bool forPreload)
335 CachedResource* resource = memoryCache()->resourceForURL(url);
363 CachedResource* CachedResourceLoader::revalidateResource(CachedResource* resource, ResourceLoadPriority priority)
373 CachedResource* newResource = createResource(resource->type(), KURL(ParsedURLString, url), resource->encoding());
388 CachedResource* CachedResourceLoader::loadResource(CachedResource::Type type, const KURL& url, const String& charset, ResourceLoadPriority priority)
392 LOG(ResourceLoading, "Loading CachedResource for '%s'.", url.string().latin1().data());
394 CachedResource* resource = createResource(type, url, charset);
399 // FIXME: CachedResource should just use normal refcounting instead.
424 CachedResourceLoader::RevalidationPolicy CachedResourceLoader::determineRevalidationPolicy(CachedResource::Type type, bool forPreload, CachedResource* existingResource) const
523 CachedResource* resource = it->second.get();
524 if (resource->type() == CachedResource::ImageResource) {
564 CachedResource* resource = it->second.get();
565 if (resource->type() == CachedResource::ImageResource) {
582 void CachedResourceLoader::removeCachedResource(CachedResource* resource) const
592 void CachedResourceLoader::load(CachedResource* resource, bool incremental, SecurityCheckPolicy securityCheck, bool sendResourceLoadCallbacks)
644 void CachedResourceLoader::notifyLoadedFromMemoryCache(CachedResource* resource)
646 if (!resource || !frame() || resource->status() != CachedResource::Cached)
653 void CachedResourceLoader::incrementRequestCount(const CachedResource* res)
661 void CachedResourceLoader::decrementRequestCount(const CachedResource* res)
677 void CachedResourceLoader::preload(CachedResource::Type type, const String& url, const String& charset, bool referencedFromBody)
683 bool canBlockParser = type == CachedResource::Script || type == CachedResource::CSSStyleSheet;
701 if (!cachedResource(m_document->completeURL(preload.m_url)))
707 void CachedResourceLoader::requestPreload(CachedResource::Type type, const String& url, const String& charset)
710 if (type == CachedResource::Script || type == CachedResource::CSSStyleSheet)
713 CachedResource* resource = requestResource(type, url, encoding, ResourceLoadPriorityUnresolved, true);
719 m_preloads = adoptPtr(new ListHashSet<CachedResource*>);
735 ListHashSet<CachedResource*>::iterator end = m_preloads->end();
736 for (ListHashSet<CachedResource*>::iterator it = m_preloads->begin(); it != end; ++it) {
737 CachedResource* res = *it;
741 else if (res->preloadResult() == CachedResource::PreloadNotReferenced)
761 ListHashSet<CachedResource*>::iterator end = m_preloads.end();
762 for (ListHashSet<CachedResource*>::iterator it = m_preloads.begin(); it != end; ++it) {
763 CachedResource* res = *it;
764 if (res->preloadResult() == CachedResource::PreloadNotReferenced)
766 else if (res->preloadResult() == CachedResource::PreloadReferencedWhileComplete)
768 else if (res->preloadResult() == CachedResource::PreloadReferencedWhileLoading)
771 if (res->type() == CachedResource::Script) {
773 if (res->preloadResult() < CachedResource::PreloadReferencedWhileLoading)
775 } else if (res->type() == CachedResource::CSSStyleSheet) {
777 if (res->preloadResult() < CachedResource::PreloadReferencedWhileLoading)
781 if (res->preloadResult() < CachedResource::PreloadReferencedWhileLoading)