Commit 97c1d600 authored by oliver's avatar oliver

2007-03-28 Oliver Hunt <oliver@apple.com>

        Reviewed by Hyatt.

        Roll out r20511 due to incredible badness

        * loader/Cache.cpp:
        (WebCore::Cache::pruneAllResources):
        (WebCore::Cache::remove):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20550 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2a254a04
2007-03-28 Oliver Hunt <oliver@apple.com>
Reviewed by Hyatt.
Roll out r20511 due to incredible badness
* loader/Cache.cpp:
(WebCore::Cache::pruneAllResources):
(WebCore::Cache::remove):
2007-03-27 Oliver Hunt <oliver@apple.com>
Reviewed by Adam.
......
......@@ -42,7 +42,7 @@ using namespace std;
namespace WebCore {
const int cDefaultCacheSize = 8192 * 1024;
const int cDefaultCacheSize = 1000;// 8192 * 1024;
Cache* cache()
{
......@@ -154,6 +154,7 @@ void Cache::pruneLiveResources()
void Cache::pruneAllResources()
{
m_maximumSize = 1000;
// No need to prune if all of our objects fit.
if (m_currentSize <= m_maximumSize)
return;
......@@ -233,8 +234,11 @@ void Cache::remove(CachedResource* resource)
if (resource->referenced())
removeFromLiveResourcesList(resource);
// FIXME: Multiple DocLoaders may still be holding the resource at this point
// effectively resulting in an invisible CachedResource
// Notify all doc loaders that might be observing this object still that it has been
// extracted from the set of resources.
HashSet<DocLoader*>::iterator end = m_docLoaders.end();
for (HashSet<DocLoader*>::iterator itr = m_docLoaders.begin(); itr != end; ++itr)
(*itr)->removeCachedResource(resource);
// Subtract from our size totals.
int delta = -resource->size();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment