[webkit-dev] WebCore's ResourceLoader
Boris Brönner
borisbroenner at googlemail.com
Mon Apr 23 01:05:01 PDT 2012
Hi everyone,
I want to use the ResourceLoader (WebCore/loader), but without
caching. It was possible a while
ago using SubresourceLoaderClient (removed in revision 100311), but
now it seems like there are no resources but CachedResources and it is
not possible to do no caching for certain types of resources. When I
look at the ImageLoader class (WebCore/loader/ImageLoader.cpp) the
resource loading is deferred to the document's cachedResourceLoader,
but the document doesn't seem to have a noncached resource loader.
Is it, if at all, possible to get access to a non-caching resource loader?
Up to now I investigated the following:
o as far as I see, I can't get access to such a thing.
o Also it is not really possible to disable caching for a certain type
of resources. That would be I define my own CachedResource and
overwrite a method that tells "do not cache me", this is not possible.
o I could manually remove the resource after loading from the cache by
using the global memoryCache() accessor. But the CachedResourceLoader
operates only on bare resource pointers, so simply removing it from
the cache is not enough, the resource might be stored somewhere else
(and in fact it is, the loader already stores a map from URLs to
loaded resources)
o I could declare my own resource to have the type
CachedResource::RawResource. In this case the CachedResourceLoader
doesn't cache it. I don't like this, since the implementation could
change and decide to cache RawResources and I would have to keep track
of this.
All in all, my conclusion up to now is, I can't really do non-cached
resource loading without extending WebCore code probably by
implementing my own ResourceLoader.
Is this right?
Thanks in advance!
Regards,
bobbel
More information about the webkit-dev
mailing list