WebCore:
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Dec 2007 07:17:21 +0000 (07:17 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Dec 2007 07:17:21 +0000 (07:17 +0000)
commit58d3ad07eef8407b3f9984af6475bb974b29f8fe
tree39cbd5f186a33c3636ca778617d0ded9639a2b8b
parent036e9e46fc494dc214f8884b3f5121e80828afdb
WebCore:

        Reviewed by Sam Weinig

        Fix for <rdar://problem/4886844> and lay groundwork for <rdar://problem/4516170> (Back/Forward Cache on Windows)

        All back/forward list and page cache related items used to be in WebKit.
        When they were pushed into WebCore, some sloppy compromises were made to keep the Back/Forward cache working on Mac.
        Namely, a WebCore::HistoryItem had to know how to keep a WebDocumentView alive.  We accomplished this via some #ifdefs
        in CachedPage and having the Mac-only CachedPageMac.mm

        To get rid of that nastiness and pave the way for adding Back/Forward cache on other platforms, this patch adds the
        concept of "CachedPagePlatformData" which can contain anything the platform API wants.

        I also took the opportunity to do other cleanup and renaming client methods to better fit their new purposes.

        * WebCore.base.exp:
        * WebCore.xcodeproj/project.pbxproj:

        * history/CachedPage.cpp:
        (WebCore::CachedPage::~CachedPage): Combined "close()" and "clear()" to just "clear()" - call it from here.
        (WebCore::CachedPage::clear): Call clear() on the CachedPagePlatformData if it exists.  Also delete the CachedPagePlatformData.
        (WebCore::CachedPage::setCachedPagePlatformData):
        (WebCore::CachedPage::cachedPagePlatformData):
        * history/CachedPage.h:

        * history/CachedPagePlatformData.h: Added.
        (WebCore::CachedPagePlatformData::~CachedPagePlatformData): Virtual d'tor.
        (WebCore::CachedPagePlatformData::clear): Virtual method for platforms that need to do cleanup at the same time as CachedPage::clear().

        * history/PageCache.cpp:
        (WebCore::PageCache::releaseAutoreleasedPagesNow): Call "clear()" instead of "close()"

        * history/mac/CachedPageMac.mm: Removed. Functionality replaced with CachedPagePlatformData.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::transitionToCommitted): Call the new client methods.  Make some work previously done by WebKitMac cross platform
          (setting the cached DocumentLoader to the Frame).
        (WebCore::FrameLoader::cachePageForHistoryItem):  Renamed the client methods

        * loader/FrameLoaderClient.h:  The very Mac-centric "makeDocumentView", "setDocumentViewFromCachedPage", and "saveDocumentViewToCachedPage"
          become "transitionToCommittedForNewPage", "transitionToCommittedFromCachedPage", and "savePlatformDataToCachedPage" accordingly

        * svg/graphics/SVGImageEmptyClients.h:
        (WebCore::SVGEmptyFrameLoaderClient::savePlatformDataToCachedPage):
        (WebCore::SVGEmptyFrameLoaderClient::transitionToCommittedFromCachedPage):
        (WebCore::SVGEmptyFrameLoaderClient::transitionToCommittedForNewPage):

WebKit:

        Reviewed by Sam Weinig

                Fix for <rdar://problem/4886844> and lay groundwork for <rdar://problem/4516170> (Back/Forward Cache on Windows)

        * WebKit.xcodeproj/project.pbxproj: Added a new file

WebKit/gtk:

        Reviewed by Sam Weinig

        As part of doing some CachedPage and client cleanup, keep GTK building

        * WebCoreSupport/FrameLoaderClientGtk.cpp:
        (WebKit::FrameLoaderClient::savePlatformDataToCachedPage):
        (WebKit::FrameLoaderClient::transitionToCommittedFromCachedPage):
        (WebKit::FrameLoaderClient::transitionToCommittedForNewPage):
        * WebCoreSupport/FrameLoaderClientGtk.h:

WebKit/mac:

        Reviewed by Sam Weinig

        Fix for <rdar://problem/4886844> and lay groundwork for <rdar://problem/4516170> (Back/Forward Cache on Windows)

        * WebCoreSupport/WebCachedPagePlatformData.h: Added.
        (WebCachedPagePlatformData::WebCachedPagePlatformData): Constructor takes a WebDocumentView for later restoration
        (WebCachedPagePlatformData::clear):
        (WebCachedPagePlatformData::webDocumentView):

        * WebCoreSupport/WebFrameLoaderClient.h:
        * WebCoreSupport/WebFrameLoaderClient.mm:
        (WebFrameLoaderClient::savePlatformDataToCachedPage):
        (WebFrameLoaderClient::transitionToCommittedFromCachedPage): Don't set the DocumentLoader to the Frame here,
          because that is now done in WebCore.
        (WebFrameLoaderClient::transitionToCommittedForNewPage):

WebKit/qt:

        Reviewed by Sam Weinig

        As part of doing some CachedPage and client cleanup, keep Qt building

        * WebCoreSupport/FrameLoaderClientQt.cpp:
        (WebCore::FrameLoaderClientQt::savePlatformDataToCachedPage):
        (WebCore::FrameLoaderClientQt::transitionToCommittedFromCachedPage):
        (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
        * WebCoreSupport/FrameLoaderClientQt.h:

WebKit/win:

        Reviewed by Sam Weinig

        Fix for <rdar://problem/4886844> and lay groundwork for <rdar://problem/4516170> (Back/Forward Cache on Windows)

        Even though this new code isn't exercised yet because the page cache is still turned off for Windows, local testing
        has indicated it works well.

        * WebCachedPagePlatformData.h: Added.
        (WebCachedPagePlatformData::WebCachedPagePlatformData): Constructor takes an IWebDataSource and the object retains it
        (WebCachedPagePlatformData::clear):
        (WebCachedPagePlatformData::webDataSource):

        * WebFrame.cpp:
        (WebFrame::savePlatformDataToCachedPage):
        (WebFrame::transitionToCommittedFromCachedPage):
        (WebFrame::transitionToCommittedForNewPage):
        * WebFrame.h:

        * WebKit.vcproj/WebKit.vcproj:

WebKit/wx:

        Reviewed by Sam Weinig

        As part of doing some CachedPage and client cleanup, keep Wx building

        * WebKitSupport/FrameLoaderClientWx.cpp:
        (WebCore::FrameLoaderClientWx::savePlatformDataToCachedPage):
        (WebCore::FrameLoaderClientWx::transitionToCommittedFromCachedPage):
        (WebCore::FrameLoaderClientWx::transitionToCommittedForNewPage):
        * WebKitSupport/FrameLoaderClientWx.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
31 files changed:
WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/history/CachedPage.cpp
WebCore/history/CachedPage.h
WebCore/history/CachedPagePlatformData.h [new file with mode: 0644]
WebCore/history/PageCache.cpp
WebCore/history/mac/CachedPageMac.mm [deleted file]
WebCore/loader/FrameLoader.cpp
WebCore/loader/FrameLoaderClient.h
WebCore/svg/graphics/SVGImageEmptyClients.h
WebKit/ChangeLog
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebCachedPagePlatformData.h [new file with mode: 0644]
WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
WebKit/win/ChangeLog
WebKit/win/WebCachedPagePlatformData.h [new file with mode: 0644]
WebKit/win/WebFrame.cpp
WebKit/win/WebFrame.h
WebKit/win/WebKit.vcproj/WebKit.vcproj
WebKit/wx/ChangeLog
WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
WebKit/wx/WebKitSupport/FrameLoaderClientWx.h