Summary: | Resources loaded from the memory cache do not get correctly inserted into the DocLoader resource map | ||
---|---|---|---|
Product: | WebKit | Reporter: | Oliver Hunt <oliver> |
Component: | Page Loading | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | ap, daniel.samuels1, eric, koivisto, oliver, timothy |
Priority: | P2 | Keywords: | InRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | Mac | ||
OS: | OS X 10.5 | ||
URL: | http://nerget.com/bugs/JSInspectorBug.html | ||
Bug Depends on: | |||
Bug Blocks: | 61006 |
Description
Oliver Hunt
2008-12-25 02:35:07 PST
Okay, i've tracked this down to resources loaded from the memory cache not being put in the docloader, and so not providing any information to the inspectorator *** Bug 23035 has been marked as a duplicate of this bug. *** 12/31/08 6:23 AM Oliver Hunt: Okay, the problem is that resources that validate as not needing to be refetched do not get put into the docloader resource map, this means that this also breaks Web Archives if you have reloaded the page. Have been discussing with Antti. He suggested mutable HashMap<String, CachedResource*> m_docResources -> mutable HashMap<String, CachedResourceHandle<CachedResource> > m_docResources Which after a quick patch did improve things (although some resources were still not refreshed correctly) , however we also then crashed on exit so it's perfectly possible my patch was doing something stupid. I believe that http://trac.webkit.org/changeset/39725 introduced a leak of all CachedResources. m_documentResources holds a CachedResourceHandle: typedef HashMap<String, CachedResourceHandle<CachedResource> > DocumentResourceMap; The only time that a CachedResource is ever destroyed is when its handle count hits 0: bool canDelete() const { return !hasClients() && !m_request && !m_preloadCount && !m_handleCount && !m_resourceToRevalidate && !m_proxyResource; } http://trac.webkit.org/browser/trunk/Source/WebCore/loader/cache/CachedResource.h#L176 But the only way to ever be removed from this map is from: void CachedResourceLoader::removeCachedResource(CachedResource* resource) const Which is only ever called from ~CachedResource(). This has been reported various times to Chromium (but affects all webkit implementations): http://code.google.com/p/chromium/issues/detail?id=36142 I'll file a WebKit bug shortly. |