Commit d8560b94 authored by alice.liu@apple.com's avatar alice.liu@apple.com

2008-05-20 Alice Liu <alice.liu@apple.com>

        Reviewed by Brady.

        fix <rdar://problem/5908580> 10A58: Dictionary Panel hangs in WebCore::Cache::pruneDeadResources()

        * loader/Cache.cpp:
        (WebCore::Cache::requestUserCSSStyleSheet):
        Add a call to resourceAccessed() to more closely mirror what is done in requestResource()
        (WebCore::Cache::insertInLRUList):
        Assert that any resource in the LRU list has been accessed.  This is early detection of a
        potential hang later when pruning resources, and also agrees with the early return in 
        removeFromLRUList().



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 78ceb1f5
2008-05-20 Alice Liu <alice.liu@apple.com>
Reviewed by Brady.
fix <rdar://problem/5908580> 10A58: Dictionary Panel hangs in WebCore::Cache::pruneDeadResources()
* loader/Cache.cpp:
(WebCore::Cache::requestUserCSSStyleSheet):
Add a call to resourceAccessed() to more closely mirror what is done in requestResource()
(WebCore::Cache::insertInLRUList):
Assert that any resource in the LRU list has been accessed. This is early detection of a
potential hang later when pruning resources, and also agrees with the early return in
removeFromLRUList().
2008-05-20 Dan Bernstein <mitz@apple.com>
Reviewed by Darin Adler.
......@@ -169,8 +169,11 @@ CachedCSSStyleSheet* Cache::requestUserCSSStyleSheet(DocLoader* docLoader, const
userSheet->setInCache(true);
// Don't load incrementally, skip load checks, don't send resource load callbacks.
userSheet->load(docLoader, false, true, false);
if (!disabled())
if (!disabled()) {
m_resources.set(url, userSheet);
// This will move the resource to the front of its LRU list and increase its access count.
resourceAccessed(userSheet);
}
else
userSheet->setInCache(false);
......@@ -420,6 +423,7 @@ void Cache::insertInLRUList(CachedResource* resource)
// Make sure we aren't in some list already.
ASSERT(!resource->m_nextInAllResourcesList && !resource->m_prevInAllResourcesList);
ASSERT(resource->inCache());
ASSERT(resource->accessCount() > 0);
LRUList* list = lruListFor(resource);
......
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