Changeset 20837 in webkit
- Timestamp:
- Apr 10, 2007 4:55:56 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 22 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r20834 r20837 1 2007-04-10 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Darin 4 5 <rdar://problem/4887095> - PageCache and PageState should be combined 6 7 These two objects are a relic of when the PageCache was split between WebCore and WebKit 8 It just makes good sense to combine them now, and the new object is more appropriately 9 called "CachedPage" 10 11 This patch is vast in scope, but simple in depth - anywhere a PageCache or PageState object 12 was used has been adjusted to use a CachedPage object instead. The most notable change is 13 that HistoryItem - which always used to have a PageCache object which may or may not have 14 had a PageState - now may or may not have a CachedPage. This actually simplifies the 15 HistoryItem code a bit while making the role of CachedPage much more clear. 16 17 * WebCore.exp: 18 * WebCore.xcodeproj/project.pbxproj: 19 20 * history/BackForwardList.cpp: 21 (WebCore::BackForwardList::addItem): 22 (WebCore::BackForwardList::setCapacity): 23 (WebCore::BackForwardList::setPageCacheSize): 24 (WebCore::BackForwardList::clearPageCache): 25 (WebCore::BackForwardList::close): 26 27 * history/PageCache.cpp: Removed. 28 * history/PageCache.h: Removed. 29 * page/PageState.cpp: Removed. 30 * page/PageState.h: Removed. 31 * history/CachedPage.cpp: Added. 32 (WebCore::CachedPage::create): 33 (WebCore::CachedPage::CachedPage): 34 (WebCore::CachedPage::~CachedPage): 35 (WebCore::CachedPage::restore): 36 (WebCore::CachedPage::clear): 37 (WebCore::CachedPage::setDocumentLoader): 38 (WebCore::CachedPage::documentLoader): 39 (WebCore::CachedPage::setTimeStamp): 40 (WebCore::CachedPage::setTimeStampToNow): 41 (WebCore::CachedPage::timeStamp): 42 * history/CachedPage.h: Added. 43 (WebCore::CachedPage::document): 44 (WebCore::CachedPage::mousePressNode): 45 (WebCore::CachedPage::URL): 46 47 * history/HistoryItem.cpp: 48 (WebCore::HistoryItem::HistoryItem): 49 (WebCore::HistoryItem::setCachedPage): 50 (WebCore::HistoryItem::setURL): 51 (WebCore::HistoryItem::alwaysAttemptToUseCachedPage): 52 (WebCore::HistoryItem::setAlwaysAttemptToUseCachedPage): 53 (WebCore::HistoryItem::cachedPage): 54 (WebCore::cachedPagesPendingRelease): 55 (WebCore::HistoryItem::releaseCachedPagesOrReschedule): 56 (WebCore::HistoryItem::releaseAllPendingCachedPages): 57 (WebCore::HistoryItem::scheduleCachedPageForRelease): 58 * history/HistoryItem.h: 59 * history/mac/HistoryItemMac.mm: 60 61 * history/HistoryItemTimer.cpp: 62 (WebCore::HistoryItemTimer::HistoryItemTimer): 63 (WebCore::HistoryItemTimer::callReleaseCachedPagesOrReschedule): 64 * history/HistoryItemTimer.h: 65 66 * history/mac/PageCacheMac.mm: Removed. 67 * history/mac/CachedPageMac.mm: Added. 68 (WebCore::CachedPage::close): 69 (WebCore::CachedPage::setDocumentView): 70 (WebCore::CachedPage::documentView): 71 72 * loader/DocumentLoader.cpp: 73 (WebCore::DocumentLoader::DocumentLoader): 74 (WebCore::DocumentLoader::loadFromCachedPage): 75 (WebCore::DocumentLoader::setLoadingFromCachedPage): 76 (WebCore::DocumentLoader::isLoadingFromCachedPage): 77 * loader/DocumentLoader.h: 78 79 * loader/FrameLoader.cpp: 80 (WebCore::FrameLoader::provisionalLoadStarted): 81 (WebCore::FrameLoader::commitProvisionalLoad): 82 (WebCore::FrameLoader::transitionToCommitted): 83 (WebCore::FrameLoader::open): 84 (WebCore::FrameLoader::startLoading): 85 (WebCore::FrameLoader::receivedMainResourceError): 86 (WebCore::FrameLoader::opened): 87 (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): 88 (WebCore::FrameLoader::loadProvisionalItemFromCachedPage): 89 (WebCore::FrameLoader::cachePageToHistoryItem): 90 (WebCore::FrameLoader::createHistoryItem): 91 (WebCore::FrameLoader::purgePageCache): 92 (WebCore::FrameLoader::invalidateCurrentItemCachedPage): 93 (WebCore::FrameLoader::loadItem): 94 (WebCore::FrameLoader::updateHistoryForStandardLoad): 95 (WebCore::FrameLoader::updateHistoryForClientRedirect): 96 (WebCore::FrameLoader::updateHistoryForBackForwardNavigation): 97 (WebCore::FrameLoader::updateHistoryForReload): 98 (WebCore::FrameLoader::updateHistoryForInternalLoad): 99 (WebCore::FrameLoader::updateHistoryForCommit): 100 * loader/FrameLoader.h: 101 * loader/FrameLoaderClient.h: 102 103 * page/mac/WebCoreFrameBridge.h: Got rid of unused WebCorePageCacheStateKey 104 * page/mac/WebCoreFrameBridge.mm: Ditto 105 106 * platform/graphics/svg/SVGImage.cpp: 107 * platform/graphics/svg/SVGImageEmptyClients.h: Update to reflect the new names 108 (WebCore::SVGEmptyFrameLoaderClient::loadProvisionalItemFromCachedPage): 109 (WebCore::SVGEmptyFrameLoaderClient::invalidateCurrentItemCachedPage): 110 (WebCore::SVGEmptyFrameLoaderClient::loadedFromCachedPage): 111 (WebCore::SVGEmptyFrameLoaderClient::clearLoadingFromCachedPage): 112 (WebCore::SVGEmptyFrameLoaderClient::isLoadingFromCachedPage): 113 (WebCore::SVGEmptyFrameLoaderClient::setDocumentViewFromCachedPage): 114 (WebCore::SVGEmptyFrameLoaderClient::saveDocumentViewToCachedPage): 115 1 116 2007-04-10 Antti Koivisto <antti@apple.com> 2 117 -
trunk/WebCore/WebCore.exp
r20820 r20837 122 122 _WebCoreFindFont 123 123 _WebCoreObjCFinalizeOnMainThread 124 _WebCorePageCacheStateKey125 124 _WebCoreSetAlwaysUseATSU 126 125 _WebCoreSetShouldUseFontSmoothing … … 128 127 _WebCoreTextFloatWidth 129 128 __Z26ReportBlockedObjCExceptionP11NSException 129 __ZN7WebCore10CachedPage12documentViewEv 130 __ZN7WebCore10CachedPage14documentLoaderEv 131 __ZN7WebCore10CachedPage15setDocumentViewEP11objc_object 132 __ZN7WebCore10CachedPageD1Ev 130 133 __ZN7WebCore10EventNames10clickEventE 131 134 __ZN7WebCore10EventNames12keydownEventE … … 170 173 __ZN7WebCore11HistoryItem12setURLStringERKNS_6StringE 171 174 __ZN7WebCore11HistoryItem12setViewStateEP11objc_object 175 __ZN7WebCore11HistoryItem13setCachedPageEN3WTF10PassRefPtrINS_10CachedPageEEE 172 176 __ZN7WebCore11HistoryItem13setVisitCountEi 173 177 __ZN7WebCore11HistoryItem14setScrollPointERKNS_8IntPointE 174 __ZN7WebCore11HistoryItem15setHasPageCacheEb175 178 __ZN7WebCore11HistoryItem15setIsTargetItemEb 176 179 __ZN7WebCore11HistoryItem17setAlternateTitleERKNS_6StringE … … 181 184 __ZN7WebCore11HistoryItem22mergeAutoCompleteHintsEPS0_ 182 185 __ZN7WebCore11HistoryItem23recurseToFindTargetItemEv 183 __ZN7WebCore11HistoryItem 27releaseAllPendingPageCachesEv184 __ZN7WebCore11HistoryItem3 0setAlwaysAttemptToUsePageCacheEb186 __ZN7WebCore11HistoryItem31setAlwaysAttemptToUseCachedPageEb 187 __ZN7WebCore11HistoryItem34performPendingReleaseOfCachedPagesEv 185 188 __ZN7WebCore11HistoryItem6setURLERKNS_4KURLE 186 189 __ZN7WebCore11HistoryItem8formDataEv 187 190 __ZN7WebCore11HistoryItem8setTitleERKNS_6StringE 188 __ZN7WebCore11HistoryItem9pageCacheEv189 191 __ZN7WebCore11HistoryItem9setParentERKNS_6StringE 190 192 __ZN7WebCore11HistoryItem9setTargetERKNS_6StringE … … 466 468 __ZN7WebCore9HTMLNames7srcAttrE 467 469 __ZN7WebCore9HTMLNames8hrefAttrE 468 __ZN7WebCore9PageCache12documentViewEv469 __ZN7WebCore9PageCache12setPageStateEN3WTF10PassRefPtrINS_9PageStateEEE470 __ZN7WebCore9PageCache14documentLoaderEv471 __ZN7WebCore9PageCache15setDocumentViewEP11objc_object472 __ZN7WebCore9PageCache17setDocumentLoaderEN3WTF10PassRefPtrINS_14DocumentLoaderEEE473 __ZN7WebCore9PageCache17setTimeStampToNowEv474 __ZN7WebCore9PageCache9pageStateEv475 __ZN7WebCore9PageCacheD1Ev476 __ZN7WebCore9PageState5clearEv477 __ZN7WebCore9PageState6createEPNS_4PageE478 __ZN7WebCore9PageStateD1Ev479 470 __ZN7WebCore9Selection22expandUsingGranularityENS_15TextGranularityE 480 471 __ZN7WebCore9TimerBase4stopEv -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r20794 r20837 304 304 4E19592D0A39DACC00220FE5 /* MediaQueryExp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4E1959270A39DACC00220FE5 /* MediaQueryExp.cpp */; }; 305 305 4E19592E0A39DACC00220FE5 /* MediaQueryExp.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E1959280A39DACC00220FE5 /* MediaQueryExp.h */; }; 306 510184690B08602A004A825F /* PageCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 510184670B08602A004A825F /* PageCache.h */; settings = {ATTRIBUTES = (Private, ); }; };307 5101846A0B08602A004A825F /* PageCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510184680B08602A004A825F /* PageCache.cpp */; };306 510184690B08602A004A825F /* CachedPage.h in Headers */ = {isa = PBXBuildFile; fileRef = 510184670B08602A004A825F /* CachedPage.h */; settings = {ATTRIBUTES = (Private, ); }; }; 307 5101846A0B08602A004A825F /* CachedPage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510184680B08602A004A825F /* CachedPage.cpp */; }; 308 308 510F735F0B56C08800A3002A /* AuthenticationChallenge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510F73590B56C08800A3002A /* AuthenticationChallenge.cpp */; }; 309 309 510F73600B56C08800A3002A /* AuthenticationChallenge.h in Headers */ = {isa = PBXBuildFile; fileRef = 510F735A0B56C08800A3002A /* AuthenticationChallenge.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 321 321 5160F1FE0B0A7EF400C1D2AF /* HistoryItemTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 5160F1FC0B0A7EF400C1D2AF /* HistoryItemTimer.h */; }; 322 322 5160F1FF0B0A7EF400C1D2AF /* HistoryItemTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5160F1FD0B0A7EF400C1D2AF /* HistoryItemTimer.cpp */; }; 323 5160F3BC0B0A99C900C1D2AF /* PageCacheMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5160F3BB0B0A99C900C1D2AF /* PageCacheMac.mm */; };323 5160F3BC0B0A99C900C1D2AF /* CachedPageMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5160F3BB0B0A99C900C1D2AF /* CachedPageMac.mm */; }; 324 324 5160F4980B0AA75F00C1D2AF /* HistoryItemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */; }; 325 325 51741D0F0B07259A00ED442C /* BackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 51741D0B0B07259A00ED442C /* BackForwardList.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 1557 1557 93E227E30AF589AD00D48324 /* ResourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DE0AF589AD00D48324 /* ResourceLoader.cpp */; }; 1558 1558 93E227E40AF589AD00D48324 /* SubresourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DF0AF589AD00D48324 /* SubresourceLoader.cpp */; }; 1559 93E22A6F0AF5E94100D48324 /* PageState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E22A6E0AF5E94100D48324 /* PageState.cpp */; };1560 93E22A730AF5E94C00D48324 /* PageState.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E22A720AF5E94C00D48324 /* PageState.h */; settings = {ATTRIBUTES = (Private, ); }; };1561 1559 93E241FF0B2B4E4000C732A1 /* HTMLFrameOwnerElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E241FE0B2B4E4000C732A1 /* HTMLFrameOwnerElement.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1562 1560 93E2425F0B2B509500C732A1 /* HTMLFrameOwnerElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E2425E0B2B509500C732A1 /* HTMLFrameOwnerElement.cpp */; }; … … 3416 3414 4E1959270A39DACC00220FE5 /* MediaQueryExp.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MediaQueryExp.cpp; sourceTree = "<group>"; }; 3417 3415 4E1959280A39DACC00220FE5 /* MediaQueryExp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MediaQueryExp.h; sourceTree = "<group>"; }; 3418 510184670B08602A004A825F /* PageCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageCache.h; sourceTree = "<group>"; };3419 510184680B08602A004A825F /* PageCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageCache.cpp; sourceTree = "<group>"; };3416 510184670B08602A004A825F /* CachedPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedPage.h; sourceTree = "<group>"; }; 3417 510184680B08602A004A825F /* CachedPage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedPage.cpp; sourceTree = "<group>"; }; 3420 3418 510F73590B56C08800A3002A /* AuthenticationChallenge.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticationChallenge.cpp; sourceTree = "<group>"; }; 3421 3419 510F735A0B56C08800A3002A /* AuthenticationChallenge.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AuthenticationChallenge.h; sourceTree = "<group>"; }; … … 3435 3433 5160F1FC0B0A7EF400C1D2AF /* HistoryItemTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HistoryItemTimer.h; sourceTree = "<group>"; }; 3436 3434 5160F1FD0B0A7EF400C1D2AF /* HistoryItemTimer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HistoryItemTimer.cpp; sourceTree = "<group>"; }; 3437 5160F3BB0B0A99C900C1D2AF /* PageCacheMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PageCacheMac.mm; path = mac/PageCacheMac.mm; sourceTree = "<group>"; };3435 5160F3BB0B0A99C900C1D2AF /* CachedPageMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CachedPageMac.mm; path = mac/CachedPageMac.mm; sourceTree = "<group>"; }; 3438 3436 5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = HistoryItemMac.mm; path = mac/HistoryItemMac.mm; sourceTree = "<group>"; }; 3439 3437 51741D0B0B07259A00ED442C /* BackForwardList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackForwardList.h; sourceTree = "<group>"; }; … … 4656 4654 93E227DE0AF589AD00D48324 /* ResourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoader.cpp; sourceTree = "<group>"; }; 4657 4655 93E227DF0AF589AD00D48324 /* SubresourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubresourceLoader.cpp; sourceTree = "<group>"; }; 4658 93E22A6E0AF5E94100D48324 /* PageState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageState.cpp; sourceTree = "<group>"; };4659 93E22A720AF5E94C00D48324 /* PageState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageState.h; sourceTree = "<group>"; };4660 4656 93E241FE0B2B4E4000C732A1 /* HTMLFrameOwnerElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLFrameOwnerElement.h; sourceTree = "<group>"; }; 4661 4657 93E2425E0B2B509500C732A1 /* HTMLFrameOwnerElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLFrameOwnerElement.cpp; sourceTree = "<group>"; }; … … 6761 6757 isa = PBXGroup; 6762 6758 children = ( 6763 5160F3BB0B0A99C900C1D2AF /* PageCacheMac.mm */,6759 5160F3BB0B0A99C900C1D2AF /* CachedPageMac.mm */, 6764 6760 5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */, 6765 6761 ); … … 6773 6769 51741D0B0B07259A00ED442C /* BackForwardList.h */, 6774 6770 51741D0C0B07259A00ED442C /* BackForwardList.cpp */, 6771 510184670B08602A004A825F /* CachedPage.h */, 6772 510184680B08602A004A825F /* CachedPage.cpp */, 6775 6773 51741D0D0B07259A00ED442C /* HistoryItem.h */, 6776 6774 51741D0E0B07259A00ED442C /* HistoryItem.cpp */, 6777 6775 5160F1FC0B0A7EF400C1D2AF /* HistoryItemTimer.h */, 6778 6776 5160F1FD0B0A7EF400C1D2AF /* HistoryItemTimer.cpp */, 6779 510184670B08602A004A825F /* PageCache.h */,6780 510184680B08602A004A825F /* PageCache.cpp */,6781 6777 ); 6782 6778 path = history; … … 6987 6983 65FEA86809833ADE00BED4AB /* Page.cpp */, 6988 6984 65A21467097A329100B9050A /* Page.h */, 6989 93E22A6E0AF5E94100D48324 /* PageState.cpp */,6990 93E22A720AF5E94C00D48324 /* PageState.h */,6991 6985 65D1C1C909932B22000CB324 /* Plugin.h */, 6992 6986 F587863A02DE3A1401EA4122 /* Settings.h */, … … 11086 11080 148AFDA50AF58360008CC700 /* ExceptionHandlers.h in Headers */, 11087 11081 148A00110AF59F3F008CC700 /* FontPlatformData.h in Headers */, 11088 93E22A730AF5E94C00D48324 /* PageState.h in Headers */,11089 11082 658821660AF4CDF700F01D1F /* ResourceResponse.h in Headers */, 11090 11083 93CCF0270AF6C52900018E89 /* NavigationAction.h in Headers */, … … 11122 11115 51741D0F0B07259A00ED442C /* BackForwardList.h in Headers */, 11123 11116 51741D110B07259A00ED442C /* HistoryItem.h in Headers */, 11124 510184690B08602A004A825F /* PageCache.h in Headers */,11117 510184690B08602A004A825F /* CachedPage.h in Headers */, 11125 11118 5160F1FE0B0A7EF400C1D2AF /* HistoryItemTimer.h in Headers */, 11126 11119 93C09A530B064DB3005ABD4D /* EventHandler.h in Headers */, … … 12413 12406 93E227E30AF589AD00D48324 /* ResourceLoader.cpp in Sources */, 12414 12407 93E227E40AF589AD00D48324 /* SubresourceLoader.cpp in Sources */, 12415 93E22A6F0AF5E94100D48324 /* PageState.cpp in Sources */,12416 12408 4B2709830AF2E5E00065127F /* PasteboardMac.mm in Sources */, 12417 12409 650E3F6A0AF6C168001FA3AD /* ResourceRequestMac.mm in Sources */, … … 12467 12459 51741D100B07259A00ED442C /* BackForwardList.cpp in Sources */, 12468 12460 51741D120B07259A00ED442C /* HistoryItem.cpp in Sources */, 12469 5101846A0B08602A004A825F /* PageCache.cpp in Sources */,12461 5101846A0B08602A004A825F /* CachedPage.cpp in Sources */, 12470 12462 5160F1FF0B0A7EF400C1D2AF /* HistoryItemTimer.cpp in Sources */, 12471 5160F3BC0B0A99C900C1D2AF /* PageCacheMac.mm in Sources */,12463 5160F3BC0B0A99C900C1D2AF /* CachedPageMac.mm in Sources */, 12472 12464 5160F4980B0AA75F00C1D2AF /* HistoryItemMac.mm in Sources */, 12473 12465 93C09A7F0B064EEF005ABD4D /* EventHandlerMac.mm in Sources */, -
trunk/WebCore/history/BackForwardList.cpp
r19889 r20837 27 27 #include "BackForwardList.h" 28 28 29 #include "CachedPage.h" 29 30 #include "HistoryItem.h" 30 31 #include "Logging.h" … … 64 65 m_entries.removeLast(); 65 66 m_entryHash.remove(item); 66 item->set HasPageCache(false);67 item->setCachedPage(0); 67 68 } 68 69 } … … 74 75 m_entries.remove(0); 75 76 m_entryHash.remove(item); 76 item->set HasPageCache(false);77 item->setCachedPage(0); 77 78 m_current--; 78 79 } … … 168 169 m_entries.removeLast(); 169 170 m_entryHash.remove(item); 170 item->set HasPageCache(false);171 item->setCachedPage(0); 171 172 } 172 173 … … 183 184 else if (size < m_pageCacheSize) { 184 185 for (signed i = m_current - size - 1; i > -1; --i) 185 m_entries[i]->set HasPageCache(false);186 HistoryItem:: releaseAllPendingPageCaches();186 m_entries[i]->setCachedPage(0); 187 HistoryItem::performPendingReleaseOfCachedPages(); 187 188 } 188 189 … … 200 201 // Don't clear the current item. Objects are still in use. 201 202 if (i != m_current) 202 m_entries[i]->set HasPageCache(false);203 } 204 205 HistoryItem:: releaseAllPendingPageCaches();203 m_entries[i]->setCachedPage(0); 204 } 205 206 HistoryItem::performPendingReleaseOfCachedPages(); 206 207 } 207 208 … … 242 243 int size = m_entries.size(); 243 244 for (int i = 0; i < size; ++i) 244 m_entries[i]->set HasPageCache(false);245 m_entries[i]->setCachedPage(0); 245 246 m_entries.clear(); 246 247 m_entryHash.clear(); -
trunk/WebCore/history/CachedPage.cpp
r20836 r20837 1 1 /* 2 * Copyright (C) 2006 Apple Computer,Inc. All rights reserved.2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 25 25 26 26 #include "config.h" 27 #include " PageCache.h"27 #include "CachedPage.h" 28 28 29 #include "PageState.h" 29 #include "Document.h" 30 #include "Element.h" 31 #include "EventHandler.h" 32 #include "FocusController.h" 33 #include "Frame.h" 34 #include "FrameLoader.h" 35 #include "FrameView.h" 36 #include "Page.h" 30 37 #include "SystemTime.h" 38 #if ENABLE(SVG) 39 #include "SVGDocumentExtensions.h" 40 #endif 41 42 #include "kjs_proxy.h" 43 #include "kjs_window.h" 44 #include "kjs_window.h" 45 #include <kjs/JSLock.h> 46 #include <kjs/SavedBuiltins.h> 47 #include <kjs/property_map.h> 48 49 using namespace KJS; 31 50 32 51 namespace WebCore { 33 52 34 PageCache::PageCache() 35 : m_timeStamp(0) 53 PassRefPtr<CachedPage> CachedPage::create(Page* page) 36 54 { 55 return new CachedPage(page); 37 56 } 38 57 39 void PageCache::setPageState(PassRefPtr<PageState> pageState) 58 CachedPage::CachedPage(Page* page) 59 : m_timeStamp(0) 60 , m_document(page->mainFrame()->document()) 61 , m_view(page->mainFrame()->view()) 62 , m_mousePressNode(page->mainFrame()->eventHandler()->mousePressNode()) 63 , m_URL(page->mainFrame()->loader()->url()) 64 , m_windowProperties(new SavedProperties) 65 , m_locationProperties(new SavedProperties) 66 , m_interpreterBuiltins(new SavedBuiltins) 40 67 { 41 m_pageState = pageState; 68 Frame* mainFrame = page->mainFrame(); 69 KJSProxy* proxy = mainFrame->scriptProxy(); 70 Window* window = Window::retrieveWindow(mainFrame); 71 72 mainFrame->clearTimers(); 73 74 JSLock lock; 75 76 if (proxy && window) { 77 proxy->interpreter()->saveBuiltins(*m_interpreterBuiltins.get()); 78 window->saveProperties(*m_windowProperties.get()); 79 window->location()->saveProperties(*m_locationProperties.get()); 80 m_pausedTimeouts.set(window->pauseTimeouts()); 81 } 82 83 m_document->setInPageCache(true); 84 85 #if ENABLE(SVG) 86 if (m_document && m_document->svgExtensions()) 87 m_document->accessSVGExtensions()->pauseAnimations(); 88 #endif 42 89 } 43 90 44 PageCache::~PageCache()91 CachedPage::~CachedPage() 45 92 { 46 93 close(); 47 94 } 48 95 49 PageState* PageCache::pageState()96 void CachedPage::restore(Page* page) 50 97 { 51 return m_pageState.get(); 98 Frame* mainFrame = page->mainFrame(); 99 KJSProxy* proxy = mainFrame->scriptProxy(); 100 Window* window = Window::retrieveWindow(mainFrame); 101 102 JSLock lock; 103 104 if (proxy && window) { 105 proxy->interpreter()->restoreBuiltins(*m_interpreterBuiltins.get()); 106 window->restoreProperties(*m_windowProperties.get()); 107 window->location()->restoreProperties(*m_locationProperties.get()); 108 window->resumeTimeouts(m_pausedTimeouts.get()); 109 } 110 111 #if ENABLE(SVG) 112 if (m_document && m_document->svgExtensions()) 113 m_document->accessSVGExtensions()->unpauseAnimations(); 114 #endif 115 116 mainFrame->eventHandler()->setMousePressNode(mousePressNode()); 117 118 // Restore the focus appearance for the focused element. 119 // FIXME: Right now we don't support pages w/ frames in the b/f cache. This may need to be tweaked when we add support for that. 120 Document* focusedDocument = page->focusController()->focusedOrMainFrame()->document(); 121 if (Node* node = focusedDocument->focusedNode()) { 122 if (node->isElementNode()) 123 static_cast<Element*>(node)->updateFocusAppearance(true); 124 } 52 125 } 53 126 54 void PageCache::setDocumentLoader(PassRefPtr<DocumentLoader> loader) 127 void CachedPage::clear() 128 { 129 if (!m_document) 130 return; 131 132 ASSERT(m_view); 133 ASSERT(m_document->view() == m_view); 134 135 if (m_document->inPageCache()) { 136 Frame::clearTimers(m_view.get()); 137 138 bool detached = !m_document->renderer(); 139 m_document->setInPageCache(false); 140 if (detached) { 141 m_document->detach(); 142 m_document->removeAllEventListenersFromAllNodes(); 143 } 144 145 m_view->clearPart(); 146 } 147 148 ASSERT(!m_document->inPageCache()); 149 150 m_document = 0; 151 m_view = 0; 152 m_mousePressNode = 0; 153 m_URL = KURL(); 154 155 JSLock lock; 156 157 m_windowProperties.clear(); 158 m_locationProperties.clear(); 159 m_interpreterBuiltins.clear(); 160 m_pausedTimeouts.clear(); 161 162 Collector::collect(); 163 } 164 165 void CachedPage::setDocumentLoader(PassRefPtr<DocumentLoader> loader) 55 166 { 56 167 m_documentLoader = loader; 57 168 } 58 169 59 DocumentLoader* PageCache::documentLoader()170 DocumentLoader* CachedPage::documentLoader() 60 171 { 61 172 return m_documentLoader.get(); 62 173 } 63 174 64 void PageCache::setTimeStamp(double timeStamp)175 void CachedPage::setTimeStamp(double timeStamp) 65 176 { 66 177 m_timeStamp = timeStamp; 67 178 } 68 179 69 void PageCache::setTimeStampToNow()180 void CachedPage::setTimeStampToNow() 70 181 { 71 182 m_timeStamp = currentTime(); 72 183 } 73 184 74 double PageCache::timeStamp() const185 double CachedPage::timeStamp() const 75 186 { 76 187 return m_timeStamp; -
trunk/WebCore/history/CachedPage.h
r20836 r20837 1 1 /* 2 * Copyright (C) 2006 Apple Computer,Inc. All rights reserved.2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #ifndef PageCache_h27 #define PageCache_h26 #ifndef CachedPage_h 27 #define CachedPage_h 28 28 29 29 #include "DocumentLoader.h" 30 #include "PageState.h"31 30 #include "Shared.h" 32 31 #include <wtf/Forward.h> 33 32 #include <wtf/RefPtr.h> 33 #include <wtf/OwnPtr.h> 34 34 35 35 #if PLATFORM(MAC) … … 38 38 #endif 39 39 40 namespace KJS { 41 42 class PausedTimeouts; 43 class SavedBuiltins; 44 class SavedProperties; 45 } 46 40 47 namespace WebCore { 41 48 42 class PageCache : public Shared<PageCache> { 49 class Document; 50 class FrameView; 51 class Node; 52 class Page; 53 54 class CachedPage : public Shared<CachedPage> { 43 55 public: 44 PageCache(); 45 ~PageCache(); 56 static PassRefPtr<CachedPage> create(Page*); 57 ~CachedPage(); 58 59 void clear(); 60 Document* document() const { return m_document.get(); } 61 Node* mousePressNode() const { return m_mousePressNode.get(); } 62 const KURL& URL() const { return m_URL; } 63 void restore(Page*); 46 64 47 65 void close(); 48 66 49 void setPageState(PassRefPtr<PageState>);50 PageState* pageState();51 67 void setTimeStamp(double); 52 68 void setTimeStampToNow(); … … 60 76 61 77 private: 62 // FIXME: <rdar://problem/4887095> 63 // PageCache should consume PageState and take its role, as well. The reasons for the division are obsolete 64 // now that everything is in WebCore instead of split with WebKit 65 RefPtr<PageState> m_pageState; 78 CachedPage(Page*); 66 79 RefPtr<DocumentLoader> m_documentLoader; 67 80 double m_timeStamp; 68 81 82 RefPtr<Document> m_document; 83 RefPtr<FrameView> m_view; 84 RefPtr<Node> m_mousePressNode; 85 KURL m_URL; 86 OwnPtr<KJS::SavedProperties> m_windowProperties; 87 OwnPtr<KJS::SavedProperties> m_locationProperties; 88 OwnPtr<KJS::SavedBuiltins> m_interpreterBuiltins; 89 OwnPtr<KJS::PausedTimeouts> m_pausedTimeouts; 90 69 91 #if PLATFORM(MAC) 70 92 RetainPtr<id> m_documentView; 71 93 #endif 72 }; // class PageCache94 }; // class CachedPage 73 95 74 96 } // namespace WebCore 75 97 76 #endif // PageCache_h98 #endif // CachedPage_h 77 99 -
trunk/WebCore/history/HistoryItem.cpp
r19927 r20837 27 27 #include "HistoryItem.h" 28 28 29 #include "CachedPage.h" 29 30 #include "FrameLoader.h" 30 31 #include "HistoryItemTimer.h" … … 33 34 #include "KURL.h" 34 35 #include "Logging.h" 35 #include "PageCache.h"36 36 #include "ResourceRequest.h" 37 37 #include "SystemTime.h" … … 42 42 void (*notifyHistoryItemChanged)() = defaultNotifyHistoryItemChanged; 43 43 44 static HashSet<RefPtr<CachedPage> >& cachedPagesPendingRelease() 45 { 46 // We keep this on the heap because otherwise, at app shutdown, we run into the "static destruction order fiasco" 47 // where the vector is torn down, the CachedPages destroyed, and all havok may break loose. Instead, we just leak at shutdown 48 // since nothing here persists 49 static HashSet<RefPtr<CachedPage> >* cachedPagesPendingRelease = new HashSet<RefPtr<CachedPage> >; 50 return *cachedPagesPendingRelease; 51 } 52 44 53 HistoryItem::HistoryItem() 45 54 : m_lastVisitedTime(0) 46 , m_pageCacheIsPendingRelease(false)47 55 , m_isTargetItem(false) 48 , m_alwaysAttemptToUse PageCache(false)56 , m_alwaysAttemptToUseCachedPage(false) 49 57 , m_visitCount(0) 50 58 { … … 56 64 , m_title(title) 57 65 , m_lastVisitedTime(time) 58 , m_pageCacheIsPendingRelease(false)59 66 , m_isTargetItem(false) 60 , m_alwaysAttemptToUse PageCache(false)67 , m_alwaysAttemptToUseCachedPage(false) 61 68 , m_visitCount(0) 62 69 { … … 69 76 , m_title(title) 70 77 , m_lastVisitedTime(0) 71 , m_pageCacheIsPendingRelease(false)72 78 , m_isTargetItem(false) 73 , m_alwaysAttemptToUse PageCache(false)79 , m_alwaysAttemptToUseCachedPage(false) 74 80 , m_visitCount(0) 75 81 { … … 84 90 , m_title(title) 85 91 , m_lastVisitedTime(0) 86 , m_pageCacheIsPendingRelease(false)87 92 , m_isTargetItem(false) 88 , m_alwaysAttemptToUse PageCache(false)93 , m_alwaysAttemptToUseCachedPage(false) 89 94 , m_visitCount(0) 90 95 { … … 107 112 , m_lastVisitedTime(item.m_lastVisitedTime) 108 113 , m_scrollPoint(item.m_scrollPoint) 109 , m_pageCacheIsPendingRelease(false)110 114 , m_isTargetItem(item.m_isTargetItem) 111 , m_alwaysAttemptToUse PageCache(item.m_alwaysAttemptToUsePageCache)115 , m_alwaysAttemptToUseCachedPage(item.m_alwaysAttemptToUseCachedPage) 112 116 , m_visitCount(item.m_visitCount) 113 117 , m_formContentType(item.m_formContentType) … … 129 133 } 130 134 131 void HistoryItem::setHasPageCache(bool hasCache) 132 { 133 LOG(PageCache, "WebCorePageCache - HistoryItem %p setting has page cache to %s", this, hasCache ? "TRUE" : "FALSE" ); 134 135 if (hasCache) { 136 if (!m_pageCache) 137 m_pageCache = new PageCache; 138 else if (m_pageCacheIsPendingRelease) 139 cancelRelease(); 140 } else if (m_pageCache) 141 scheduleRelease(); 135 void HistoryItem::setCachedPage(PassRefPtr<CachedPage> cachedPage) 136 { 137 CachedPage* rawCachedPage = cachedPage.releaseRef(); 138 139 // The new cached page should always be distinct from the current cached page and should also 140 // not be in the set of cached pages pending release 141 ASSERT(!rawCachedPage || rawCachedPage != m_cachedPage.get()); 142 ASSERT(!cachedPagesPendingRelease().contains(rawCachedPage)); 143 144 scheduleCachedPageForRelease(); 145 m_cachedPage = adoptRef(rawCachedPage); 146 147 LOG(PageCache, "WebCorePageCache: HistoryItem %p (%s) set cached page to %p", this, m_urlString.ascii().data(), m_cachedPage.get()); 142 148 } 143 149 … … 225 231 { 226 232 setURLString(url.url()); 227 set HasPageCache(false);233 setCachedPage(0); 228 234 } 229 235 … … 310 316 } 311 317 312 bool HistoryItem::alwaysAttemptToUse PageCache() const313 { 314 return m_alwaysAttemptToUse PageCache;315 } 316 317 void HistoryItem::setAlwaysAttemptToUse PageCache(bool flag)318 { 319 m_alwaysAttemptToUse PageCache = flag;318 bool HistoryItem::alwaysAttemptToUseCachedPage() const 319 { 320 return m_alwaysAttemptToUseCachedPage; 321 } 322 323 void HistoryItem::setAlwaysAttemptToUseCachedPage(bool flag) 324 { 325 m_alwaysAttemptToUseCachedPage = flag; 320 326 } 321 327 … … 360 366 } 361 367 362 PageCache* HistoryItem::pageCache() 363 { 364 if (m_pageCacheIsPendingRelease) 365 return 0; 366 return m_pageCache.get(); 367 } 368 369 bool HistoryItem::hasPageCache() const 370 { 371 if (m_pageCacheIsPendingRelease) 372 return false; 373 return m_pageCache; 368 CachedPage* HistoryItem::cachedPage() 369 { 370 return m_cachedPage.get(); 374 371 } 375 372 … … 439 436 } 440 437 441 static HashSet<RefPtr<HistoryItem> >& itemsWithPendingPageCacheToRelease() 442 { 443 // We keep this on the heap because otherwise, at app shutdown, we run into the "static destruction order fiasco" 444 // where the vector is torn down, the PageCaches destroyed, and all havok may break loose. Instead, we just leak at shutdown 445 // since nothing here persists 446 static HashSet<RefPtr<HistoryItem> >* itemsWithPendingPageCacheToRelease = new HashSet<RefPtr<HistoryItem> >; 447 return *itemsWithPendingPageCacheToRelease; 448 } 449 450 void HistoryItem::releasePageCachesOrReschedule() 438 void HistoryItem::releaseCachedPagesOrReschedule() 451 439 { 452 440 double loadDelta = currentTime() - FrameLoader::timeOfLastCompletedLoad(); … … 455 443 // FIXME: This size of 42 pending caches to release seems awfully arbitrary 456 444 // Wonder if anyone knows the rationalization 457 if ((userDelta < 0.5 || loadDelta < 1.25) && itemsWithPendingPageCacheToRelease().size() < 42) {458 LOG(PageCache, "WebCorePageCache: Postponing release PageCachesOrReschedule() - %f since last load, %f since last input, %i objects pending release", loadDelta, userDelta, itemsWithPendingPageCacheToRelease().size());445 if ((userDelta < 0.5 || loadDelta < 1.25) && cachedPagesPendingRelease().size() < 42) { 446 LOG(PageCache, "WebCorePageCache: Postponing releaseCachedPagesOrReschedule() - %f since last load, %f since last input, %i objects pending release", loadDelta, userDelta, cachedPagesPendingRelease().size()); 459 447 timer().schedule(); 460 448 return; 461 449 } 462 450 463 LOG(PageCache, "WebCorePageCache: Releasing page caches - %f seconds since last load, %f since last input, %i objects pending release", loadDelta, userDelta, itemsWithPendingPageCacheToRelease().size()); 464 releaseAllPendingPageCaches(); 465 } 466 467 void HistoryItem::releasePageCache() 468 { 469 m_pageCache->close(); 470 m_pageCache = 0; 471 m_pageCacheIsPendingRelease = false; 472 } 473 474 void HistoryItem::releaseAllPendingPageCaches() 451 LOG(PageCache, "WebCorePageCache: Releasing page caches - %f seconds since last load, %f since last input, %i objects pending release", loadDelta, userDelta, cachedPagesPendingRelease().size()); 452 performPendingReleaseOfCachedPages(); 453 } 454 455 void HistoryItem::performPendingReleaseOfCachedPages() 475 456 { 476 457 timer().invalidate(); 477 458 478 HashSet<RefPtr<HistoryItem> >::iterator i = itemsWithPendingPageCacheToRelease().begin(); 479 HashSet<RefPtr<HistoryItem> >::iterator end = itemsWithPendingPageCacheToRelease().end(); 459 Vector<CachedPage*> cachedPages; 460 cachedPages.reserveCapacity(cachedPagesPendingRelease().size()); 461 462 HashSet<RefPtr<CachedPage> >::iterator i = cachedPagesPendingRelease().begin(); 463 HashSet<RefPtr<CachedPage> >::iterator end = cachedPagesPendingRelease().end(); 480 464 for (; i != end; ++i) 481 (*i)->releasePageCache(); 482 483 itemsWithPendingPageCacheToRelease().clear(); 484 } 485 486 void HistoryItem::scheduleRelease() 487 { 488 LOG (PageCache, "WebCorePageCache: Scheduling release of %s", m_urlString.ascii().data()); 465 cachedPages.append((*i).get()); 466 467 for (unsigned j = 0; j < cachedPages.size(); ++j) 468 cachedPages[j]->close(); 469 470 cachedPagesPendingRelease().clear(); 471 } 472 473 void HistoryItem::scheduleCachedPageForRelease() 474 { 475 if (!m_cachedPage) 476 return; 477 478 LOG (PageCache, "WebCorePageCache: HistoryItem %p (%s) scheduling release of cached page %p", this, m_urlString.ascii().data(), m_cachedPage.get()); 479 480 cachedPagesPendingRelease().add(m_cachedPage); 481 m_cachedPage = 0; 482 489 483 // Don't reschedule the timer if its already running 490 484 if (!timer().isActive()) 491 485 timer().schedule(); 492 493 if (m_pageCache && !m_pageCacheIsPendingRelease) { 494 m_pageCacheIsPendingRelease = true; 495 itemsWithPendingPageCacheToRelease().add(this); 496 } 497 } 498 499 void HistoryItem::cancelRelease() 500 { 501 itemsWithPendingPageCacheToRelease().remove(this); 502 m_pageCacheIsPendingRelease = false; 503 } 486 } 487 504 488 #ifndef NDEBUG 505 489 int HistoryItem::showTree() const -
trunk/WebCore/history/HistoryItem.h
r20475 r20837 45 45 namespace WebCore { 46 46 47 class CachedPage; 47 48 class Image; 48 49 class KURL; 49 class PageCache;50 50 class ResourceRequest; 51 51 … … 79 79 80 80 void retainIconInDatabase(bool retain); 81 static void releaseAllPendingPageCaches(); 82 bool hasPageCache() const; 83 void setHasPageCache(bool); 84 PageCache* pageCache(); 81 static void performPendingReleaseOfCachedPages(); 82 void setCachedPage(PassRefPtr<CachedPage>); 83 CachedPage* cachedPage(); 85 84 86 85 const String& parent() const; … … 126 125 bool hasChildren() const; 127 126 128 void setAlwaysAttemptToUse PageCache(bool);129 bool alwaysAttemptToUse PageCache() const;127 void setAlwaysAttemptToUseCachedPage(bool); 128 bool alwaysAttemptToUseCachedPage() const; 130 129 131 130 // This should not be called directly for HistoryItems that are already included … … 143 142 #endif 144 143 145 void scheduleRelease(); 146 void cancelRelease(); 147 void releasePageCache(); 144 void scheduleCachedPageForRelease(); 148 145 149 146 #ifndef NDEBUG … … 154 151 private: 155 152 HistoryItem(const HistoryItem&); 156 static void release PageCachesOrReschedule();153 static void releaseCachedPagesOrReschedule(); 157 154 158 155 String m_urlString; … … 169 166 170 167 HistoryItemVector m_subItems; 171 bool m_pageCacheIsPendingRelease;172 RefPtr< PageCache> m_pageCache;168 169 RefPtr<CachedPage> m_cachedPage; 173 170 174 171 bool m_isTargetItem; 175 bool m_alwaysAttemptToUse PageCache;172 bool m_alwaysAttemptToUseCachedPage; 176 173 int m_visitCount; 177 174 -
trunk/WebCore/history/HistoryItemTimer.cpp
r18588 r20837 34 34 35 35 HistoryItemTimer::HistoryItemTimer() 36 : m_timer(this, &HistoryItemTimer::callRelease PageCachesOrReschedule)36 : m_timer(this, &HistoryItemTimer::callReleaseCachedPagesOrReschedule) 37 37 { 38 38 } … … 53 53 } 54 54 55 void HistoryItemTimer::callRelease PageCachesOrReschedule(Timer<HistoryItemTimer>*)55 void HistoryItemTimer::callReleaseCachedPagesOrReschedule(Timer<HistoryItemTimer>*) 56 56 { 57 HistoryItem::release PageCachesOrReschedule();57 HistoryItem::releaseCachedPagesOrReschedule(); 58 58 } 59 59 -
trunk/WebCore/history/HistoryItemTimer.h
r18874 r20837 42 42 43 43 private: 44 void callRelease PageCachesOrReschedule(Timer<HistoryItemTimer>*);44 void callReleaseCachedPagesOrReschedule(Timer<HistoryItemTimer>*); 45 45 Timer<HistoryItemTimer> m_timer; 46 46 }; -
trunk/WebCore/history/mac/CachedPageMac.mm
r20836 r20837 25 25 26 26 #include "config.h" 27 #include " PageCache.h"27 #include "CachedPage.h" 28 28 29 29 #import <objc/objc-runtime.h> … … 31 31 namespace WebCore { 32 32 33 void PageCache::close()33 void CachedPage::close() 34 34 { 35 if (!m_ pageState)35 if (!m_document) 36 36 return; 37 37 38 38 // FIXME: <rdar://problem/4886844> 39 39 // The current method of tracking the "document view" is messy and quite platform specific … … 42 42 objc_msgSend(m_documentView.get(), @selector(closeIfNotCurrentView)); 43 43 44 m_pageState->clear(); 45 46 // Setting these to null is how the PageCache object knows it's been closed 47 m_pageState = 0; 48 m_documentLoader = 0; 44 clear(); 49 45 } 50 46 51 void PageCache::setDocumentView(id documentView)47 void CachedPage::setDocumentView(id documentView) 52 48 { 53 49 m_documentView = documentView; 54 50 } 55 51 56 id PageCache::documentView()52 id CachedPage::documentView() 57 53 { 58 54 return m_documentView.get(); -
trunk/WebCore/history/mac/HistoryItemMac.mm
r18541 r20837 26 26 #include "config.h" 27 27 #include "HistoryItem.h" 28 29 #include "PageCache.h"30 28 31 29 namespace WebCore { -
trunk/WebCore/loader/DocumentLoader.cpp
r20135 r20837 30 30 #include "DocumentLoader.h" 31 31 32 #include "CachedPage.h" 32 33 #include "Document.h" 33 34 #include "Event.h" … … 35 36 #include "FrameLoader.h" 36 37 #include "HistoryItem.h" 38 #include "Logging.h" 37 39 #include "MainResourceLoader.h" 38 #include "PageCache.h"39 40 #include "PlatformString.h" 40 41 #include "SharedBuffer.h" … … 132 133 , m_primaryLoadComplete(false) 133 134 , m_isClientRedirect(false) 134 , m_loadingFrom PageCache(false)135 , m_loadingFromCachedPage(false) 135 136 , m_stopRecordingResponses(false) 136 137 { … … 542 543 } 543 544 544 void DocumentLoader::loadFromPageCache(PassRefPtr<PageCache> pageCache) 545 { 545 void DocumentLoader::loadFromCachedPage(PassRefPtr<CachedPage> cachedPage) 546 { 547 LOG(PageCache, "WebCorePageCache: DocumentLoader %p loading from cached page %p", this, cachedPage.get()); 548 546 549 prepareForLoadStart(); 547 setLoadingFrom PageCache(true);550 setLoadingFromCachedPage(true); 548 551 setCommitted(true); 549 frameLoader()->commitProvisionalLoad( pageCache);552 frameLoader()->commitProvisionalLoad(cachedPage); 550 553 } 551 554 … … 555 558 } 556 559 557 void DocumentLoader::setLoadingFrom PageCache(bool loading)558 { 559 m_loadingFrom PageCache = loading;560 } 561 562 bool DocumentLoader::isLoadingFrom PageCache() const563 { 564 return m_loadingFrom PageCache;560 void DocumentLoader::setLoadingFromCachedPage(bool loading) 561 { 562 m_loadingFromCachedPage = loading; 563 } 564 565 bool DocumentLoader::isLoadingFromCachedPage() const 566 { 567 return m_loadingFromCachedPage; 565 568 } 566 569 -
trunk/WebCore/loader/DocumentLoader.h
r19737 r20837 43 43 namespace WebCore { 44 44 45 class CachedPage; 45 46 class Frame; 46 47 class FrameLoader; … … 48 49 class KURL; 49 50 class MainResourceLoader; 50 class PageCache;51 51 class ResourceLoader; 52 52 class SharedBuffer; … … 127 127 KURL urlForHistory() const; 128 128 129 void loadFrom PageCache(PassRefPtr<PageCache>);130 void setLoadingFrom PageCache(bool);131 bool isLoadingFrom PageCache() const;129 void loadFromCachedPage(PassRefPtr<CachedPage>); 130 void setLoadingFromCachedPage(bool); 131 bool isLoadingFromCachedPage() const; 132 132 133 133 void setDefersLoading(bool); … … 193 193 bool m_primaryLoadComplete; 194 194 bool m_isClientRedirect; 195 bool m_loadingFrom PageCache;195 bool m_loadingFromCachedPage; 196 196 197 197 String m_pageTitle; -
trunk/WebCore/loader/FrameLoader.cpp
r20813 r20837 32 32 33 33 #include "Cache.h" 34 #include "CachedPage.h" 34 35 #include "Chrome.h" 35 36 #include "CString.h" … … 63 64 #include "MainResourceLoader.h" 64 65 #include "Page.h" 65 #include "PageCache.h"66 #include "PageState.h"67 66 #include "ProgressTracker.h" 68 67 #include "RenderPart.h" … … 1488 1487 && !documentLoader()->isStopping()) { 1489 1488 if (m_client->canCachePage()) { 1490 if (!m_currentHistoryItem-> pageCache()) {1489 if (!m_currentHistoryItem->cachedPage()) { 1491 1490 // Add the items to this page's cache. 1492 if (createPageCache(m_currentHistoryItem.get())) { 1493 // See if any page caches need to be purged after the addition of this new page cache. 1491 if (cachePageToHistoryItem(m_currentHistoryItem.get())) { 1492 LOG(PageCache, "WebCorePageCache: CachedPage %p created for HistoryItem %p (%s)", m_currentHistoryItem->cachedPage(), m_currentHistoryItem.get(), 1493 m_currentHistoryItem->urlString().ascii().data()); 1494 1495 // See if any cached pages need to be purged after the addition of this new cached page. 1494 1496 purgePageCache(); 1495 1497 } … … 2278 2280 } 2279 2281 2280 void FrameLoader::commitProvisionalLoad(PassRefPtr< PageCache> prpPageCache)2281 { 2282 RefPtr< PageCache> pageCache = prpPageCache;2282 void FrameLoader::commitProvisionalLoad(PassRefPtr<CachedPage> prpCachedPage) 2283 { 2284 RefPtr<CachedPage> cachedPage = prpCachedPage; 2283 2285 RefPtr<DocumentLoader> pdl = m_provisionalDocumentLoader; 2284 2286 … … 2286 2288 closeOldDataSources(); 2287 2289 2288 if (! pageCache)2290 if (!cachedPage) 2289 2291 m_client->makeRepresentation(pdl.get()); 2290 2292 2291 transitionToCommitted( pageCache);2293 transitionToCommitted(cachedPage); 2292 2294 2293 2295 // Call -_clientRedirectCancelledOrFinished: here so that the frame load delegate is notified that the redirect's … … 2298 2300 clientRedirectCancelledOrFinished(false); 2299 2301 2300 RefPtr<PageState> pageState; 2301 if (pageCache) 2302 pageState = pageCache->pageState(); 2303 if (pageState) { 2304 open(*pageState); 2305 pageState->clear(); 2302 if (cachedPage && cachedPage->document()) { 2303 open(*cachedPage); 2304 cachedPage->clear(); 2306 2305 } else { 2307 2306 KURL url = pdl->URL(); … … 2316 2315 } 2317 2316 2318 void FrameLoader::transitionToCommitted(PassRefPtr< PageCache> pageCache)2317 void FrameLoader::transitionToCommitted(PassRefPtr<CachedPage> cachedPage) 2319 2318 { 2320 2319 ASSERT(m_client->hasWebView()); … … 2349 2348 2350 2349 // Create a document view for this document, or used the cached view. 2351 if ( pageCache)2352 m_client->setDocumentViewFrom PageCache(pageCache.get());2350 if (cachedPage) 2351 m_client->setDocumentViewFromCachedPage(cachedPage.get()); 2353 2352 else 2354 2353 m_client->makeDocumentView(); … … 2451 2450 } 2452 2451 2453 void FrameLoader::open( PageState& state)2452 void FrameLoader::open(CachedPage& cachedPage) 2454 2453 { 2455 2454 ASSERT(m_frame->page()->mainFrame() == m_frame); … … 2471 2470 } 2472 2471 2473 KURL URL = state.URL();2472 KURL URL = cachedPage.URL(); 2474 2473 2475 2474 if (URL.protocol().startsWith("http") && !URL.host().isEmpty() && URL.path().isEmpty()) … … 2483 2482 clear(); 2484 2483 2485 Document* document = state.document();2484 Document* document = cachedPage.document(); 2486 2485 ASSERT(document); 2487 2486 document->setInPageCache(false); … … 2499 2498 updatePolicyBaseURL(); 2500 2499 2501 state.restore(m_frame->page());2500 cachedPage.restore(m_frame->page()); 2502 2501 2503 2502 checkCompleted(); … … 3048 3047 return; 3049 3048 3050 m_provisionalDocumentLoader->setLoadingFrom PageCache(false);3049 m_provisionalDocumentLoader->setLoadingFromCachedPage(false); 3051 3050 3052 3051 unsigned long identifier = m_frame->page()->progress()->createUniqueIdentifier(); … … 3122 3121 if (document) 3123 3122 document->setInPageCache(false); 3124 invalidateCurrentItem PageCache();3123 invalidateCurrentItemCachedPage(); 3125 3124 3126 3125 // Call clientRedirectCancelledOrFinished here so that the frame load delegate is notified that the redirect's … … 3187 3186 updateHistoryForClientRedirect(); 3188 3187 3189 if (m_documentLoader->isLoadingFrom PageCache()) {3188 if (m_documentLoader->isLoadingFromCachedPage()) { 3190 3189 // Force a layout to update view size and thereby update scrollbars. 3191 3190 m_client->forceLayout(); … … 3203 3202 } 3204 3203 3205 m_client->loadedFrom PageCache();3204 m_client->loadedFromCachedPage(); 3206 3205 3207 3206 m_documentLoader->setPrimaryLoadComplete(true); … … 3352 3351 setPolicyDocumentLoader(0); 3353 3352 3354 if (isBackForwardLoadType(type) && loadProvisionalItemFrom PageCache())3353 if (isBackForwardLoadType(type) && loadProvisionalItemFromCachedPage()) 3355 3354 return; 3356 3355 … … 3480 3479 } 3481 3480 3482 bool FrameLoader::loadProvisionalItemFrom PageCache()3483 { 3484 if (!m_provisionalHistoryItem || !m_provisionalHistoryItem-> hasPageCache())3481 bool FrameLoader::loadProvisionalItemFromCachedPage() 3482 { 3483 if (!m_provisionalHistoryItem || !m_provisionalHistoryItem->cachedPage()) 3485 3484 return false; 3486 3485 3487 RefPtr<PageState> state = m_provisionalHistoryItem->pageCache()->pageState(); 3488 if (!state) 3486 if (!m_provisionalHistoryItem->cachedPage()->document()) 3489 3487 return false; 3490 3488 3491 provisionalDocumentLoader()->loadFrom PageCache(m_provisionalHistoryItem->pageCache());3489 provisionalDocumentLoader()->loadFromCachedPage(m_provisionalHistoryItem->cachedPage()); 3492 3490 return true; 3493 3491 } 3494 3492 3495 bool FrameLoader::c reatePageCache(HistoryItem* item)3496 { 3497 RefPtr< PageState> pageState = PageState::create(m_frame->page());3498 3499 if (! pageState) {3500 item->set HasPageCache(false);3493 bool FrameLoader::cachePageToHistoryItem(HistoryItem* item) 3494 { 3495 RefPtr<CachedPage> cachedPage = CachedPage::create(m_frame->page()); 3496 3497 if (!cachedPage) { 3498 item->setCachedPage(0); 3501 3499 return false; 3502 3500 } 3503 3501 3504 item->setHasPageCache(true); 3505 RefPtr<PageCache> pageCache = item->pageCache(); 3506 3507 pageCache->setPageState(pageState.release()); 3508 pageCache->setTimeStampToNow(); 3509 pageCache->setDocumentLoader(documentLoader()); 3510 m_client->saveDocumentViewToPageCache(pageCache.get()); 3502 item->setCachedPage(cachedPage); 3503 3504 cachedPage->setTimeStampToNow(); 3505 cachedPage->setDocumentLoader(documentLoader()); 3506 m_client->saveDocumentViewToCachedPage(cachedPage.get()); 3511 3507 3512 3508 return true; … … 3540 3536 } 3541 3537 3542 LOG (History, "WebCoreHistory -Creating item for %s", url.url().ascii());3538 LOG (History, "WebCoreHistory: Creating item for %s", url.url().ascii()); 3543 3539 3544 3540 // Frames that have never successfully loaded any content … … 3657 3653 3658 3654 for (; i < items.size(); ++i) { 3659 if (items[i]-> hasPageCache()) {3660 if (!oldestNonSnapbackItem && !items[i]->alwaysAttemptToUse PageCache())3655 if (items[i]->cachedPage()) { 3656 if (!oldestNonSnapbackItem && !items[i]->alwaysAttemptToUseCachedPage()) 3661 3657 oldestNonSnapbackItem = items[i]; 3662 3658 pagesCached++; … … 3667 3663 if (pagesCached >= sizeLimit && oldestNonSnapbackItem) { 3668 3664 LOG(PageCache, "Purging back/forward cache, %s\n", oldestNonSnapbackItem->url().url().ascii()); 3669 oldestNonSnapbackItem->set HasPageCache(false);3670 } 3671 } 3672 3673 void FrameLoader::invalidateCurrentItem PageCache()3665 oldestNonSnapbackItem->setCachedPage(0); 3666 } 3667 } 3668 3669 void FrameLoader::invalidateCurrentItemCachedPage() 3674 3670 { 3675 3671 // When we are pre-commit, the currentItem is where the pageCache data resides 3676 PageCache* pageCache = m_currentHistoryItem ? m_currentHistoryItem->pageCache() : 0; 3677 PageState* pageState = pageCache ? pageCache->pageState() : 0; 3672 CachedPage* cachedPage = m_currentHistoryItem ? m_currentHistoryItem->cachedPage() : 0; 3678 3673 3679 3674 // FIXME: This is a grotesque hack to fix <rdar://problem/4059059> Crash in RenderFlow::detach … … 3681 3676 // Both Xcode and FileMaker see this crash, Safari does not. 3682 3677 3683 ASSERT(! pageState || pageState->document() == m_frame->document());3684 if ( pageState && pageState->document() == m_frame->document())3685 pageState->clear();3678 ASSERT(!cachedPage || cachedPage->document() == m_frame->document()); 3679 if (cachedPage && cachedPage->document() == m_frame->document()) 3680 cachedPage->clear(); 3686 3681 3687 3682 if (m_currentHistoryItem) 3688 m_currentHistoryItem->set HasPageCache(false);3683 m_currentHistoryItem->setCachedPage(0); 3689 3684 } 3690 3685 … … 3774 3769 // if one exists and it is less than _backForwardCacheExpirationInterval 3775 3770 // seconds old. If the cache is expired it gets flushed here. 3776 if (item-> hasPageCache()) {3777 RefPtr< PageCache> pageCache = item->pageCache();3778 double interval = currentTime() - pageCache->timeStamp();3771 if (item->cachedPage()) { 3772 RefPtr<CachedPage> cachedPage = item->cachedPage(); 3773 double interval = currentTime() - cachedPage->timeStamp(); 3779 3774 3780 3775 // FIXME: 1800 is the current backforwardcache expiration time, but we actually store as a pref - … … 3782 3777 //if (interval <= [[getWebView(self) preferences] _backForwardCacheExpirationInterval]) { 3783 3778 if (interval <= 1800) { 3784 load( pageCache->documentLoader(), loadType, 0);3779 load(cachedPage->documentLoader(), loadType, 0); 3785 3780 inPageCache = true; 3786 3781 } else { 3787 3782 LOG (PageCache, "Not restoring page for %s from back/forward cache because cache entry has expired", m_provisionalHistoryItem->url().url().ascii()); 3788 item->set HasPageCache(false);3783 item->setCachedPage(0); 3789 3784 } 3790 3785 } … … 3962 3957 void FrameLoader::updateHistoryForStandardLoad() 3963 3958 { 3964 LOG(History, "WebCoreHistory -Updating History for Standard Load in frame %s", documentLoader()->URL().url().ascii());3959 LOG(History, "WebCoreHistory: Updating History for Standard Load in frame %s", documentLoader()->URL().url().ascii()); 3965 3960 3966 3961 if (!documentLoader()->isClientRedirect()) { … … 3983 3978 #if !LOG_DISABLED 3984 3979 if (documentLoader()) 3985 LOG(History, "WebCoreHistory -Updating History for client redirect in frame %s", documentLoader()->title().utf8().data());3980 LOG(History, "WebCoreHistory: Updating History for client redirect in frame %s", documentLoader()->title().utf8().data()); 3986 3981 #endif 3987 3982 … … 3998 3993 #if !LOG_DISABLED 3999 3994 if (documentLoader()) 4000 LOG(History, "WebCoreHistory -Updating History for back/forward navigation in frame %s", documentLoader()->title().utf8().data());3995 LOG(History, "WebCoreHistory: Updating History for back/forward navigation in frame %s", documentLoader()->title().utf8().data()); 4001 3996 #endif 4002 3997 … … 4009 4004 #if !LOG_DISABLED 4010 4005 if (documentLoader()) 4011 LOG(History, "WebCoreHistory -Updating History for reload in frame %s", documentLoader()->title().utf8().data());4006 LOG(History, "WebCoreHistory: Updating History for reload in frame %s", documentLoader()->title().utf8().data()); 4012 4007 #endif 4013 4008 4014 4009 if (m_previousHistoryItem) { 4015 m_previousHistoryItem->set HasPageCache(false);4010 m_previousHistoryItem->setCachedPage(0); 4016 4011 4017 4012 if (loadType() == FrameLoadTypeReload) … … 4032 4027 #if !LOG_DISABLED 4033 4028 if (documentLoader()) 4034 LOG(History, "WebCoreHistory -Updating History for internal load in frame %s", documentLoader()->title().utf8().data());4029 LOG(History, "WebCoreHistory: Updating History for internal load in frame %s", documentLoader()->title().utf8().data()); 4035 4030 #endif 4036 4031 … … 4060 4055 #if !LOG_DISABLED 4061 4056 if (documentLoader()) 4062 LOG(History, "WebCoreHistory -Updating History for commit in frame %s", documentLoader()->title().utf8().data());4057 LOG(History, "WebCoreHistory: Updating History for commit in frame %s", documentLoader()->title().utf8().data()); 4063 4058 #endif 4064 4059 FrameLoadType type = loadType(); -
trunk/WebCore/loader/FrameLoader.h
r20813 r20837 52 52 53 53 class AuthenticationChallenge; 54 class CachedPage; 54 55 class Document; 55 56 class DocumentLoader; … … 67 68 class Node; 68 69 class Page; 69 class PageCache;70 class PageState;71 70 class RenderPart; 72 71 class ResourceError; … … 395 394 bool shouldTreatURLAsSameAsCurrent(const KURL&) const; 396 395 397 void commitProvisionalLoad(PassRefPtr< PageCache>);396 void commitProvisionalLoad(PassRefPtr<CachedPage>); 398 397 399 398 void goToItem(HistoryItem*, FrameLoadType); … … 427 426 bool urlsMatchItem(HistoryItem*) const; 428 427 void purgePageCache(); 429 void invalidateCurrentItem PageCache();428 void invalidateCurrentItemCachedPage(); 430 429 void recursiveGoToItem(HistoryItem*, HistoryItem*, FrameLoadType); 431 430 bool childFramesMatchItem(HistoryItem*) const; … … 452 451 const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback); 453 452 454 bool loadProvisionalItemFrom PageCache();455 bool c reatePageCache(HistoryItem*);453 bool loadProvisionalItemFromCachedPage(); 454 bool cachePageToHistoryItem(HistoryItem*); 456 455 457 456 void emitLoadEvent(); … … 473 472 void markLoadComplete(); 474 473 void commitProvisionalLoad(); 475 void transitionToCommitted(PassRefPtr< PageCache>);474 void transitionToCommitted(PassRefPtr<CachedPage>); 476 475 void frameLoadCompleted(); 477 476 … … 511 510 512 511 void closeOldDataSources(); 513 void open( PageState&);512 void open(CachedPage&); 514 513 void opened(); 515 514 void updateHistoryAfterClientRedirect(); -
trunk/WebCore/loader/FrameLoaderClient.h
r20227 r20837 37 37 38 38 class AuthenticationChallenge; 39 class CachedPage; 39 40 class DocumentLoader; 40 41 class Element; … … 47 48 class KURL; 48 49 class NavigationAction; 49 class PageCache;50 50 class ResourceError; 51 51 class ResourceHandle; … … 72 72 virtual void makeDocumentView() = 0; 73 73 virtual void makeRepresentation(DocumentLoader*) = 0; 74 virtual void setDocumentViewFrom PageCache(PageCache*) = 0;74 virtual void setDocumentViewFromCachedPage(CachedPage*) = 0; 75 75 virtual void forceLayout() = 0; 76 76 virtual void forceLayoutForNonHTML() = 0; … … 82 82 virtual void detachedFromParent4() = 0; 83 83 84 virtual void loadedFrom PageCache() = 0;84 virtual void loadedFromCachedPage() = 0; 85 85 86 86 virtual void assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&) = 0; … … 184 184 virtual String userAgent(const KURL&) = 0; 185 185 186 virtual void saveDocumentViewTo PageCache(PageCache*) = 0;186 virtual void saveDocumentViewToCachedPage(CachedPage*) = 0; 187 187 virtual bool canCachePage() const = 0; 188 188 virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceResponse&) = 0; -
trunk/WebCore/page/mac/WebCoreFrameBridge.h
r20269 r20837 52 52 @protocol WebCoreRenderTreeCopier; 53 53 54 extern NSString *WebCorePageCacheStateKey;55 56 54 enum WebCoreDeviceType { 57 55 WebCoreDeviceScreen, -
trunk/WebCore/page/mac/WebCoreFrameBridge.mm
r20725 r20837 117 117 118 118 using KJS::Bindings::RootObject; 119 120 NSString *WebCorePageCacheStateKey = @"WebCorePageCacheState";121 119 122 120 static PassRefPtr<RootObject> createRootObject(void* nativeHandle) -
trunk/WebCore/platform/graphics/svg/SVGImage.cpp
r20182 r20837 27 27 #if ENABLE(SVG) 28 28 29 #include "CachedPage.h" 29 30 #include "DocumentLoader.h" 30 31 #include "FloatRect.h" … … 34 35 #include "GraphicsContext.h" 35 36 #include "Page.h" 36 #include "PageCache.h"37 37 #include "ResourceError.h" 38 38 #include "SVGDocument.h" -
trunk/WebCore/platform/graphics/svg/SVGImageEmptyClients.h
r20227 r20837 125 125 126 126 virtual bool provisionalItemIsTarget() const { return false; } 127 virtual bool loadProvisionalItemFrom PageCache() { return false; }128 virtual void invalidateCurrentItem PageCache() { }127 virtual bool loadProvisionalItemFromCachedPage() { return false; } 128 virtual void invalidateCurrentItemCachedPage() { } 129 129 130 130 virtual bool privateBrowsingEnabled() const { return false; } … … 150 150 virtual void detachedFromParent4() { } 151 151 152 virtual void loadedFrom PageCache() { }152 virtual void loadedFromCachedPage() { } 153 153 154 154 virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceResponse&) { } … … 193 193 194 194 virtual void dispatchDidLoadMainResource(DocumentLoader*) { } 195 virtual void clearLoadingFrom PageCache(DocumentLoader*) { }196 virtual bool isLoadingFrom PageCache(DocumentLoader*) { return 0; }195 virtual void clearLoadingFromCachedPage(DocumentLoader*) { } 196 virtual bool isLoadingFromCachedPage(DocumentLoader*) { return 0; } 197 197 virtual void revertToProvisionalState(DocumentLoader*) { } 198 198 virtual void setMainDocumentError(DocumentLoader*, const ResourceError&) { } … … 251 251 virtual String userAgent(const KURL&) { return ""; } 252 252 253 virtual void setDocumentViewFrom PageCache(PageCache*) { }253 virtual void setDocumentViewFromCachedPage(CachedPage*) { } 254 254 virtual void updateGlobalHistoryForStandardLoad(const KURL&) { } 255 255 virtual void updateGlobalHistoryForReload(const KURL&) { } 256 256 virtual bool shouldGoToHistoryItem(HistoryItem*) const { return false; } 257 257 virtual void saveViewStateToItem(HistoryItem*) { } 258 virtual void saveDocumentViewTo PageCache(PageCache*) { }258 virtual void saveDocumentViewToCachedPage(CachedPage*) { } 259 259 virtual bool canCachePage() const { return false; } 260 260 -
trunk/WebKit/ChangeLog
r20820 r20837 1 2007-04-10 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Darin 4 5 <rdar://problem/4887095> - PageCache and PageState should be combined 6 7 WebKit side of the change to reflect the new object name of CachedPage and new Client method names 8 9 * History/WebHistoryItem.mm: 10 (-[WebHistoryItem setAlwaysAttemptToUsePageCache:]): 11 (+[WebHistoryItem _releaseAllPendingPageCaches]): 12 (-[WebWindowWatcher windowWillClose:]): 13 14 * WebCoreSupport/WebFrameLoaderClient.h: 15 * WebCoreSupport/WebFrameLoaderClient.mm: 16 (WebFrameLoaderClient::setDocumentViewFromCachedPage): 17 (WebFrameLoaderClient::loadedFromCachedPage): 18 (WebFrameLoaderClient::saveDocumentViewToCachedPage): 19 1 20 2007-04-09 Geoffrey Garen <ggaren@apple.com> 2 21 -
trunk/WebKit/History/WebHistoryItem.mm
r19921 r20837 44 44 #import "WebPluginController.h" 45 45 #import <JavaScriptCore/Assertions.h> 46 #import <WebCore/CachedPage.h> 46 47 #import <WebCore/HistoryItem.h> 47 48 #import <WebCore/Image.h> 48 49 #import <WebCore/KURL.h> 49 #import <WebCore/PageState.h>50 50 #import <WebCore/PlatformString.h> 51 51 #import <WebCore/ThreadCheck.h> … … 464 464 - (void)setAlwaysAttemptToUsePageCache: (BOOL)flag 465 465 { 466 core(_private)->setAlwaysAttemptToUse PageCache(flag);466 core(_private)->setAlwaysAttemptToUseCachedPage(flag); 467 467 } 468 468 … … 500 500 + (void)_releaseAllPendingPageCaches 501 501 { 502 HistoryItem:: releaseAllPendingPageCaches();502 HistoryItem::performPendingReleaseOfCachedPages(); 503 503 } 504 504 … … 511 511 -(void)windowWillClose:(NSNotification *)notification 512 512 { 513 WebCoreHistoryItem:: releaseAllPendingPageCaches();513 WebCoreHistoryItem::performPendingReleaseOfCachedPages(); 514 514 } 515 515 @end -
trunk/WebKit/WebCoreSupport/WebFrameLoaderClient.h
r20476 r20837 40 40 namespace WebCore { 41 41 class AuthenticationChallenge; 42 class CachedPage; 42 43 class HistoryItem; 43 class PageCache;44 44 class String; 45 45 class ResourceLoader; … … 66 66 virtual void makeDocumentView(); 67 67 virtual void makeRepresentation(WebCore::DocumentLoader*); 68 virtual void setDocumentViewFrom PageCache(WebCore::PageCache*);68 virtual void setDocumentViewFromCachedPage(WebCore::CachedPage*); 69 69 virtual void forceLayout(); 70 70 virtual void forceLayoutForNonHTML(); … … 76 76 virtual void detachedFromParent4(); 77 77 78 virtual void loadedFrom PageCache();78 virtual void loadedFromCachedPage(); 79 79 80 80 virtual void download(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&); … … 204 204 NSDictionary *actionDictionary(const WebCore::NavigationAction&) const; 205 205 206 void saveDocumentViewTo PageCache(WebCore::PageCache* pageCache);206 void saveDocumentViewToCachedPage(WebCore::CachedPage* cachedPage); 207 207 208 208 virtual bool canCachePage() const; -
trunk/WebKit/WebCoreSupport/WebFrameLoaderClient.mm
r20388 r20837 69 69 #import <WebCore/AuthenticationMac.h> 70 70 #import <WebCore/BlockExceptions.h> 71 #import <WebCore/CachedPage.h> 71 72 #import <WebCore/Chrome.h> 72 73 #import <WebCore/Document.h> … … 85 86 #import <WebCore/MouseEvent.h> 86 87 #import <WebCore/Page.h> 87 #import <WebCore/PageCache.h>88 #import <WebCore/PageState.h>89 88 #import <WebCore/PlatformString.h> 90 89 #import <WebCore/ResourceError.h> … … 169 168 } 170 169 171 void WebFrameLoaderClient::setDocumentViewFrom PageCache(PageCache* pageCache)172 { 173 DocumentLoader* cachedDocumentLoader = pageCache->documentLoader();170 void WebFrameLoaderClient::setDocumentViewFromCachedPage(CachedPage* cachedPage) 171 { 172 DocumentLoader* cachedDocumentLoader = cachedPage->documentLoader(); 174 173 ASSERT(cachedDocumentLoader); 175 174 cachedDocumentLoader->setFrame(core(m_webFrame.get())); 176 NSView <WebDocumentView> *cachedView = pageCache->documentView();175 NSView <WebDocumentView> *cachedView = cachedPage->documentView(); 177 176 ASSERT(cachedView != nil); 178 177 [cachedView setDataSource:dataSource(cachedDocumentLoader)]; … … 226 225 } 227 226 228 void WebFrameLoaderClient::loadedFrom PageCache()227 void WebFrameLoaderClient::loadedFromCachedPage() 229 228 { 230 229 // Release the resources kept in the page cache. … … 232 231 // The WebCore side of the page cache will have already been invalidated by 233 232 // the bridge to prevent premature release. 234 core(m_webFrame.get())->loader()->currentHistoryItem()->set HasPageCache(false);233 core(m_webFrame.get())->loader()->currentHistoryItem()->setCachedPage(0); 235 234 } 236 235 … … 958 957 } 959 958 960 void WebFrameLoaderClient::saveDocumentViewTo PageCache(PageCache* pageCache)961 { 962 pageCache->setDocumentView([m_webFrame->_private->webFrameView documentView]);959 void WebFrameLoaderClient::saveDocumentViewToCachedPage(CachedPage* cachedPage) 960 { 961 cachedPage->setDocumentView([m_webFrame->_private->webFrameView documentView]); 963 962 } 964 963
Note: See TracChangeset
for help on using the changeset viewer.