Reviewed by Maciej
authorbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Aug 2006 06:01:09 +0000 (06:01 +0000)
committerbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Aug 2006 06:01:09 +0000 (06:01 +0000)
commitc56467a6c026ae40a7af611c68a40325b51b9428
tree8b211c459b8b0f7b88f9445876b4d7e2cc2840e2
parentf251a6ebee95f44aa67da01be477cc111b10f5a0
    Reviewed by Maciej

        The role of the SiteIcon is now the original intention - to be a cache of data relating to an Icon
        As such, I'm renaming it to IconDataCache.
        Also, the IconDatabase has to manually set the image data on the IconDataCache and also sets the
        TimeStamp when an icon is created or the data is changed.
        IconDataCache now has a method to write itself *to* a given database, instead of read itself from one.
        IconDatabase schema changes to have the timestamp set manually instead of via a trigger.
        The overall purpose of this change is to cache the timestamp, killing off a very common SQL query.

        * WebCore.xcodeproj/project.pbxproj: Renamed a file
        * loader/icon/IconDataCache.cpp: Added.
        (IconDataCache::IconDataCache):
        (IconDataCache::getImage): Now either returns the stored image, or 0 - no attempt to grab data
        (IconDataCache::manuallySetImageData): Delete the old image and create the new one
        (IconDataCache::writeToDatabase): Write the current iconURL, data, and timestamp to the given DB
        (IconDataCache::imageDataStatus): Determine if an IconDataCache is new without data versus actually having null data
        * loader/icon/IconDatabase.cpp:
        (WebCore::IconDatabase::createDatabaseTables): Changed DB schema to version 5 (hopefully the final version)
        (WebCore::IconDatabase::iconForPageURL):
        (WebCore::IconDatabase::isIconExpiredForIconURL): Uses the timestamp in the IconDataCache object instead of always querying
        (WebCore::IconDatabase::getOrCreateIconDataCache): Added, to handle creation of new IconDataCache when appropriate
        (WebCore::IconDatabase::setIconDataForIconURL): Puts data in SiteIcon then marks it for a future write
        (WebCore::IconDatabase::syncDatabase): Now syncs SiteIconsPendingUpdate
        * loader/icon/IconDatabase.h:
        (WebCore::IconDataCache::getTimestamp):
        (WebCore::IconDataCache::setTimestamp):
        * loader/icon/SiteIcon.cpp: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15983 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/loader/icon/IconDataCache.cpp [new file with mode: 0644]
WebCore/loader/icon/IconDatabase.cpp
WebCore/loader/icon/IconDatabase.h
WebCore/loader/icon/SiteIcon.cpp [deleted file]