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
+2007-12-12 Brady Eidson <beidson@apple.com>
+
+ 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):
+
2007-12-12 Dan Bernstein <mitz@apple.com>
Reviewed by Oliver Hunt.
_WebCoreShouldUseFontSmoothing
_WebCoreTextFloatWidth
__Z26ReportBlockedObjCExceptionP11NSException
-__ZN7WebCore10CachedPage12documentViewEv
__ZN7WebCore10CachedPage14documentLoaderEv
-__ZN7WebCore10CachedPage15setDocumentViewEP11objc_object
-__ZN7WebCore10CachedPageD1Ev
+__ZN7WebCore10CachedPage22cachedPagePlatformDataEv
+__ZN7WebCore10CachedPage25setCachedPagePlatformDataEPNS_22CachedPagePlatformDataE
__ZN7WebCore10EventNames10clickEventE
__ZN7WebCore10EventNames12keydownEventE
__ZN7WebCore10MouseEventC1ERKNS_12AtomicStringEbbPNS_9DOMWindowEiiiiibbbbtPNS_15EventTargetNodeEPNS_9ClipboardEb
515B039A0CD1642A00B7EA9C /* SQLStatement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 515B03980CD1642A00B7EA9C /* SQLStatement.cpp */; };
5160300B0CC4251200C8AC25 /* FileSystemPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5160300A0CC4251200C8AC25 /* FileSystemPOSIX.cpp */; };
5160306C0CC4362300C8AC25 /* FileSystemCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5160306B0CC4362300C8AC25 /* FileSystemCF.cpp */; };
- 5160F3BC0B0A99C900C1D2AF /* CachedPageMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5160F3BB0B0A99C900C1D2AF /* CachedPageMac.mm */; };
5160F4980B0AA75F00C1D2AF /* HistoryItemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */; };
516BB7930CE91E6800512F79 /* JSSVGPointListCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516BB7910CE91E6800512F79 /* JSSVGPointListCustom.cpp */; };
516BB7940CE91E6800512F79 /* JSTreeWalkerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */; };
51AA3F6F0BD5AA9E00892971 /* ResourceLoaderMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51AA3F6E0BD5AA9E00892971 /* ResourceLoaderMac.mm */; };
51C81B890C4422F70019ECE3 /* FTPDirectoryParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51C81B870C4422F70019ECE3 /* FTPDirectoryParser.cpp */; };
51C81B8A0C4422F70019ECE3 /* FTPDirectoryParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 51C81B880C4422F70019ECE3 /* FTPDirectoryParser.h */; };
+ 51CBFC990D10E483002DBF51 /* CachedPagePlatformData.h in Headers */ = {isa = PBXBuildFile; fileRef = 51CBFC980D10E483002DBF51 /* CachedPagePlatformData.h */; settings = {ATTRIBUTES = (Private, ); }; };
51DCE8020CAC9F1C00488358 /* JSSQLResultSetRowListCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51DCE8010CAC9F1C00488358 /* JSSQLResultSetRowListCustom.cpp */; };
51DF6D7E0B92A16D00C2DC85 /* ThreadCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = 51DF6D7D0B92A16D00C2DC85 /* ThreadCheck.h */; settings = {ATTRIBUTES = (Private, ); }; };
51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51DF6D7F0B92A18E00C2DC85 /* ThreadCheck.mm */; };
515B03980CD1642A00B7EA9C /* SQLStatement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLStatement.cpp; sourceTree = "<group>"; };
5160300A0CC4251200C8AC25 /* FileSystemPOSIX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystemPOSIX.cpp; sourceTree = "<group>"; };
5160306B0CC4362300C8AC25 /* FileSystemCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystemCF.cpp; sourceTree = "<group>"; };
- 5160F3BB0B0A99C900C1D2AF /* CachedPageMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CachedPageMac.mm; path = mac/CachedPageMac.mm; sourceTree = "<group>"; };
5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = HistoryItemMac.mm; path = mac/HistoryItemMac.mm; sourceTree = "<group>"; };
516BB7910CE91E6800512F79 /* JSSVGPointListCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGPointListCustom.cpp; sourceTree = "<group>"; };
516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTreeWalkerCustom.cpp; sourceTree = "<group>"; };
51AA3F6E0BD5AA9E00892971 /* ResourceLoaderMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ResourceLoaderMac.mm; sourceTree = "<group>"; };
51C81B870C4422F70019ECE3 /* FTPDirectoryParser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FTPDirectoryParser.cpp; sourceTree = "<group>"; };
51C81B880C4422F70019ECE3 /* FTPDirectoryParser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FTPDirectoryParser.h; sourceTree = "<group>"; };
+ 51CBFC980D10E483002DBF51 /* CachedPagePlatformData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedPagePlatformData.h; sourceTree = "<group>"; };
51DCE8010CAC9F1C00488358 /* JSSQLResultSetRowListCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLResultSetRowListCustom.cpp; sourceTree = "<group>"; };
51DF6D7D0B92A16D00C2DC85 /* ThreadCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadCheck.h; sourceTree = "<group>"; };
51DF6D7F0B92A18E00C2DC85 /* ThreadCheck.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ThreadCheck.mm; sourceTree = "<group>"; };
5160F4920B0AA71500C1D2AF /* mac */ = {
isa = PBXGroup;
children = (
- 5160F3BB0B0A99C900C1D2AF /* CachedPageMac.mm */,
5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */,
);
name = mac;
51741D0B0B07259A00ED442C /* BackForwardList.h */,
510184680B08602A004A825F /* CachedPage.cpp */,
510184670B08602A004A825F /* CachedPage.h */,
+ 51CBFC980D10E483002DBF51 /* CachedPagePlatformData.h */,
51741D0E0B07259A00ED442C /* HistoryItem.cpp */,
51741D0D0B07259A00ED442C /* HistoryItem.h */,
1477E7740BF4134A00152872 /* PageCache.cpp */,
BCB16C2D0979C3BD00467741 /* loader.h in Headers */,
93309DF8099E64920056E581 /* markup.h in Headers */,
93309E1E099E64920056E581 /* visible_units.h in Headers */,
+ 51CBFC990D10E483002DBF51 /* CachedPagePlatformData.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
BC64B4CB0CB4295D005F2B62 /* CachedFont.cpp in Sources */,
BCB16C1B0979C3BD00467741 /* CachedImage.cpp in Sources */,
5101846A0B08602A004A825F /* CachedPage.cpp in Sources */,
- 5160F3BC0B0A99C900C1D2AF /* CachedPageMac.mm in Sources */,
BCB16C1F0979C3BD00467741 /* CachedResource.cpp in Sources */,
BCB16C210979C3BD00467741 /* CachedResourceClientWalker.cpp in Sources */,
BCB16C230979C3BD00467741 /* CachedScript.cpp in Sources */,
#include "CachedPage.h"
#include "AnimationController.h"
+#include "CachedPagePlatformData.h"
#include "Document.h"
#include "Element.h"
#include "EventHandler.h"
--CachedPageCounter::count;
#endif
- close();
+ clear();
}
void CachedPage::restore(Page* page)
if (!m_document)
return;
+ if (m_cachedPagePlatformData)
+ m_cachedPagePlatformData->clear();
+
ASSERT(m_view);
ASSERT(m_document->frame() == m_view->frame());
m_locationProperties.clear();
m_windowBuiltins.clear();
m_pausedTimeouts.clear();
+ m_cachedPagePlatformData.clear();
gcController().garbageCollectSoon();
}
return m_timeStamp;
}
+void CachedPage::setCachedPagePlatformData(CachedPagePlatformData* data)
+{
+ m_cachedPagePlatformData.set(data);
+}
+
+CachedPagePlatformData* CachedPage::cachedPagePlatformData()
+{
+ return m_cachedPagePlatformData.get();
+}
+
} // namespace WebCore
}
namespace WebCore {
-
+
+ class CachedPagePlatformData;
class Document;
class FrameView;
class Node;
Node* mousePressNode() const { return m_mousePressNode.get(); }
const KURL& url() const { return m_URL; }
void restore(Page*);
-
- void close();
-
+
void setTimeStamp(double);
void setTimeStampToNow();
double timeStamp() const;
void setDocumentLoader(PassRefPtr<DocumentLoader>);
DocumentLoader* documentLoader();
-#if PLATFORM(MAC)
- void setDocumentView(id);
- id documentView();
-#endif
+ void setCachedPagePlatformData(CachedPagePlatformData*);
+ CachedPagePlatformData* cachedPagePlatformData();
private:
CachedPage(Page*);
RefPtr<DocumentLoader> m_documentLoader;
OwnPtr<KJS::SavedProperties> m_locationProperties;
OwnPtr<KJS::SavedBuiltins> m_windowBuiltins;
OwnPtr<KJS::PausedTimeouts> m_pausedTimeouts;
-
-#if PLATFORM(MAC)
- RetainPtr<id> m_documentView;
-#endif
-}; // class CachedPage
+ OwnPtr<CachedPagePlatformData> m_cachedPagePlatformData;
+};
} // namespace WebCore
--- /dev/null
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef CachedPagePlatformData_h
+#define CachedPagePlatformData_h
+
+namespace WebCore {
+
+// The purpose of this class is to give each platform a vessel to store platform data when a page
+// goes into the Back/Forward page cache, and perform some action with that data when the page comes out.
+// Each platform should subclass this class as neccessary
+
+class CachedPagePlatformData {
+public:
+ virtual ~CachedPagePlatformData() { }
+ virtual void clear() { }
+};
+
+} // namespace WebCore
+
+#endif // CachedPagePlatformData_h
CachedPageSet::iterator end = tmp.end();
for (CachedPageSet::iterator it = tmp.begin(); it != end; ++it)
- (*it)->close();
+ (*it)->clear();
// Now do the prune.
cache()->setPruneEnabled(true);
+++ /dev/null
-/*
- * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "CachedPage.h"
-
-#import <objc/objc-runtime.h>
-
-namespace WebCore {
-
-void CachedPage::close()
-{
- if (!m_document)
- return;
-
- // FIXME: <rdar://problem/4886844>
- // The current method of tracking the "document view" is messy and quite platform specific
- // Having a WebCore-way to track this would be great.
- if (m_documentView)
- objc_msgSend(m_documentView.get(), @selector(closeIfNotCurrentView));
-
- clear();
-}
-
-void CachedPage::setDocumentView(id documentView)
-{
- m_documentView = documentView;
-}
-
-id CachedPage::documentView()
-{
- return m_documentView.get();
-}
-
-} //namespace WebCore
-
updateHistoryForBackForwardNavigation();
// Create a document view for this document, or used the cached view.
- if (cachedPage)
- m_client->setDocumentViewFromCachedPage(cachedPage.get());
- else
- m_client->makeDocumentView();
+ if (cachedPage) {
+ DocumentLoader* cachedDocumentLoader = cachedPage->documentLoader();
+ ASSERT(cachedDocumentLoader);
+ cachedDocumentLoader->setFrame(m_frame);
+ m_client->transitionToCommittedFromCachedPage(cachedPage.get());
+
+ } else
+ m_client->transitionToCommittedForNewPage();
}
break;
case FrameLoadTypeSame:
case FrameLoadTypeReplace:
updateHistoryForReload();
- m_client->makeDocumentView();
+ m_client->transitionToCommittedForNewPage();
break;
// FIXME - just get rid of this case, and merge FrameLoadTypeReloadAllowingStaleData with the above case
case FrameLoadTypeReloadAllowingStaleData:
- m_client->makeDocumentView();
+ m_client->transitionToCommittedForNewPage();
break;
case FrameLoadTypeStandard:
if (m_frame->view())
m_frame->view()->suppressScrollbars(true);
#endif
- m_client->makeDocumentView();
+ m_client->transitionToCommittedForNewPage();
break;
case FrameLoadTypeRedirectWithLockedHistory:
updateHistoryForRedirectWithLockedHistory();
- m_client->makeDocumentView();
+ m_client->transitionToCommittedForNewPage();
break;
// FIXME Remove this check when dummy ds is removed (whatever "dummy ds" is).
RefPtr<CachedPage> cachedPage = CachedPage::create(page);
cachedPage->setTimeStampToNow();
cachedPage->setDocumentLoader(documentLoader());
- m_client->saveDocumentViewToCachedPage(cachedPage.get());
+ m_client->savePlatformDataToCachedPage(cachedPage.get());
pageCache()->add(item, cachedPage.release());
}
virtual bool hasHTMLView() const { return true; }
- virtual void makeDocumentView() = 0;
virtual void makeRepresentation(DocumentLoader*) = 0;
- virtual void setDocumentViewFromCachedPage(CachedPage*) = 0;
virtual void forceLayout() = 0;
virtual void forceLayoutForNonHTML() = 0;
virtual String userAgent(const KURL&) = 0;
- virtual void saveDocumentViewToCachedPage(CachedPage*) = 0;
+ virtual void savePlatformDataToCachedPage(CachedPage*) = 0;
+ virtual void transitionToCommittedFromCachedPage(CachedPage*) = 0;
+ virtual void transitionToCommittedForNewPage() = 0;
+
virtual bool canCachePage() const = 0;
virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&) = 0;
virtual bool hasWebView() const { return true; } // mainly for assertions
virtual bool hasFrameView() const { return true; } // ditto
- virtual void makeDocumentView() { }
virtual void makeRepresentation(DocumentLoader*) { }
virtual void forceLayout() { }
virtual void forceLayoutForNonHTML() { }
virtual void setTitle(const String& title, const KURL&) { }
virtual String userAgent(const KURL&) { return ""; }
-
- virtual void setDocumentViewFromCachedPage(CachedPage*) { }
+
+ virtual void savePlatformDataToCachedPage(CachedPage*) { }
+ virtual void transitionToCommittedFromCachedPage(CachedPage*) { }
+ virtual void transitionToCommittedForNewPage() { }
+
virtual void updateGlobalHistoryForStandardLoad(const KURL&) { }
virtual void updateGlobalHistoryForReload(const KURL&) { }
virtual bool shouldGoToHistoryItem(HistoryItem*) const { return false; }
virtual void saveViewStateToItem(HistoryItem*) { }
- virtual void saveDocumentViewToCachedPage(CachedPage*) { }
virtual bool canCachePage() const { return false; }
virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
+2007-12-12 Brady Eidson <beidson@apple.com>
+
+ 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
+
2007-12-12 Mark Rowe <mrowe@apple.com>
Reviewed by Dave Kilzer.
51AEDEF10CECF45700854328 /* WebDatabaseManagerInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 51AEDEF00CECF45700854328 /* WebDatabaseManagerInternal.h */; };
51B2A1000ADB15D0002A9BEE /* WebIconDatabaseDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B2A0FF0ADB15D0002A9BEE /* WebIconDatabaseDelegate.h */; };
51C714FB0B20F79F00E5E33C /* WebBackForwardListInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 51C714FA0B20F79F00E5E33C /* WebBackForwardListInternal.h */; };
+ 51CBFCAD0D10E6C5002DBF51 /* WebCachedPagePlatformData.h in Headers */ = {isa = PBXBuildFile; fileRef = 51CBFCAC0D10E6C5002DBF51 /* WebCachedPagePlatformData.h */; };
51FDC4D30B0AF5C100F84EB3 /* WebHistoryItemPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FDC4D20B0AF5C100F84EB3 /* WebHistoryItemPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
5241ADF50B1BC48A004012BD /* WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 5241ADF30B1BC48A004012BD /* WebCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
5241ADF60B1BC48A004012BD /* WebCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5241ADF40B1BC48A004012BD /* WebCache.mm */; };
51B2A0FF0ADB15D0002A9BEE /* WebIconDatabaseDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconDatabaseDelegate.h; sourceTree = "<group>"; };
51C16E4006138EB400A1657B /* npfunctions.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = npfunctions.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51C714FA0B20F79F00E5E33C /* WebBackForwardListInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebBackForwardListInternal.h; sourceTree = "<group>"; };
+ 51CBFCAC0D10E6C5002DBF51 /* WebCachedPagePlatformData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCachedPagePlatformData.h; sourceTree = "<group>"; };
51E94C3406C0321200A9B09E /* WebPDFView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPDFView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51E94C3506C0321200A9B09E /* WebPDFView.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPDFView.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51E94C6806C0347500A9B09E /* WebPDFRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPDFRepresentation.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F5B36B400281DE87018635CB /* WebCoreSupport */ = {
isa = PBXGroup;
children = (
- A70936AD0B5608DC00CDB48E /* WebDragClient.h */,
- A70936AE0B5608DC00CDB48E /* WebDragClient.mm */,
+ 51CBFCAC0D10E6C5002DBF51 /* WebCachedPagePlatformData.h */,
14D8252D0AF955090004F057 /* WebChromeClient.h */,
14D8252E0AF955090004F057 /* WebChromeClient.mm */,
065AD5A10B0C32C7005A2B1D /* WebContextMenuClient.h */,
065AD5A20B0C32C7005A2B1D /* WebContextMenuClient.mm */,
9305892A070868B300E79D96 /* WebDashboardRegion.h */,
+ A70936AD0B5608DC00CDB48E /* WebDragClient.h */,
+ A70936AE0B5608DC00CDB48E /* WebDragClient.mm */,
4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */,
4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */,
F5AFB45E02B94DC8018635CA /* WebFrameBridge.h */,
9398109B0824BF01008DF038 /* WebViewInternal.h in Headers */,
939810710824BF01008DF038 /* WebViewPrivate.h in Headers */,
939810970824BF01008DF038 /* npfunctions.h in Headers */,
+ 51CBFCAD0D10E6C5002DBF51 /* WebCachedPagePlatformData.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
+2007-12-12 Brady Eidson <beidson@apple.com>
+
+ 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:
+
2007-12-12 Alp Toker <alp@atoker.com>
Reviewed by Holger Freyther.
return item != 0;
}
-void FrameLoaderClient::makeDocumentView() { notImplemented(); }
void FrameLoaderClient::makeRepresentation(DocumentLoader*) { notImplemented(); }
void FrameLoaderClient::forceLayout() { notImplemented(); }
void FrameLoaderClient::forceLayoutForNonHTML() { notImplemented(); }
g_signal_emit_by_name(page, "title-changed", titleString.data(), urlString.data());
}
-void FrameLoaderClient::setDocumentViewFromCachedPage(WebCore::CachedPage*) { notImplemented(); }
void FrameLoaderClient::dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int lengthReceived) { notImplemented(); }
void FrameLoaderClient::dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier) { notImplemented(); }
void FrameLoaderClient::dispatchDidFailLoading(DocumentLoader*, unsigned long identifier, const ResourceError&) { notImplemented(); }
ResourceError FrameLoaderClient::fileDoesNotExistError(const ResourceResponse&) { notImplemented(); return ResourceError(); }
bool FrameLoaderClient::shouldFallBack(const ResourceError&) { notImplemented(); return false; }
bool FrameLoaderClient::willUseArchive(ResourceLoader*, const ResourceRequest&, const KURL& originalURL) const { notImplemented(); return false; }
-void FrameLoaderClient::saveDocumentViewToCachedPage(CachedPage*) { notImplemented(); }
bool FrameLoaderClient::canCachePage() const { notImplemented(); return false; }
Frame* FrameLoaderClient::dispatchCreatePage() { notImplemented(); return 0; }
void FrameLoaderClient::dispatchUnableToImplementPolicy(const ResourceError&) { notImplemented(); }
void FrameLoaderClient::updateGlobalHistoryForStandardLoad(const KURL&) { notImplemented(); }
void FrameLoaderClient::updateGlobalHistoryForReload(const KURL&) { notImplemented(); }
+void FrameLoaderClient::savePlatformDataToCachedPage(CachedPage*) { notImplemented(); }
+void FrameLoaderClient::transitionToCommittedFromCachedPage(CachedPage*) { notImplemented(); }
+void FrameLoaderClient::transitionToCommittedForNewPage() { notImplemented(); }
}
virtual bool hasWebView() const;
virtual bool hasFrameView() const;
- virtual void makeDocumentView();
virtual void makeRepresentation(WebCore::DocumentLoader*);
- virtual void setDocumentViewFromCachedPage(WebCore::CachedPage*);
virtual void forceLayout();
virtual void forceLayoutForNonHTML();
virtual WebCore::String userAgent(const WebCore::KURL&);
- virtual void saveDocumentViewToCachedPage(WebCore::CachedPage*);
+ virtual void savePlatformDataToCachedPage(WebCore::CachedPage*);
+ virtual void transitionToCommittedFromCachedPage(WebCore::CachedPage*);
+ virtual void transitionToCommittedForNewPage();
+
virtual bool canCachePage() const;
virtual void download(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&);
private:
+2007-12-12 Brady Eidson <beidson@apple.com>
+
+ 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):
+
2007-12-12 Mark Rowe <mrowe@apple.com>
Reviewed by Dave Kilzer.
--- /dev/null
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <objc/objc-runtime.h>
+#import <WebCore/CachedPagePlatformData.h>
+#import <wtf/RetainPtr.h>
+
+class WebCachedPagePlatformData : public WebCore::CachedPagePlatformData {
+public:
+ WebCachedPagePlatformData(id webDocumentView) : m_webDocumentView(webDocumentView) { }
+
+ virtual void clear() { objc_msgSend(m_webDocumentView.get(), @selector(closeIfNotCurrentView)); }
+
+ id webDocumentView() { return m_webDocumentView.get(); }
+private:
+ RetainPtr<id> m_webDocumentView;
+};
+
virtual bool hasWebView() const; // mainly for assertions
virtual bool hasFrameView() const; // ditto
- virtual void makeDocumentView();
virtual void makeRepresentation(WebCore::DocumentLoader*);
virtual bool hasHTMLView() const;
- virtual void setDocumentViewFromCachedPage(WebCore::CachedPage*);
virtual void forceLayout();
virtual void forceLayoutForNonHTML();
virtual void setDefersLoading(bool);
virtual WebCore::String userAgent(const WebCore::KURL&);
+
+ virtual void savePlatformDataToCachedPage(WebCore::CachedPage*);
+ virtual void transitionToCommittedFromCachedPage(WebCore::CachedPage*);
+ virtual void transitionToCommittedForNewPage();
virtual bool willUseArchive(WebCore::ResourceLoader*, const WebCore::ResourceRequest&, const WebCore::KURL& originalURL) const;
virtual bool isArchiveLoadPending(WebCore::ResourceLoader*) const;
RetainPtr<WebFramePolicyListener> setUpPolicyListener(WebCore::FramePolicyFunction);
NSDictionary *actionDictionary(const WebCore::NavigationAction&) const;
-
- void saveDocumentViewToCachedPage(WebCore::CachedPage* cachedPage);
virtual bool canCachePage() const;
#import "DOMElementInternal.h"
#import "WebBackForwardList.h"
+#import "WebCachedPagePlatformData.h"
#import "WebChromeClient.h"
#import "WebDataSourceInternal.h"
#import "WebPolicyDelegatePrivate.h"
return m_webFrame->_private->webFrameView != nil;
}
-void WebFrameLoaderClient::makeDocumentView()
-{
- WebFrameView *v = m_webFrame->_private->webFrameView;
- WebDataSource *ds = [m_webFrame.get() _dataSource];
-
- bool willProduceHTMLView = [[WebFrameView class] _viewClassForMIMEType:[ds _responseMIMEType]] == [WebHTMLView class];
- bool canSkipCreation = [m_webFrame.get() _frameLoader]->committingFirstRealLoad() && willProduceHTMLView;
- if (canSkipCreation) {
- [[v documentView] setDataSource:ds];
- return;
- }
-
- // Don't suppress scrollbars before the view creation if we're making the view for a non-HTML view.
- if (!willProduceHTMLView)
- [[v _scrollView] setScrollBarsSuppressed:NO repaintOnUnsuppress:NO];
-
- NSView <WebDocumentView> *documentView = [v _makeDocumentViewForDataSource:ds];
- if (!documentView)
- return;
-
- WebFrameBridge *bridge = m_webFrame->_private->bridge;
-
- // FIXME: We could save work and not do this for a top-level view that is not a WebHTMLView.
- [bridge createFrameViewWithNSView:documentView marginWidth:[v _marginWidth] marginHeight:[v _marginHeight]];
- [m_webFrame.get() _updateBackground];
- [bridge installInFrame:[v _scrollView]];
-
- // Call setDataSource on the document view after it has been placed in the view hierarchy.
- // This what we for the top-level view, so should do this for views in subframes as well.
- [documentView setDataSource:ds];
-}
void WebFrameLoaderClient::makeRepresentation(DocumentLoader* loader)
{
[dataSource(loader) _makeRepresentation];
}
-void WebFrameLoaderClient::setDocumentViewFromCachedPage(CachedPage* cachedPage)
-{
- DocumentLoader* cachedDocumentLoader = cachedPage->documentLoader();
- ASSERT(cachedDocumentLoader);
- cachedDocumentLoader->setFrame(core(m_webFrame.get()));
- NSView <WebDocumentView> *cachedView = cachedPage->documentView();
- ASSERT(cachedView != nil);
- [cachedView setDataSource:dataSource(cachedDocumentLoader)];
- [m_webFrame->_private->webFrameView _setDocumentView:cachedView];
-}
-
bool WebFrameLoaderClient::hasHTMLView() const
{
NSView <WebDocumentView> *view = [m_webFrame->_private->webFrameView documentView];
}
}
-void WebFrameLoaderClient::saveDocumentViewToCachedPage(CachedPage* cachedPage)
+void WebFrameLoaderClient::savePlatformDataToCachedPage(CachedPage* cachedPage)
{
- cachedPage->setDocumentView([m_webFrame->_private->webFrameView documentView]);
+ WebCachedPagePlatformData* webPlatformData = new WebCachedPagePlatformData([m_webFrame->_private->webFrameView documentView]);
+ cachedPage->setCachedPagePlatformData(webPlatformData);
+}
+
+void WebFrameLoaderClient::transitionToCommittedFromCachedPage(CachedPage* cachedPage)
+{
+ WebCachedPagePlatformData* platformData = reinterpret_cast<WebCachedPagePlatformData*>(cachedPage->cachedPagePlatformData());
+ NSView <WebDocumentView> *cachedView = platformData->webDocumentView();
+ ASSERT(cachedView != nil);
+ ASSERT(cachedPage->documentLoader());
+ [cachedView setDataSource:dataSource(cachedPage->documentLoader())];
+ [m_webFrame->_private->webFrameView _setDocumentView:cachedView];
+}
+
+void WebFrameLoaderClient::transitionToCommittedForNewPage()
+{
+ WebFrameView *v = m_webFrame->_private->webFrameView;
+ WebDataSource *ds = [m_webFrame.get() _dataSource];
+
+ bool willProduceHTMLView = [[WebFrameView class] _viewClassForMIMEType:[ds _responseMIMEType]] == [WebHTMLView class];
+ bool canSkipCreation = [m_webFrame.get() _frameLoader]->committingFirstRealLoad() && willProduceHTMLView;
+ if (canSkipCreation) {
+ [[v documentView] setDataSource:ds];
+ return;
+ }
+
+ // Don't suppress scrollbars before the view creation if we're making the view for a non-HTML view.
+ if (!willProduceHTMLView)
+ [[v _scrollView] setScrollBarsSuppressed:NO repaintOnUnsuppress:NO];
+
+ NSView <WebDocumentView> *documentView = [v _makeDocumentViewForDataSource:ds];
+ if (!documentView)
+ return;
+
+ WebFrameBridge *bridge = m_webFrame->_private->bridge;
+
+ // FIXME: We could save work and not do this for a top-level view that is not a WebHTMLView.
+ [bridge createFrameViewWithNSView:documentView marginWidth:[v _marginWidth] marginHeight:[v _marginHeight]];
+ [m_webFrame.get() _updateBackground];
+ [bridge installInFrame:[v _scrollView]];
+
+ // Call setDataSource on the document view after it has been placed in the view hierarchy.
+ // This what we for the top-level view, so should do this for views in subframes as well.
+ [documentView setDataSource:ds];
}
RetainPtr<WebFramePolicyListener> WebFrameLoaderClient::setUpPolicyListener(FramePolicyFunction function)
+2007-12-12 Brady Eidson <beidson@apple.com>
+
+ 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:
+
2007-12-12 Sam Weinig <sam@webkit.org>
Build fix.
notImplemented();
}
+void FrameLoaderClientQt::savePlatformDataToCachedPage(CachedPage*)
+{
+ notImplemented();
+}
-void FrameLoaderClientQt::makeDocumentView()
-{
+void FrameLoaderClientQt::transitionToCommittedFromCachedPage(CachedPage*)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientQt::transitionToCommittedForNewPage()
+{
// qDebug() << "FrameLoaderClientQt::makeDocumentView" << m_frame->document();
// if (!m_frame->document())
notImplemented();
}
-void FrameLoaderClientQt::setDocumentViewFromCachedPage(CachedPage*)
-{
- notImplemented();
-}
-
void FrameLoaderClientQt::updateGlobalHistoryForStandardLoad(const WebCore::KURL& url)
{
emit m_webFrame->page()->addToHistory(QUrl(url.prettyURL()));
notImplemented();
}
-void FrameLoaderClientQt::saveDocumentViewToCachedPage(CachedPage*)
-{
- notImplemented();
-}
-
bool FrameLoaderClientQt::canCachePage() const
{
// don't do any caching for now
return webFrame()->page()->chooseFile(webFrame(), oldFile);
}
+
}
#include "moc_FrameLoaderClientQt.cpp"
virtual bool loadProvisionalItemFromPageCache();
virtual void invalidateCurrentItemPageCache();
- virtual void makeDocumentView();
virtual void makeRepresentation(DocumentLoader*);
virtual void forceLayout();
virtual void forceLayoutForNonHTML();
virtual String userAgent(const WebCore::KURL&);
- virtual void setDocumentViewFromCachedPage(CachedPage*);
+ virtual void savePlatformDataToCachedPage(WebCore::CachedPage*);
+ virtual void transitionToCommittedFromCachedPage(WebCore::CachedPage*);
+ virtual void transitionToCommittedForNewPage();
+
virtual void updateGlobalHistoryForStandardLoad(const WebCore::KURL&);
virtual void updateGlobalHistoryForReload(const WebCore::KURL&);
virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const;
virtual void saveViewStateToItem(WebCore::HistoryItem*);
- virtual void saveDocumentViewToCachedPage(CachedPage*);
virtual bool canCachePage() const;
virtual void setMainDocumentError(WebCore::DocumentLoader*, const WebCore::ResourceError&);
+2007-12-12 Brady Eidson <beidson@apple.com>
+
+ 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:
+
2007-12-12 Steve Falkenburg <sfalken@apple.com>
Build fix.
--- /dev/null
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef WebCachedPagePlatformData_h
+#define WebCachedPagePlatformData_h
+
+#include "WebDataSource.h"
+
+#include <WebCore/CachedPagePlatformData.h>
+
+class WebCachedPagePlatformData : public WebCore::CachedPagePlatformData {
+public:
+ WebCachedPagePlatformData(IWebDataSource* webDataSource) : m_webDataSource(webDataSource) { }
+
+ IWebDataSource* webDataSource() { return m_webDataSource.get(); }
+
+private:
+ COMPtr<IWebDataSource> m_webDataSource;
+};
+
+#endif // CachedPagePlatformData_h
#include "IWebUIDelegatePrivate.h"
#include "MarshallingHelpers.h"
#include "WebActionPropertyBag.h"
+#include "WebCachedPagePlatformData.h"
#include "WebChromeClient.h"
#include "WebDocumentLoader.h"
#include "WebDownload.h"
return !!d->frameView();
}
-void WebFrame::makeDocumentView()
-{
- ASSERT(core(this));
-
- // On the mac, this is done in Frame::setView, but since we don't have separate
- // frame views, we'll just do it here instead.
- core(this)->loader()->resetMultipleFormSubmissionProtection();
-}
-
void WebFrame::makeRepresentation(DocumentLoader*)
{
notImplemented();
notImplemented();
}
-void WebFrame::loadedFromCachedPage()
-{
- notImplemented();
-}
-
void WebFrame::dispatchDidReceiveServerRedirectForProvisionalLoad()
{
COMPtr<IWebFrameLoadDelegate> frameLoadDelegate;
return d->webView->userAgentForKURL(url);
}
-void WebFrame::setDocumentViewFromCachedPage(CachedPage*)
+void WebFrame::savePlatformDataToCachedPage(CachedPage* cachedPage)
{
- notImplemented();
+ Frame* coreFrame = core(this);
+ if (!coreFrame)
+ return;
+
+ ASSERT(coreFrame->loader()->documentLoader() == cachedPage->documentLoader());
+
+ WebCachedPagePlatformData* webPlatformData = new WebCachedPagePlatformData(static_cast<IWebDataSource*>(getWebDataSource(coreFrame->loader()->documentLoader())));
+ cachedPage->setCachedPagePlatformData(webPlatformData);
+}
+
+void WebFrame::transitionToCommittedFromCachedPage(CachedPage*)
+{
+ transitionToCommittedForNewPage();
+}
+
+void WebFrame::transitionToCommittedForNewPage()
+{
+ ASSERT(core(this));
+
+ // On the mac, this is done in Frame::setView, but since we don't have separate
+ // frame views, we'll just do it here instead.
+ core(this)->loader()->resetMultipleFormSubmissionProtection();
}
void WebFrame::updateGlobalHistoryForStandardLoad(const KURL& url)
notImplemented();
}
-void WebFrame::saveDocumentViewToCachedPage(CachedPage*)
-{
- notImplemented();
-}
-
bool WebFrame::canCachePage() const
{
notImplemented();
virtual void frameLoaderDestroyed();
virtual bool hasWebView() const;
virtual bool hasFrameView() const;
- virtual void makeDocumentView();
virtual void makeRepresentation(WebCore::DocumentLoader*);
virtual void forceLayout();
virtual void forceLayoutForNonHTML();
virtual void detachedFromParent2();
virtual void detachedFromParent3();
virtual void detachedFromParent4();
- virtual void loadedFromCachedPage();
virtual void dispatchDidHandleOnloadEvents();
virtual void dispatchDidReceiveServerRedirectForProvisionalLoad();
virtual void dispatchDidCancelClientRedirect();
virtual void prepareForDataSourceReplacement();
virtual void setTitle(const WebCore::String& title, const WebCore::KURL&);
virtual WebCore::String userAgent(const WebCore::KURL&);
- virtual void setDocumentViewFromCachedPage(WebCore::CachedPage *);
+ virtual void savePlatformDataToCachedPage(WebCore::CachedPage*);
+ virtual void transitionToCommittedFromCachedPage(WebCore::CachedPage*);
+ virtual void transitionToCommittedForNewPage();
virtual void updateGlobalHistoryForStandardLoad(const WebCore::KURL &);
virtual void updateGlobalHistoryForReload(const WebCore::KURL &);
virtual bool shouldGoToHistoryItem(WebCore::HistoryItem *) const;
virtual void saveViewStateToItem(WebCore::HistoryItem *);
- virtual void saveDocumentViewToCachedPage(WebCore::CachedPage *);
virtual bool canCachePage(void) const;
virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
virtual void setMainDocumentError(WebCore::DocumentLoader*, const WebCore::ResourceError&);
RelativePath="..\WebCache.h"\r
>\r
</File>\r
+ <File\r
+ RelativePath="..\WebCachedPagePlatformData.h"\r
+ >\r
+ </File>\r
<File\r
RelativePath="..\WebChromeClient.h"\r
>\r
+2007-12-12 Brady Eidson <beidson@apple.com>
+
+ 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:
+
2007-12-12 Sam Weinig <sam@webkit.org>
Build fix.
return false;
}
-
-void FrameLoaderClientWx::makeDocumentView()
-{
- notImplemented();
-}
-
-
void FrameLoaderClientWx::makeRepresentation(DocumentLoader*)
{
notImplemented();
notImplemented();
}
-void FrameLoaderClientWx::setDocumentViewFromCachedPage(WebCore::CachedPage*)
-{
- notImplemented();
-}
-
void FrameLoaderClientWx::updateGlobalHistoryForStandardLoad(const WebCore::KURL&)
{
notImplemented();
notImplemented();
}
-void FrameLoaderClientWx::saveDocumentViewToCachedPage(WebCore::CachedPage*)
-{
- notImplemented();
-}
-
bool FrameLoaderClientWx::canCachePage() const
{
return false;
notImplemented();
}
+void FrameLoaderClientWx::savePlatformDataToCachedPage(CachedPage*)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::transitionToCommittedFromCachedPage(CachedPage*)
+{
+ notImplemented();
+}
+
+void FrameLoaderClientWx::transitionToCommittedForNewPage()
+{
+ notImplemented();
+}
+
}
virtual bool provisionalItemIsTarget() const;
- virtual void makeDocumentView();
virtual void makeRepresentation(DocumentLoader*);
virtual void forceLayout();
virtual void forceLayoutForNonHTML();
virtual String userAgent(const KURL&);
-
- virtual void setDocumentViewFromCachedPage(CachedPage*);
+ virtual void savePlatformDataToCachedPage(WebCore::CachedPage*);
+ virtual void transitionToCommittedFromCachedPage(WebCore::CachedPage*);
+ virtual void transitionToCommittedForNewPage();
+
virtual void updateGlobalHistoryForStandardLoad(const KURL&);
virtual void updateGlobalHistoryForReload(const KURL&);
virtual bool shouldGoToHistoryItem(HistoryItem*) const;
virtual void saveScrollPositionAndViewStateToItem(HistoryItem*);
- virtual void saveDocumentViewToCachedPage(CachedPage*);
virtual bool canCachePage() const;
virtual void setMainDocumentError(DocumentLoader*, const ResourceError&);