2008-05-06 Anders Carlsson <andersca@apple.com>
commit8f26ae45b24c4f3c3b28457d5d6b9fb96dadddc3
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 May 2008 01:27:53 +0000 (7 01:27 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 May 2008 01:27:53 +0000 (7 01:27 +0000)
treea99a90ed56a9354d36db949b8bdc3aec002045cd
parent848f7317757c76d7d74708dd23080e94d2f14d63
2008-05-06  Anders Carlsson  <andersca@apple.com>

        Reviewed by Brady.

        Support reading back app caches from the datbase.

        * loader/appcache/ApplicationCache.cpp:
        (WebCore::ApplicationCache::ApplicationCache):
        Initialize m_storageID to 0.

        * loader/appcache/ApplicationCacheGroup.cpp:
        (WebCore::ApplicationCacheGroup::cacheDestroyed):
        If the cache being destroyed is not the newest cache, it should no longer be
        stored in the database. Remove it.

        (WebCore::ApplicationCacheGroup::setNewestCache):
        Don't store the cache here.

        (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
        Store it here instead.

        * loader/appcache/ApplicationCacheStorage.cpp:
        (WebCore::ApplicationCacheStorage::loadCacheGroup):
        New method that loads a cache group with a given manifest URL (or returns 0 if the load fails).

        (WebCore::ApplicationCacheStorage::findOrCreateCacheGroup):
        Search for the group in the database.

        (WebCore::ApplicationCacheStorage::loadManifestHostHashes):
        New method that loads the host hashes from the database.

        (WebCore::ApplicationCacheStorage::cacheGroupForURL):
        Search in the database for a cache that contains the resource.

        (WebCore::ApplicationCacheStorage::loadCache):
        New method that loads a cache with a given ID.

        (WebCore::ApplicationCacheStorage::remove):
        New method that removes a cache.

        * loader/appcache/ApplicationCacheStorage.h:
        Add definitions.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32933 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/loader/appcache/ApplicationCache.cpp
WebCore/loader/appcache/ApplicationCacheGroup.cpp
WebCore/loader/appcache/ApplicationCacheStorage.cpp
WebCore/loader/appcache/ApplicationCacheStorage.h