2008-12-18 Darin Adler <darin@apple.com>
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Dec 2008 23:58:53 +0000 (23:58 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Dec 2008 23:58:53 +0000 (23:58 +0000)
commit6e46febb5f06f7806f6bacf534f63b7168e009ec
tree0df81b7049d97404a69ae18a5495c7ed16f0dc1f
parent417e2554e97a309eca5ad626749694a0084cc53e
2008-12-18  Darin Adler  <darin@apple.com>

        Reviewed by Sam Weinig.

        - fix <rdar://problem/6449841> reduce memory use of ResourceResponseBase by removing two maps

        We were parsing the cache-control and pragma header field values into maps.
        I changed that so instead we only cache two bits with the data we were actually
        using. Later we might want to move this responsibility out of this class entirely;
        we can cache it at the higher level instead.

        * loader/CachedResource.cpp:
        (WebCore::CachedResource::mustRevalidate): Changed to call a specific API to get at
        the bits in quest instead of a general "cache control directives" API.

        * platform/network/ResourceResponseBase.cpp:
        (WebCore::ResourceResponseBase::setHTTPHeaderField): Remove the logic for the
        pragma header field since no one is using this for now.
        (WebCore::ResourceResponseBase::parseCacheControlDirectives): Eliminated the return
        value and made this function have side effects only. Changed it so it's the caller's
        responsibility to check m_haveParsedCacheControl. Set m_cacheControlContainsNoCache
        and m_cacheControlContainsMustRevalidate rather than keeping a map around.

        * platform/network/ResourceResponseBase.h:
        (WebCore::ResourceResponseBase::cacheControlContainsNoCache): Added.
        (WebCore::ResourceResponseBase::cacheControlContainsMustRevalidate): Added.
        (WebCore::ResourceResponseBase::ResourceResponseBase): Updated since I removed
        m_haveParsedCacheControl and renamed m_haveParsedCacheControlHeader to remove
        the imprecise use of the term "header".

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/loader/CachedResource.cpp
WebCore/platform/network/ResourceResponseBase.cpp
WebCore/platform/network/ResourceResponseBase.h