* SUMMARY When using the inspector on a page with unchanging js, reloading may cause the JS documents to disappear. The issue appears to be that cached js resources that do not trigger a reload do not provide any content to the inspector. * STEPS TO REPRODUCE 1. Go to http://nerget.com/bugs/JSInspectorBug.html 2. Open the inspector 3. Go to the resources panel 4. Focus the JSInspectorBug.js file, notice that it has content 5. Reload the main window (with cmd-r, or whatever) * RESULTS There is no longer any content shown in the inspector, this also makes debugging that file impossible <rdar://problem/6467206>
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.
This was fixed by Antti Koivisto in r39725.
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.