2008-03-25  Antti Koivisto  <antti@apple.com>

        Reviewed by Oliver.

        Fix http://bugs.webkit.org/show_bug.cgi?id=18082
        REGRESSION (r31287): GMail does not work if user stylesheet is set
        
        Oops, my cache refactoring patch was missing these rather essential lines for
        user stylesheets. They would get reloaded repeatedly.

        * loader/Cache.cpp:
        (WebCore::Cache::requestUserCSSStyleSheet):



git-svn-id: svn://svn.chromium.org/blink/trunk@31307 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Cache::LRUList* Cache::lruListFor(CachedResource* resource)
{
    unsigned accessCount = max(resource->accessCount(), 1U);
    unsigned queueIndex = fastLog2(resource->size() / accessCount);
#ifndef NDEBUG
    resource->m_lruIndex = queueIndex;
#endif
    if (m_allResources.size() <= queueIndex)
        m_allResources.grow(queueIndex + 1);
    return &m_allResources[queueIndex];
}

Cache::LRUList* Cache::lruListFor(CachedResource* resource)
{
    unsigned accessCount = max(resource->accessCount(), 1U);
    unsigned queueIndex = fastLog2(resource->size() / accessCount);
#ifndef NDEBUG
    resource->m_lruIndex = queueIndex;
#endif
    if (m_allResources.size() <= queueIndex)
        m_allResources.grow(queueIndex + 1);
    return &m_allResources[queueIndex];
}
