[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

darin at apple.com darin at apple.com
Wed Dec 22 15:06:15 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 3c320e401182a3e973320d3dbf1fa4547b9ef816
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 27 23:18:01 2010 +0000

    2010-10-26  Darin Adler  <darin at apple.com>
    
            Reviewed by Sam Weinig.
    
            WebKitTestRunner needs to support layoutTestController.dumpBackForwardList
            https://bugs.webkit.org/show_bug.cgi?id=42322
            rdar://problem/8193631
    
            WebKitTestRunner needs to support layoutTestController.clearBackForwardList
            https://bugs.webkit.org/show_bug.cgi?id=42333
            rdar://problem/8193643
    
            * History/WebBackForwardList.mm:
            (core): Return BackForwardListImpl.
            (kit): Take BackForwardListImpl.
            (-[WebBackForwardList initWithBackForwardList:]): Use BackForwardListImpl.
            (-[WebBackForwardList dealloc]): Ditto.
            (-[WebBackForwardList finalize]): Ditto.
            (-[WebBackForwardList description]): Ditto.
            (-[WebBackForwardList setPageCacheSize:]): Ditto.
            (-[WebBackForwardList pageCacheSize]): Ditto.
            * History/WebBackForwardListInternal.h: Ditto.
            * WebView/WebFrameView.mm:
            (-[WebFrameView keyDown:]): Ditto.
            * WebView/WebView.mm:
            (-[WebView initWithCoder:]): Ditto.
            (-[WebView encodeWithCoder:]): Ditto.
            (-[WebView backForwardList]): Ditto.
            (-[WebView setMaintainsBackForwardList:]): Ditto.
    2010-10-26  Darin Adler  <darin at apple.com>
    
            Reviewed by Sam Weinig.
    
            WebKitTestRunner needs to support layoutTestController.dumpBackForwardList
            https://bugs.webkit.org/show_bug.cgi?id=42322
            rdar://problem/8193631
    
            WebKitTestRunner needs to support layoutTestController.clearBackForwardList
            https://bugs.webkit.org/show_bug.cgi?id=42333
            rdar://problem/8193643
    
            * WebCore.exp.in: Updated exports.
    
            * history/BackForwardList.h: Added comments about future refactoring.
            Moved functions that are not called inside WebCore into a separate
            section, to be removed later. Added an isActive function to replace the
            use of enabled() and entries().
    
            * history/BackForwardListImpl.h: Removed isBackForwardListImpl.
            Marked virtual function overrides virtual explicitly, except for the
            ones that will be non-virtual once we make the changes above.
            Added the isActive function.
    
            * history/PageCache.cpp:
            (WebCore::logCanCachePageDecision): Use isActive.
            (WebCore::PageCache::canCache): Ditto.
    
            * loader/FrameLoader.cpp:
            (WebCore::FrameLoader::checkDidPerformFirstNavigation): Check
            using currentItem, backItem, and forwardItem instead of
            using entries.
    
            * page/Settings.cpp:
            (WebCore::Settings::setUsesPageCache): Loop through the back/forward
            list entries using backListCount and forwardListCount instead of
            using entries.
    2010-10-26  Darin Adler  <darin at apple.com>
    
            Reviewed by Sam Weinig.
    
            WebKitTestRunner needs to support layoutTestController.dumpBackForwardList
            https://bugs.webkit.org/show_bug.cgi?id=42322
            rdar://problem/8193631
    
            WebKitTestRunner needs to support layoutTestController.clearBackForwardList
            https://bugs.webkit.org/show_bug.cgi?id=42333
            rdar://problem/8193643
    
            * platform/mac-wk2/Skipped: Resorted some test lists. Removed the section
            listing all the tests that were blocked by dumpBackForwardList.
    2010-10-26  Darin Adler  <darin at apple.com>
    
            Reviewed by Sam Weinig.
    
            WebKitTestRunner needs to support layoutTestController.dumpBackForwardList
            https://bugs.webkit.org/show_bug.cgi?id=42322
            rdar://problem/8193631
    
            WebKitTestRunner needs to support layoutTestController.clearBackForwardList
            https://bugs.webkit.org/show_bug.cgi?id=42333
            rdar://problem/8193643
    
            * WebKitTestRunner/Configurations/InjectedBundle.xcconfig:
            Renamed the product to WebKitTestRunnerInjectedBundle to avoid
            name conflicts in the build directory.
    
            * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
            Added dumpBackForwardList and clearBackForwardList.
    
            * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
            (WTR::InjectedBundle::InjectedBundle): Removed initialization of m_mainPage.
            (WTR::InjectedBundle::didCreatePage): Removed unneeded underscore.
            (WTR::InjectedBundle::willDestroyPage): Ditto.
            (WTR::InjectedBundle::didReceiveMessage): Ditto.
            (WTR::InjectedBundle::initialize): Ditto.
            (WTR::InjectedBundle::didCreatePage): Changed code to use m_pages
            instead of m_mainPage and m_otherPages.
            (WTR::InjectedBundle::willDestroyPage): Ditto.
            (WTR::InjectedBundle::page): Ditto.
            (WTR::InjectedBundle::beginTesting): Ditto.
            (WTR::InjectedBundle::done): Ditto.
            (WTR::InjectedBundle::closeOtherPages): Ditto.
            (WTR::InjectedBundle::dumpBackForwardListsForAllPages): Added.
    
            * WebKitTestRunner/InjectedBundle/InjectedBundle.h: Changed
            page function to longer be inline, and pageCount function
            to use m_pages. Added dumpBackForwardListsForAllPages, and
            removed some underscores. Replaced m_mainPage and m_otherPageas
            with m_pages.
    
            * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
            (WTR::adoptWK): Added.
            (WTR::hasPrefix): Added.
            (WTR::InjectedBundlePage::reset): Added code to set up
            m_previousTestBackForwardListItem.
            (WTR::InjectedBundlePage::dump): Added code to call
            dumpBackForwardListsForAllPages.
            (WTR::compareByTargetName): Added.
            (WTR::dumpBackForwardListItem): Added.
            (WTR::InjectedBundlePage::dumpBackForwardList): Added.
    
            * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Added
            dumpBackForwardList and m_previousTestBackForwardListItem.
    
            * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
            (WTR::LayoutTestController::LayoutTestController): Initialize
            m_shouldDumpBackForwardListsForAllWindows to false.
            (WTR::LayoutTestController::clearBackForwardList): Added.
    
            * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
            Added dumpBackForwardList, clearBackForwardList,
            shouldDumpBackForwardListsForAllWindows, and
            m_shouldDumpBackForwardListsForAllWindows.
    
            * WebKitTestRunner/TestController.cpp:
            (WTR::TestController::initialize): Set up
            didReceiveSynchronousMessageFromInjectedBundle.
            (WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):
            Added.
            * WebKitTestRunner/TestController.h: Ditto.
    
            * WebKitTestRunner/TestInvocation.cpp:
            (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
            Added.
            * WebKitTestRunner/TestInvocation.h: Ditto.
    
            * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
            Renamed bundle to WebKitTestRunnerInjectedBundle (see above).
            * WebKitTestRunner/mac/TestControllerMac.mm:
            (WTR::TestController::initializeInjectedBundlePath): Ditto.
    2010-10-26  Darin Adler  <darin at apple.com>
    
            Reviewed by Sam Weinig.
    
            WebKitTestRunner needs to support layoutTestController.dumpBackForwardList
            https://bugs.webkit.org/show_bug.cgi?id=42322
            rdar://problem/8193631
    
            WebKitTestRunner needs to support layoutTestController.clearBackForwardList
            https://bugs.webkit.org/show_bug.cgi?id=42333
            rdar://problem/8193643
    
            * Shared/API/c/WKBase.h: Added WKBundleBackForwardListRef and
            WKBundleBackForwardListItemRef.
    
            * Shared/API/c/WKURL.cpp:
            (WKURLCopyString): Added.
            * Shared/API/c/WKURL.h: Added WKURLCopyString.
    
            * Shared/API/c/cf/WKURLCF.h: Fixed incorrect argument name.
    
            * Shared/APIObject.h: Added TypeBundleBackForwardList and
            TypeBundleBackForwardListItem.
    
            * Shared/ImmutableArray.h: Marked destructor virtual explicitly.
            * Shared/ImmutableDictionary.h: Ditto.
            * UIProcess/WebBackForwardListItem.h: Ditto.
            * UIProcess/WebContext.h: Ditto.
            * UIProcess/WebFrameProxy.h: Ditto.
            * UIProcess/WebNavigationData.h: Ditto.
            * UIProcess/WebPageNamespace.h: Ditto.
            * UIProcess/WebPreferences.h: Ditto.
            * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h: Ditto.
            * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h: Ditto.
            * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h: Ditto.
    
            * UIProcess/WebBackForwardList.cpp: Removed unneeded backListWithLimit
            and forwardListWithLimit functions.
            (WebKit::WebBackForwardList::clear): Added.
            * UIProcess/WebBackForwardList.h: Marked destructor virtual explicitly.
            Added clear, removed backListWithLimit and forwardListWithLimit functions.
    
            * UIProcess/WebPageProxy.cpp: Removed unneeded backForwardBackItem,
            backForwardCurrentItem, and backForwardForwardItem functions.
            (WebKit::WebPageProxy::backForwardClear): Added.
            * UIProcess/WebPageProxy.h: Ditto.
            * UIProcess/WebPageProxy.messages.in: Ditto.
    
            * WebKit2.pro: Added new files.
            * WebKit2.xcodeproj/project.pbxproj: Ditto.
            * win/WebKit2.vcproj: Ditto.
    
            * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h: Added
            WKBundleBackForwardListRef and WKBundleBackForwardListItemRef.
    
            * WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp:
            Started with a copy of from WebKit2/UIProcess/API/C/WKBackForwardList.cpp.
            * WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.h:
            Started with a copy of WebKit2/UIProcess/API/C/WKBackForwardList.h.
    
            * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
            Started with a copy of WebKit2/UIProcess/API/C/WKBackForwardListItem.cpp.
            * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h:
            Started with a copy of WebKit2/UIProcess/API/C/WKBackForwardListItem.h.
    
            * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
            (WKBundlePageGetBackForwardList): Added.
            * WebProcess/InjectedBundle/API/c/WKBundlePage.h: Ditto.
    
    
            * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp:
            Started with a copy of WebKit2/UIProcess/WebBackForwardList.cpp.
            * WebProcess/InjectedBundle/InjectedBundleBackForwardList.h:
            Started with a copy of WebKit2/UIProcess/WebBackForwardList.h.
    
            * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
            Started with a copy of WebKit2/UIProcess/WebBackForwardListItem.cpp.
            * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h:
            Started with a copy of WebKit2/UIProcess/WebBackForwardListItem.h.
    
            * WebProcess/WebPage/WebBackForwardListProxy.cpp: Removed
            many unneeded functions.
            (WebKit::WebBackForwardListProxy::WebBackForwardListProxy):
            Removed unneeded initialization of m_closed.
            (WebKit::WebBackForwardListProxy::addItem): Added a check for
            the case of a capacity of 0.
            (WebKit::WebBackForwardListProxy::goToItem): Added a check for
            when the proxy outlives its page.
            (WebKit::WebBackForwardListProxy::itemAtIndex): Ditto.
            (WebKit::WebBackForwardListProxy::backListCount): Ditto.
            (WebKit::WebBackForwardListProxy::forwardListCount): Ditto.
            (WebKit::WebBackForwardListProxy::close): Removed unneeded code
            setting m_closed.
            (WebKit::WebBackForwardListProxy::isActive): Added.
            (WebKit::WebBackForwardListProxy::clear): Added.
    
            * WebProcess/WebPage/WebBackForwardListProxy.h: Added clear,
            isActive, and detach functions. Removed many other unneeded
            function and data members.
    
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::~WebPage): Added call to detach on the
            back/forward list.
            (WebKit::WebPage::backForwardList): Added.
            * WebProcess/WebPage/WebPage.h: Added backForwardList function
            and m_backForwardList data member.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70723 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 7cbdd63..c70c633 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-10-26  Darin Adler  <darin at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        WebKitTestRunner needs to support layoutTestController.dumpBackForwardList
+        https://bugs.webkit.org/show_bug.cgi?id=42322
+        rdar://problem/8193631
+
+        WebKitTestRunner needs to support layoutTestController.clearBackForwardList
+        https://bugs.webkit.org/show_bug.cgi?id=42333
+        rdar://problem/8193643
+
+        * platform/mac-wk2/Skipped: Resorted some test lists. Removed the section
+        listing all the tests that were blocked by dumpBackForwardList.
+
 2010-10-27  Martin Robinson  <mrobinson at igalia.com>
 
         Rebaseline some GTK+ tests after r70688.
diff --git a/LayoutTests/platform/mac-wk2/Skipped b/LayoutTests/platform/mac-wk2/Skipped
index 8d6e085..7216e18 100644
--- a/LayoutTests/platform/mac-wk2/Skipped
+++ b/LayoutTests/platform/mac-wk2/Skipped
@@ -192,10 +192,10 @@ fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll.htm
 fast/dom/HTMLSelectElement/click-size-zero-no-crash.html
 fast/dom/HTMLTableColElement/resize-table-using-col-width.html
 fast/dom/Node/mutation-blur.html
-fast/dom/replaced-image-map.html
 fast/dom/Window/window-postmessage-clone-frames.html
 fast/dom/Window/window-postmessage-clone.html
 fast/dom/Window/window-xy-properties.html
+fast/dom/replaced-image-map.html
 fast/dynamic/hover-style-recalc-crash.html
 fast/dynamic/hovered-detach.html
 fast/dynamic/layer-hit-test-crash.html
@@ -421,6 +421,7 @@ fast/loader/document-with-fragment-url-2.html
 fast/loader/document-with-fragment-url-3.html
 fast/loader/document-with-fragment-url-4.html
 fast/loader/early-load-cancel.html
+fast/loader/fragment-after-redirect-gets-back-entry.html
 fast/loader/policy-delegate-action-hit-test-zoomed.html
 fast/loader/repeat-same-document-navigation.html
 fast/overflow/hit-test-overflow-controls.html
@@ -451,6 +452,9 @@ http/tests/local/send-sliced-dragged-file.html
 http/tests/misc/bubble-drag-events.html
 http/tests/misc/drag-over-iframe-invalid-source-crash.html
 http/tests/misc/isindex-with-no-form.html
+http/tests/navigation/document-location-click-timeout.html
+http/tests/navigation/document-location-click.html
+http/tests/navigation/document-location-mouseover.html
 http/tests/navigation/no-referrer-reset.html
 http/tests/navigation/no-referrer-same-window.html
 http/tests/navigation/no-referrer-subframe.html
@@ -495,11 +499,11 @@ scrollbars/scrollbar-miss-mousemove-disabled.html
 scrollbars/scrollbar-miss-mousemove.html
 scrollbars/scrollevent-iframe-no-scrolling-wheel.html
 storage/multiple-transactions-on-different-handles.html
+svg/animations/animVal-basics.html
 svg/animations/animate-color-transparent.html
 svg/animations/animate-gradient-transform.html
 svg/animations/animate-keySplines.html
 svg/animations/animate-points.html
-svg/animations/animVal-basics.html
 svg/custom/absolute-sized-content-with-resources.xhtml
 svg/custom/circle-move-invalidation.svg
 svg/custom/clip-path-child-changes.svg
@@ -744,6 +748,14 @@ svg/dynamic-updates/SVGImageElement-svgdom-preserveAspectRatio-prop.html
 svg/dynamic-updates/SVGImageElement-svgdom-width-prop.html
 svg/dynamic-updates/SVGImageElement-svgdom-x-prop.html
 svg/dynamic-updates/SVGImageElement-svgdom-y-prop.html
+svg/dynamic-updates/SVGLineElement-dom-x1-attr.html
+svg/dynamic-updates/SVGLineElement-dom-x2-attr.html
+svg/dynamic-updates/SVGLineElement-dom-y1-attr.html
+svg/dynamic-updates/SVGLineElement-dom-y2-attr.html
+svg/dynamic-updates/SVGLineElement-svgdom-x1-prop.html
+svg/dynamic-updates/SVGLineElement-svgdom-x2-prop.html
+svg/dynamic-updates/SVGLineElement-svgdom-y1-prop.html
+svg/dynamic-updates/SVGLineElement-svgdom-y2-prop.html
 svg/dynamic-updates/SVGLinearGradientElement-dom-gradientTransform-attr.html
 svg/dynamic-updates/SVGLinearGradientElement-dom-gradientUnits-attr.html
 svg/dynamic-updates/SVGLinearGradientElement-dom-x1-attr.html
@@ -756,14 +768,6 @@ svg/dynamic-updates/SVGLinearGradientElement-svgdom-x1-prop.html
 svg/dynamic-updates/SVGLinearGradientElement-svgdom-x2-prop.html
 svg/dynamic-updates/SVGLinearGradientElement-svgdom-y1-prop.html
 svg/dynamic-updates/SVGLinearGradientElement-svgdom-y2-prop.html
-svg/dynamic-updates/SVGLineElement-dom-x1-attr.html
-svg/dynamic-updates/SVGLineElement-dom-x2-attr.html
-svg/dynamic-updates/SVGLineElement-dom-y1-attr.html
-svg/dynamic-updates/SVGLineElement-dom-y2-attr.html
-svg/dynamic-updates/SVGLineElement-svgdom-x1-prop.html
-svg/dynamic-updates/SVGLineElement-svgdom-x2-prop.html
-svg/dynamic-updates/SVGLineElement-svgdom-y1-prop.html
-svg/dynamic-updates/SVGLineElement-svgdom-y2-prop.html
 svg/dynamic-updates/SVGMarkerElement-dom-markerHeight-attr.html
 svg/dynamic-updates/SVGMarkerElement-dom-markerUnits-attr.html
 svg/dynamic-updates/SVGMarkerElement-dom-markerWidth-attr.html
@@ -827,10 +831,10 @@ svg/dynamic-updates/SVGRectElement-svgdom-height-prop.html
 svg/dynamic-updates/SVGRectElement-svgdom-width-prop.html
 svg/dynamic-updates/SVGRectElement-svgdom-x-prop.html
 svg/dynamic-updates/SVGRectElement-svgdom-y-prop.html
+svg/dynamic-updates/SVGTRefElement-dom-href-attr.html
 svg/dynamic-updates/SVGTextElement-dom-transform-attr.html
 svg/dynamic-updates/SVGTextElement-svgdom-rotate-prop.html
 svg/dynamic-updates/SVGTextElement-svgdom-transform-prop.html
-svg/dynamic-updates/SVGTRefElement-dom-href-attr.html
 svg/filters/filter-width-update.svg
 svg/text/foreignObject-repaint.xml
 svg/text/select-textLength-spacing-squeeze-1.svg
@@ -1122,111 +1126,6 @@ http/tests/inspector-enabled
 http/tests/inspector
 inspector
 
-# WebKitTestRunner needs to support layoutTestController.dumpBackForwardList
-# <https://bugs.webkit.org/show_bug.cgi?id=42322>
-fast/loader/fragment-after-redirect-gets-back-entry.html
-fast/loader/frame-location-change-not-added-to-history.html
-fast/loader/frame-src-change-added-to-history.html
-fast/loader/frame-src-change-not-added-to-history.html
-fast/loader/stateobjects/pushstate-object-types.html
-fast/loader/subframe-navigate-during-main-frame-load.html
-http/tests/history/redirect-200-refresh-0-seconds.pl
-http/tests/history/redirect-200-refresh-2-seconds.pl
-http/tests/history/redirect-301.html
-http/tests/history/redirect-302.html
-http/tests/history/redirect-303.html
-http/tests/history/redirect-307.html
-http/tests/history/redirect-js-document-location-0-seconds.html
-http/tests/history/redirect-js-document-location-2-seconds.html
-http/tests/history/redirect-js-document-location-before-load.html
-http/tests/history/redirect-js-form-submit-0-seconds.html
-http/tests/history/redirect-js-form-submit-2-seconds.html
-http/tests/history/redirect-js-form-submit-before-load.html
-http/tests/history/redirect-js-location-0-seconds.html
-http/tests/history/redirect-js-location-2-seconds.html
-http/tests/history/redirect-js-location-assign-0-seconds.html
-http/tests/history/redirect-js-location-assign-2-seconds.html
-http/tests/history/redirect-js-location-assign-before-load.html
-http/tests/history/redirect-js-location-before-load.html
-http/tests/history/redirect-js-location-href-0-seconds.html
-http/tests/history/redirect-js-location-href-2-seconds.html
-http/tests/history/redirect-js-location-href-before-load.html
-http/tests/history/redirect-js-location-replace-0-seconds.html
-http/tests/history/redirect-js-location-replace-2-seconds.html
-http/tests/history/redirect-js-location-replace-before-load.html
-http/tests/history/redirect-meta-refresh-0-seconds.html
-http/tests/history/redirect-meta-refresh-2-seconds.html
-http/tests/incremental/frame-focus-before-load.html
-http/tests/navigation/anchor-basic.html
-http/tests/navigation/anchor-frames.html
-http/tests/navigation/anchor-goback.html
-http/tests/navigation/anchor-subframeload.html
-http/tests/navigation/back-to-slow-frame.html
-http/tests/navigation/document-location-click-timeout.html
-http/tests/navigation/document-location-click.html
-http/tests/navigation/document-location-mouseover.html
-http/tests/navigation/document-location-onload.html
-http/tests/navigation/document-location-script.html
-http/tests/navigation/dynamic-iframe-dynamic-form-back-entry.html
-http/tests/navigation/error404-basic.html
-http/tests/navigation/error404-frames.html
-http/tests/navigation/error404-goback.html
-http/tests/navigation/error404-subframeload.html
-http/tests/navigation/javascriptlink-basic.html
-http/tests/navigation/javascriptlink-frames.html
-http/tests/navigation/javascriptlink-goback.html
-http/tests/navigation/javascriptlink-subframeload.html
-http/tests/navigation/location-assign-adds-history-item.html
-http/tests/navigation/location-href-set-adds-history-item.html
-http/tests/navigation/location-replace-adds-history-item.html
-http/tests/navigation/location-set-adds-history-item.html
-http/tests/navigation/lockedhistory-iframe.html
-http/tests/navigation/metaredirect-basic.html
-http/tests/navigation/metaredirect-frames.html
-http/tests/navigation/metaredirect-goback.html
-http/tests/navigation/metaredirect-subframeload.html
-http/tests/navigation/multiple-back-forward-entries.html
-http/tests/navigation/new-window-redirect-history.html
-http/tests/navigation/onload-navigation-iframe-2.html
-http/tests/navigation/onload-navigation-iframe-timeout.html
-http/tests/navigation/onload-navigation-iframe.html
-http/tests/navigation/parsed-iframe-dynamic-form-back-entry.html
-http/tests/navigation/post-basic.html
-http/tests/navigation/post-frames.html
-http/tests/navigation/post-goback-same-url.html
-http/tests/navigation/post-goback1.html
-http/tests/navigation/post-goback2.html
-http/tests/navigation/postredirect-basic.html
-http/tests/navigation/postredirect-frames.html
-http/tests/navigation/postredirect-goback1.html
-http/tests/navigation/postredirect-goback2.html
-http/tests/navigation/postredirect-reload.html
-http/tests/navigation/redirect-load-no-form-restoration.html
-http/tests/navigation/redirect302-basic.html
-http/tests/navigation/redirect302-frames.html
-http/tests/navigation/redirect302-goback.html
-http/tests/navigation/redirect302-metaredirect.html
-http/tests/navigation/redirect302-subframeload.html
-http/tests/navigation/relativeanchor-basic.html
-http/tests/navigation/relativeanchor-frames.html
-http/tests/navigation/relativeanchor-goback.html
-http/tests/navigation/restore-form-state-https.html
-http/tests/navigation/slowmetaredirect-basic.html
-http/tests/navigation/slowtimerredirect-basic.html
-http/tests/navigation/success200-basic.html
-http/tests/navigation/success200-frames-loadsame.html
-http/tests/navigation/success200-frames.html
-http/tests/navigation/success200-goback.html
-http/tests/navigation/success200-loadsame.html
-http/tests/navigation/success200-reload.html
-http/tests/navigation/success200-subframeload.html
-http/tests/navigation/timerredirect-basic.html
-http/tests/navigation/timerredirect-frames.html
-http/tests/navigation/timerredirect-goback.html
-http/tests/navigation/timerredirect-subframeload.html
-http/tests/navigation/window-open-adds-history-item.html
-http/tests/navigation/window-open-adds-history-item2.html
-
 # WebKitTestRunner needs to support layoutTestController.dumpDOMAsWebArchive
 # <https://bugs.webkit.org/show_bug.cgi?id=42324>
 http/tests/webarchive/cross-origin-stylesheet-crash.html
@@ -1613,10 +1512,54 @@ fast/frames/frame-display-none-focus.html
 # <https://bugs.webkit.org/show_bug.cgi?id=42674>
 fast/frames/frame-navigation.html
 fast/history/go-back-to-changed-name.html
+http/tests/navigation/anchor-basic.html
+http/tests/navigation/anchor-goback.html
+http/tests/navigation/anchor-subframeload.html
+http/tests/navigation/back-to-slow-frame.html
+http/tests/navigation/error404-basic.html
+http/tests/navigation/error404-goback.html
+http/tests/navigation/error404-subframeload.html
+http/tests/navigation/javascriptlink-basic.html
+http/tests/navigation/javascriptlink-frames.html
+http/tests/navigation/javascriptlink-goback.html
+http/tests/navigation/javascriptlink-subframeload.html
+http/tests/navigation/metaredirect-basic.html
+http/tests/navigation/metaredirect-frames.html
+http/tests/navigation/metaredirect-goback.html
+http/tests/navigation/metaredirect-subframeload.html
+http/tests/navigation/post-goback-same-url.html
+http/tests/navigation/post-goback2.html
+http/tests/navigation/postredirect-basic.html
+http/tests/navigation/postredirect-frames.html
+http/tests/navigation/postredirect-goback1.html
+http/tests/navigation/postredirect-goback2.html
+http/tests/navigation/postredirect-reload.html
 http/tests/navigation/redirect-cycle.html
+http/tests/navigation/redirect302-basic.html
+http/tests/navigation/redirect302-frames.html
+http/tests/navigation/redirect302-goback.html
+http/tests/navigation/redirect302-metaredirect.html
+http/tests/navigation/redirect302-subframeload.html
+http/tests/navigation/relativeanchor-basic.html
+http/tests/navigation/relativeanchor-frames.html
+http/tests/navigation/relativeanchor-goback.html
 http/tests/navigation/reload-subframe-frame.html
 http/tests/navigation/reload-subframe-iframe.html
 http/tests/navigation/reload-subframe-object.html
+http/tests/navigation/restore-form-state-https.html
+http/tests/navigation/slowmetaredirect-basic.html
+http/tests/navigation/slowtimerredirect-basic.html
+http/tests/navigation/success200-basic.html
+http/tests/navigation/success200-frames-loadsame.html
+http/tests/navigation/success200-frames.html
+http/tests/navigation/success200-goback.html
+http/tests/navigation/success200-loadsame.html
+http/tests/navigation/success200-reload.html
+http/tests/navigation/success200-subframeload.html
+http/tests/navigation/timerredirect-basic.html
+http/tests/navigation/timerredirect-frames.html
+http/tests/navigation/timerredirect-goback.html
+http/tests/navigation/timerredirect-subframeload.html
 
 # WebKitTestRunner needs layoutTestController.queueLoadingScript
 # <https://bugs.webkit.org/show_bug.cgi?id=42675>
@@ -2213,6 +2156,29 @@ transitions/min-max-width-height-transitions.html
 transitions/text-indent-transition.html
 http/tests/security/cross-frame-access-put.html
 
+# Unexplained back/forward list failures
+fast/loader/frame-location-change-not-added-to-history.html
+fast/loader/frame-src-change-added-to-history.html
+fast/loader/frame-src-change-not-added-to-history.html
+http/tests/history/redirect-200-refresh-0-seconds.pl
+http/tests/history/redirect-js-document-location-before-load.html
+http/tests/history/redirect-js-form-submit-2-seconds.html
+http/tests/history/redirect-js-form-submit-before-load.html
+http/tests/history/redirect-js-location-assign-before-load.html
+http/tests/history/redirect-js-location-before-load.html
+http/tests/history/redirect-js-location-href-before-load.html
+http/tests/history/redirect-js-location-replace-0-seconds.html
+http/tests/history/redirect-js-location-replace-2-seconds.html
+http/tests/history/redirect-js-location-replace-before-load.html
+http/tests/history/redirect-meta-refresh-0-seconds.html
+http/tests/navigation/anchor-frames.html
+http/tests/navigation/document-location-script.html
+http/tests/navigation/location-replace-adds-history-item.html
+http/tests/navigation/multiple-back-forward-entries.html
+http/tests/navigation/new-window-redirect-history.html
+http/tests/navigation/post-basic.html
+http/tests/navigation/post-goback1.html
+
 ########################################
 
 # THINGS WE DON'T HAVE AND DON'T WANT
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1901cae..3acb7ab 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,41 @@
+2010-10-26  Darin Adler  <darin at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        WebKitTestRunner needs to support layoutTestController.dumpBackForwardList
+        https://bugs.webkit.org/show_bug.cgi?id=42322
+        rdar://problem/8193631
+
+        WebKitTestRunner needs to support layoutTestController.clearBackForwardList
+        https://bugs.webkit.org/show_bug.cgi?id=42333
+        rdar://problem/8193643
+
+        * WebCore.exp.in: Updated exports.
+
+        * history/BackForwardList.h: Added comments about future refactoring.
+        Moved functions that are not called inside WebCore into a separate
+        section, to be removed later. Added an isActive function to replace the
+        use of enabled() and entries().
+
+        * history/BackForwardListImpl.h: Removed isBackForwardListImpl.
+        Marked virtual function overrides virtual explicitly, except for the
+        ones that will be non-virtual once we make the changes above.
+        Added the isActive function.
+
+        * history/PageCache.cpp:
+        (WebCore::logCanCachePageDecision): Use isActive.
+        (WebCore::PageCache::canCache): Ditto.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::checkDidPerformFirstNavigation): Check
+        using currentItem, backItem, and forwardItem instead of
+        using entries.
+
+        * page/Settings.cpp:
+        (WebCore::Settings::setUsesPageCache): Loop through the back/forward
+        list entries using backListCount and forwardListCount instead of
+        using entries.
+
 2010-10-27  Chris Rogers  <crogers at google.com>
 
         Reviewed by Chris Marrin.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index 0be1b65..13ba92d 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -435,6 +435,9 @@ __ZN7WebCore19AnimationController16resumeAnimationsEPNS_8DocumentE
 __ZN7WebCore19AnimationController17suspendAnimationsEPNS_8DocumentE
 __ZN7WebCore19AnimationController20pauseAnimationAtTimeEPNS_12RenderObjectERKN3WTF6StringEd
 __ZN7WebCore19AnimationController21pauseTransitionAtTimeEPNS_12RenderObjectERKN3WTF6StringEd
+__ZN7WebCore19BackForwardListImpl11currentItemEv
+__ZN7WebCore19BackForwardListImpl11forwardItemEv
+__ZN7WebCore19BackForwardListImpl8backItemEv
 __ZN7WebCore19BackForwardListImplC1EPNS_4PageE
 __ZN7WebCore19CSSStyleDeclaration11setPropertyERKN3WTF6StringES4_Ri
 __ZN7WebCore19ResourceRequestBase11setHTTPBodyEN3WTF10PassRefPtrINS_8FormDataEEE
diff --git a/WebCore/history/BackForwardList.h b/WebCore/history/BackForwardList.h
index 861b43b..83efc3c 100644
--- a/WebCore/history/BackForwardList.h
+++ b/WebCore/history/BackForwardList.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
  * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
  * Copyright (C) 2009 Google, Inc. All rights reserved.
  *
@@ -36,8 +36,16 @@ namespace WebCore {
 
 class HistoryItem;
 
+// FIXME: Remove this and rely on the typedef in BackForwardListImpl
+// instead, after removing the virtual functions at the bottom
+// of this class.
 typedef Vector<RefPtr<HistoryItem> > HistoryItemVector;
 
+// FIXME: Move this class out of this file and into BackForwardListImpl.
+// FIXME: Consider replacing this BackForwardListClient concept with a
+// function that creates a BackForwardList object. The functions in
+// BackForwardList are now almost identical to this, and there is no
+// need for the extra level of indirection.
 #if PLATFORM(CHROMIUM)
 // In the Chromium port, the back/forward list is managed externally.
 // See BackForwardListChromium.cpp
@@ -54,50 +62,63 @@ public:
 };
 #endif
 
+// FIXME: Rename this class to BackForwardClient, and rename the
+// getter in Page accordingly.
 class BackForwardList : public RefCounted<BackForwardList> {
 public: 
     virtual ~BackForwardList()
     {
     }
 
-    virtual bool isBackForwardListImpl() const { return false; }
-
+    // FIXME: Move this function to BackForwardListImpl, or eliminate
+    // it (see comment at definition of BackForwardListClient class).
 #if PLATFORM(CHROMIUM)
     // Must be called before any other methods. 
     virtual void setClient(BackForwardListClient*) = 0;
 #endif
 
     virtual void addItem(PassRefPtr<HistoryItem>) = 0;
-    virtual void goBack() = 0;
-    virtual void goForward() = 0;
+
     virtual void goToItem(HistoryItem*) = 0;
         
-    virtual HistoryItem* backItem() = 0;
-    virtual HistoryItem* currentItem() = 0;
-    virtual HistoryItem* forwardItem() = 0;
     virtual HistoryItem* itemAtIndex(int) = 0;
-
-    virtual void backListWithLimit(int, HistoryItemVector&) = 0;
-    virtual void forwardListWithLimit(int, HistoryItemVector&) = 0;
-
-    virtual int capacity() = 0;
-    virtual void setCapacity(int) = 0;
-    virtual bool enabled() = 0;
-    virtual void setEnabled(bool) = 0;
     virtual int backListCount() = 0;
     virtual int forwardListCount() = 0;
-    virtual bool containsItem(HistoryItem*) = 0;
+
+    virtual bool isActive() = 0;
 
     virtual void close() = 0;
-    virtual bool closed() = 0;
-    
-    virtual void removeItem(HistoryItem*)  = 0;
-    virtual HistoryItemVector& entries()  = 0;
-    
+
+    // FIXME: Rename this to just "clear" and change it so it's not
+    // WML-specific. This is the same operation as clearBackForwardList
+    // in the layout test controller; it would be reasonable to have it
+    // here even though HTML DOM interfaces don't require it.
 #if ENABLE(WML)
     virtual void clearWMLPageHistory()  = 0;
 #endif
 
+    HistoryItem* backItem() { return itemAtIndex(-1); }
+    HistoryItem* currentItem() { return itemAtIndex(0); }
+    HistoryItem* forwardItem() { return itemAtIndex(1); }
+
+    // FIXME: Remove these functions once all call sites are calling them
+    // directly on BackForwardListImpl instead of on BackForwardList.
+    // There is no need for any of these to be virtual functions and no
+    // need to implement them in classes other than BackForwardListImpl.
+    // Also remove the HistoryItemVector typedef in this file once this is done.
+    virtual void goBack() { }
+    virtual void goForward() { }
+    virtual void backListWithLimit(int, HistoryItemVector&) { }
+    virtual void forwardListWithLimit(int, HistoryItemVector&) { }
+    virtual int capacity() { return 0; }
+    virtual void setCapacity(int) { }
+    virtual bool enabled() { return false; }
+    virtual void setEnabled(bool) { }
+    virtual bool containsItem(HistoryItem*) { return false; }
+    virtual bool closed() { return false; }
+    virtual void removeItem(HistoryItem*) { }
+    virtual HistoryItemVector& entries() { HistoryItemVector* bogus = 0; return *bogus; }
+
 protected:
     BackForwardList()
     {
diff --git a/WebCore/history/BackForwardListImpl.h b/WebCore/history/BackForwardListImpl.h
index ab92710..2f08cfe 100644
--- a/WebCore/history/BackForwardListImpl.h
+++ b/WebCore/history/BackForwardListImpl.h
@@ -33,35 +33,34 @@
 
 namespace WebCore {
 
-class HistoryItem;
 class Page;
 
 typedef Vector<RefPtr<HistoryItem> > HistoryItemVector;
 typedef HashSet<RefPtr<HistoryItem> > HistoryItemHashSet;
 
+// FIXME: After renaming BackForwardList to BackForwardClient,
+// rename this to BackForwardList.
 class BackForwardListImpl : public BackForwardList {
 public: 
     static PassRefPtr<BackForwardListImpl> create(Page* page) { return adoptRef(new BackForwardListImpl(page)); }
-    ~BackForwardListImpl();
-
-    bool isBackForwardListImpl() const { return true; }
+    virtual ~BackForwardListImpl();
 
 #if PLATFORM(CHROMIUM)
     // Must be called before any other methods. 
-    void setClient(BackForwardListClient* client) { m_client = client; }
+    virtual void setClient(BackForwardListClient* client) { m_client = client; }
 #endif
     
     Page* page() { return m_page; }
     
-    void addItem(PassRefPtr<HistoryItem>);
+    virtual void addItem(PassRefPtr<HistoryItem>);
     void goBack();
     void goForward();
-    void goToItem(HistoryItem*);
+    virtual void goToItem(HistoryItem*);
         
     HistoryItem* backItem();
     HistoryItem* currentItem();
     HistoryItem* forwardItem();
-    HistoryItem* itemAtIndex(int);
+    virtual HistoryItem* itemAtIndex(int);
 
     void backListWithLimit(int, HistoryItemVector&);
     void forwardListWithLimit(int, HistoryItemVector&);
@@ -70,23 +69,25 @@ public:
     void setCapacity(int);
     bool enabled();
     void setEnabled(bool);
-    int backListCount();
-    int forwardListCount();
+    virtual int backListCount();
+    virtual int forwardListCount();
     bool containsItem(HistoryItem*);
 
-    void close();
+    virtual void close();
     bool closed();
     
     void removeItem(HistoryItem*);
     HistoryItemVector& entries();
     
 #if ENABLE(WML)
-    void clearWMLPageHistory();
+    virtual void clearWMLPageHistory();
 #endif
 
 private:
     BackForwardListImpl(Page*);
-    
+
+    virtual bool isActive() { return enabled() && capacity(); }
+
     Page* m_page;
 #if PLATFORM(CHROMIUM) 
     BackForwardListClient* m_client;
diff --git a/WebCore/history/PageCache.cpp b/WebCore/history/PageCache.cpp
index fedc1e3..30c3b42 100644
--- a/WebCore/history/PageCache.cpp
+++ b/WebCore/history/PageCache.cpp
@@ -192,12 +192,8 @@ static void logCanCachePageDecision(Page* page)
     bool cannotCache = !logCanCacheFrameDecision(page->mainFrame(), 1);
     
     FrameLoadType loadType = page->mainFrame()->loader()->loadType();
-    if (!page->backForwardList()->enabled()) {
-        PCLOG("   -The back/forward list is disabled");
-        cannotCache = true;
-    }
-    if (!(page->backForwardList()->capacity() > 0)) {
-        PCLOG("   -The back/forward list has a 0 capacity");
+    if (!page->backForwardList()->isActive()) {
+        PCLOG("   -The back/forward list is disabled or has 0 capacity");
         cannotCache = true;
     }
     if (!page->settings()->usesPageCache()) {
@@ -307,8 +303,7 @@ bool PageCache::canCache(Page* page)
     FrameLoadType loadType = page->mainFrame()->loader()->loadType();
     
     return canCachePageContainingThisFrame(page->mainFrame())
-        && page->backForwardList()->enabled()
-        && page->backForwardList()->capacity() > 0
+        && page->backForwardList()->isActive()
         && page->settings()->usesPageCache()
 #if ENABLE(DEVICE_ORIENTATION)
         && !(page->deviceMotionController() && page->deviceMotionController()->isActive())
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 940e770..dfc1ad0 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -3114,7 +3114,7 @@ void FrameLoader::checkDidPerformFirstNavigation()
     if (!page)
         return;
 
-    if (!m_didPerformFirstNavigation && page->backForwardList()->entries().size() == 1) {
+    if (!m_didPerformFirstNavigation && page->backForwardList()->currentItem() && !page->backForwardList()->backItem() && !page->backForwardList()->forwardItem()) {
         m_didPerformFirstNavigation = true;
         m_client->didPerformFirstNavigation();
     }
diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp
index 0516701..fac35be 100644
--- a/WebCore/page/Settings.cpp
+++ b/WebCore/page/Settings.cpp
@@ -424,9 +424,10 @@ void Settings::setUsesPageCache(bool usesPageCache)
         
     m_usesPageCache = usesPageCache;
     if (!m_usesPageCache) {
-        HistoryItemVector& historyItems = m_page->backForwardList()->entries();
-        for (unsigned i = 0; i < historyItems.size(); i++)
-            pageCache()->remove(historyItems[i].get());
+        int first = -m_page->backForwardList()->backListCount();
+        int last = m_page->backForwardList()->forwardListCount();
+        for (int i = first; i <= last; i++)
+            pageCache()->remove(m_page->backForwardList()->itemAtIndex(i));
         pageCache()->releaseAutoreleasedPagesNow();
     }
 }
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index edfb1f8..03930a1 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,33 @@
+2010-10-26  Darin Adler  <darin at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        WebKitTestRunner needs to support layoutTestController.dumpBackForwardList
+        https://bugs.webkit.org/show_bug.cgi?id=42322
+        rdar://problem/8193631
+
+        WebKitTestRunner needs to support layoutTestController.clearBackForwardList
+        https://bugs.webkit.org/show_bug.cgi?id=42333
+        rdar://problem/8193643
+
+        * History/WebBackForwardList.mm:
+        (core): Return BackForwardListImpl.
+        (kit): Take BackForwardListImpl.
+        (-[WebBackForwardList initWithBackForwardList:]): Use BackForwardListImpl.
+        (-[WebBackForwardList dealloc]): Ditto.
+        (-[WebBackForwardList finalize]): Ditto.
+        (-[WebBackForwardList description]): Ditto.
+        (-[WebBackForwardList setPageCacheSize:]): Ditto.
+        (-[WebBackForwardList pageCacheSize]): Ditto.
+        * History/WebBackForwardListInternal.h: Ditto.
+        * WebView/WebFrameView.mm:
+        (-[WebFrameView keyDown:]): Ditto.
+        * WebView/WebView.mm:
+        (-[WebView initWithCoder:]): Ditto.
+        (-[WebView encodeWithCoder:]): Ditto.
+        (-[WebView backForwardList]): Ditto.
+        (-[WebView setMaintainsBackForwardList:]): Ditto.
+
 2010-10-27  Chris Rogers  <crogers at google.com>
 
         Reviewed by Chris Marrin.
diff --git a/WebKit/mac/History/WebBackForwardList.mm b/WebKit/mac/History/WebBackForwardList.mm
index 617ee0e..45fa7e9 100644
--- a/WebKit/mac/History/WebBackForwardList.mm
+++ b/WebKit/mac/History/WebBackForwardList.mm
@@ -63,15 +63,15 @@ static BackForwardListMap& backForwardLists()
 
 @implementation WebBackForwardList (WebBackForwardListInternal)
 
-BackForwardList* core(WebBackForwardList *webBackForwardList)
+BackForwardListImpl* core(WebBackForwardList *webBackForwardList)
 {
     if (!webBackForwardList)
         return 0;
 
-    return reinterpret_cast<BackForwardList*>(webBackForwardList->_private);
+    return reinterpret_cast<BackForwardListImpl*>(webBackForwardList->_private);
 }
 
-WebBackForwardList *kit(BackForwardList* backForwardList)
+WebBackForwardList *kit(BackForwardListImpl* backForwardList)
 {
     if (!backForwardList)
         return nil;
@@ -82,7 +82,7 @@ WebBackForwardList *kit(BackForwardList* backForwardList)
     return [[[WebBackForwardList alloc] initWithBackForwardList:backForwardList] autorelease];
 }
 
-- (id)initWithBackForwardList:(PassRefPtr<BackForwardList>)backForwardList
+- (id)initWithBackForwardList:(PassRefPtr<BackForwardListImpl>)backForwardList
 {   
     WebCoreThreadViolationCheckRoundOne();
     self = [super init];
@@ -117,7 +117,7 @@ WebBackForwardList *kit(BackForwardList* backForwardList)
     if (WebCoreObjCScheduleDeallocateOnMainThread([WebBackForwardList class], self))
         return;
 
-    BackForwardList* backForwardList = core(self);
+    BackForwardListImpl* backForwardList = core(self);
     ASSERT(backForwardList);
     if (backForwardList) {
         ASSERT(backForwardList->closed());
@@ -131,7 +131,7 @@ WebBackForwardList *kit(BackForwardList* backForwardList)
 - (void)finalize
 {
     WebCoreThreadViolationCheckRoundOne();
-    BackForwardList* backForwardList = core(self);
+    BackForwardListImpl* backForwardList = core(self);
     ASSERT(backForwardList);
     if (backForwardList) {
         ASSERT(backForwardList->closed());
@@ -265,7 +265,7 @@ static bool bumperCarBackForwardHackNeeded()
     [result appendString:@"\n--------------------------------------------\n"];    
     [result appendString:@"WebBackForwardList:\n"];
     
-    BackForwardList* backForwardList = core(self);
+    BackForwardListImpl* backForwardList = core(self);
     HistoryItemVector& entries = backForwardList->entries();
     
     unsigned size = entries.size();
@@ -293,14 +293,12 @@ static bool bumperCarBackForwardHackNeeded()
 
 - (void)setPageCacheSize:(NSUInteger)size
 {
-    ASSERT(core(self)->isBackForwardListImpl());
-    [kit(static_cast<BackForwardListImpl*>(core(self))->page()) setUsesPageCache:size != 0];
+    [kit(core(self)->page()) setUsesPageCache:size != 0];
 }
 
 - (NSUInteger)pageCacheSize
 {
-    ASSERT(core(self)->isBackForwardListImpl());
-    return [kit(static_cast<BackForwardListImpl*>(core(self))->page()) usesPageCache] ? pageCache()->capacity() : 0;
+    return [kit(core(self)->page()) usesPageCache] ? pageCache()->capacity() : 0;
 }
 
 - (int)backListCount
diff --git a/WebKit/mac/History/WebBackForwardListInternal.h b/WebKit/mac/History/WebBackForwardListInternal.h
index 3448647..1afb833 100644
--- a/WebKit/mac/History/WebBackForwardListInternal.h
+++ b/WebKit/mac/History/WebBackForwardListInternal.h
@@ -30,12 +30,12 @@
 #import <wtf/PassRefPtr.h>
 
 namespace WebCore {
-    class BackForwardList;
+    class BackForwardListImpl;
 }
 
-WebCore::BackForwardList* core(WebBackForwardList *);
-WebBackForwardList *kit(WebCore::BackForwardList*);
+WebCore::BackForwardListImpl* core(WebBackForwardList *);
+WebBackForwardList *kit(WebCore::BackForwardListImpl*);
 
 @interface WebBackForwardList (WebBackForwardListInternal)
-- (id)initWithBackForwardList:(PassRefPtr<WebCore::BackForwardList>)backForwardList;
+- (id)initWithBackForwardList:(PassRefPtr<WebCore::BackForwardListImpl>)backForwardList;
 @end
diff --git a/WebKit/mac/WebView/WebFrameView.mm b/WebKit/mac/WebView/WebFrameView.mm
index e76e3ca..0db12c0 100644
--- a/WebKit/mac/WebView/WebFrameView.mm
+++ b/WebKit/mac/WebView/WebFrameView.mm
@@ -55,7 +55,7 @@
 #import "WebViewInternal.h"
 #import "WebViewPrivate.h"
 #import <Foundation/NSURLRequest.h>
-#import <WebCore/BackForwardList.h>
+#import <WebCore/BackForwardListImpl.h>
 #import <WebCore/DragController.h>
 #import <WebCore/EventHandler.h>
 #import <WebCore/Frame.h>
@@ -708,7 +708,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
     int index, count;
     BOOL callSuper = YES;
     Frame* coreFrame = [self _web_frame];
-    BOOL maintainsBackForwardList = coreFrame && coreFrame->page()->backForwardList()->enabled() ? YES : NO;
+    BOOL maintainsBackForwardList = coreFrame && static_cast<BackForwardListImpl*>(coreFrame->page()->backForwardList())->enabled() ? YES : NO;
     
     count = [characters length];
     for (index = 0; index < count; ++index) {
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index f3a2499..b30a1a8 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -110,7 +110,7 @@
 #import <JavaScriptCore/JSValueRef.h>
 #import <WebCore/AbstractDatabase.h>
 #import <WebCore/ApplicationCacheStorage.h>
-#import <WebCore/BackForwardList.h>
+#import <WebCore/BackForwardListImpl.h>
 #import <WebCore/Cache.h>
 #import <WebCore/ColorMac.h>
 #import <WebCore/CSSComputedStyleDeclaration.h>
@@ -3006,7 +3006,7 @@ static bool needsWebViewInitThreadWorkaround()
 
         LOG(Encoding, "FrameName = %@, GroupName = %@, useBackForwardList = %d\n", frameName, groupName, (int)useBackForwardList);
         [result _commonInitializationWithFrameName:frameName groupName:groupName usesDocumentViews:YES];
-        [result page]->backForwardList()->setEnabled(useBackForwardList);
+        static_cast<BackForwardListImpl*>([result page]->backForwardList())->setEnabled(useBackForwardList);
         result->_private->allowsUndo = allowsUndo;
         if (preferences)
             [result setPreferences:preferences];
@@ -3030,7 +3030,7 @@ static bool needsWebViewInitThreadWorkaround()
     // Restore the subviews we set aside.
     _subviews = originalSubviews;
 
-    BOOL useBackForwardList = _private->page && _private->page->backForwardList()->enabled();
+    BOOL useBackForwardList = _private->page && static_cast<BackForwardListImpl*>(_private->page->backForwardList())->enabled();
     if ([encoder allowsKeyedCoding]) {
         [encoder encodeObject:[[self mainFrame] name] forKey:@"FrameName"];
         [encoder encodeObject:[self groupName] forKey:@"GroupName"];
@@ -3341,16 +3341,17 @@ static bool needsWebViewInitThreadWorkaround()
 {
     if (!_private->page)
         return nil;
-    if (!_private->page->backForwardList()->enabled())
+    BackForwardListImpl* list = static_cast<BackForwardListImpl*>(_private->page->backForwardList());
+    if (!list->enabled())
         return nil;
-    return kit(_private->page->backForwardList());
+    return kit(list);
 }
 
 - (void)setMaintainsBackForwardList:(BOOL)flag
 {
     if (!_private->page)
         return;
-    _private->page->backForwardList()->setEnabled(flag);
+    static_cast<BackForwardListImpl*>(_private->page->backForwardList())->setEnabled(flag);
 }
 
 - (BOOL)goBack
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 519a241..319af25 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,110 @@
+2010-10-26  Darin Adler  <darin at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        WebKitTestRunner needs to support layoutTestController.dumpBackForwardList
+        https://bugs.webkit.org/show_bug.cgi?id=42322
+        rdar://problem/8193631
+
+        WebKitTestRunner needs to support layoutTestController.clearBackForwardList
+        https://bugs.webkit.org/show_bug.cgi?id=42333
+        rdar://problem/8193643
+
+        * Shared/API/c/WKBase.h: Added WKBundleBackForwardListRef and
+        WKBundleBackForwardListItemRef.
+
+        * Shared/API/c/WKURL.cpp:
+        (WKURLCopyString): Added.
+        * Shared/API/c/WKURL.h: Added WKURLCopyString.
+
+        * Shared/API/c/cf/WKURLCF.h: Fixed incorrect argument name.
+
+        * Shared/APIObject.h: Added TypeBundleBackForwardList and
+        TypeBundleBackForwardListItem.
+
+        * Shared/ImmutableArray.h: Marked destructor virtual explicitly.
+        * Shared/ImmutableDictionary.h: Ditto.
+        * UIProcess/WebBackForwardListItem.h: Ditto.
+        * UIProcess/WebContext.h: Ditto.
+        * UIProcess/WebFrameProxy.h: Ditto.
+        * UIProcess/WebNavigationData.h: Ditto.
+        * UIProcess/WebPageNamespace.h: Ditto.
+        * UIProcess/WebPreferences.h: Ditto.
+        * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h: Ditto.
+        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h: Ditto.
+        * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h: Ditto.
+
+        * UIProcess/WebBackForwardList.cpp: Removed unneeded backListWithLimit
+        and forwardListWithLimit functions.
+        (WebKit::WebBackForwardList::clear): Added.
+        * UIProcess/WebBackForwardList.h: Marked destructor virtual explicitly.
+        Added clear, removed backListWithLimit and forwardListWithLimit functions.
+
+        * UIProcess/WebPageProxy.cpp: Removed unneeded backForwardBackItem,
+        backForwardCurrentItem, and backForwardForwardItem functions.
+        (WebKit::WebPageProxy::backForwardClear): Added.
+        * UIProcess/WebPageProxy.h: Ditto.
+        * UIProcess/WebPageProxy.messages.in: Ditto.
+
+        * WebKit2.pro: Added new files.
+        * WebKit2.xcodeproj/project.pbxproj: Ditto.
+        * win/WebKit2.vcproj: Ditto.
+
+        * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h: Added
+        WKBundleBackForwardListRef and WKBundleBackForwardListItemRef.
+
+        * WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp:
+        Started with a copy of from WebKit2/UIProcess/API/C/WKBackForwardList.cpp.
+        * WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.h:
+        Started with a copy of WebKit2/UIProcess/API/C/WKBackForwardList.h.
+
+        * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
+        Started with a copy of WebKit2/UIProcess/API/C/WKBackForwardListItem.cpp.
+        * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h:
+        Started with a copy of WebKit2/UIProcess/API/C/WKBackForwardListItem.h.
+
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageGetBackForwardList): Added.
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.h: Ditto.
+
+
+        * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp:
+        Started with a copy of WebKit2/UIProcess/WebBackForwardList.cpp.
+        * WebProcess/InjectedBundle/InjectedBundleBackForwardList.h:
+        Started with a copy of WebKit2/UIProcess/WebBackForwardList.h.
+
+        * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
+        Started with a copy of WebKit2/UIProcess/WebBackForwardListItem.cpp.
+        * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h:
+        Started with a copy of WebKit2/UIProcess/WebBackForwardListItem.h.
+
+        * WebProcess/WebPage/WebBackForwardListProxy.cpp: Removed
+        many unneeded functions.
+        (WebKit::WebBackForwardListProxy::WebBackForwardListProxy):
+        Removed unneeded initialization of m_closed.
+        (WebKit::WebBackForwardListProxy::addItem): Added a check for
+        the case of a capacity of 0.
+        (WebKit::WebBackForwardListProxy::goToItem): Added a check for
+        when the proxy outlives its page.
+        (WebKit::WebBackForwardListProxy::itemAtIndex): Ditto.
+        (WebKit::WebBackForwardListProxy::backListCount): Ditto.
+        (WebKit::WebBackForwardListProxy::forwardListCount): Ditto.
+        (WebKit::WebBackForwardListProxy::close): Removed unneeded code
+        setting m_closed.
+        (WebKit::WebBackForwardListProxy::isActive): Added.
+        (WebKit::WebBackForwardListProxy::clear): Added.
+
+        * WebProcess/WebPage/WebBackForwardListProxy.h: Added clear,
+        isActive, and detach functions. Removed many other unneeded
+        function and data members.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::~WebPage): Added call to detach on the
+        back/forward list.
+        (WebKit::WebPage::backForwardList): Added.
+        * WebProcess/WebPage/WebPage.h: Added backForwardList function
+        and m_backForwardList data member.
+
 2010-10-27  Beth Dakin  <bdakin at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebKit2/Shared/API/c/WKBase.h b/WebKit2/Shared/API/c/WKBase.h
index 3a9c232..03772d3 100644
--- a/WebKit2/Shared/API/c/WKBase.h
+++ b/WebKit2/Shared/API/c/WKBase.h
@@ -73,6 +73,8 @@ typedef const struct OpaqueWKPreferences* WKPreferencesRef;
 /* WebKit2 Bundle types */
 
 typedef const struct OpaqueWKBundle* WKBundleRef;
+typedef const struct OpaqueWKBundleBackForwardList* WKBundleBackForwardListRef;
+typedef const struct OpaqueWKBundleBackForwardListItem* WKBundleBackForwardListItemRef;
 typedef const struct OpaqueWKBundleFrame* WKBundleFrameRef;
 typedef const struct OpaqueWKBundleHitTestResult* WKBundleHitTestResultRef;
 typedef const struct OpaqueWKBundleNodeHandle* WKBundleNodeHandleRef;
diff --git a/WebKit2/Shared/API/c/WKURL.cpp b/WebKit2/Shared/API/c/WKURL.cpp
index dbce7d0..f2237fb 100644
--- a/WebKit2/Shared/API/c/WKURL.cpp
+++ b/WebKit2/Shared/API/c/WKURL.cpp
@@ -39,6 +39,11 @@ WKURLRef WKURLCreateWithUTF8CString(const char* string)
     return toAPI(WebURL::create(String::fromUTF8(string)).leakRef());
 }
 
+WKStringRef WKURLCopyString(WKURLRef url)
+{
+    return toAPI(WebString::create(toImpl(url)->string()).leakRef());
+}
+
 bool WKURLIsEqual(WKURLRef a, WKURLRef b)
 {
     return toImpl(a)->string() == toImpl(b)->string();
diff --git a/WebKit2/Shared/API/c/WKURL.h b/WebKit2/Shared/API/c/WKURL.h
index 6eb46a1..738bce5 100644
--- a/WebKit2/Shared/API/c/WKURL.h
+++ b/WebKit2/Shared/API/c/WKURL.h
@@ -36,6 +36,8 @@ WK_EXPORT WKTypeID WKURLGetTypeID();
 
 WK_EXPORT WKURLRef WKURLCreateWithUTF8CString(const char* string);
 
+WK_EXPORT WKStringRef WKURLCopyString(WKURLRef URL);
+
 WK_EXPORT bool WKURLIsEqual(WKURLRef a, WKURLRef b);
 
 #ifdef __cplusplus
diff --git a/WebKit2/Shared/API/c/cf/WKURLCF.h b/WebKit2/Shared/API/c/cf/WKURLCF.h
index 468411f..394800d 100644
--- a/WebKit2/Shared/API/c/cf/WKURLCF.h
+++ b/WebKit2/Shared/API/c/cf/WKURLCF.h
@@ -34,7 +34,7 @@ extern "C" {
 #endif
 
 WK_EXPORT WKURLRef WKURLCreateWithCFURL(CFURLRef URL);
-WK_EXPORT CFURLRef WKURLCopyCFURL(CFAllocatorRef alloc, WKURLRef string);
+WK_EXPORT CFURLRef WKURLCopyCFURL(CFAllocatorRef alloc, WKURLRef URL);
 
 #ifdef __cplusplus
 }
diff --git a/WebKit2/Shared/APIObject.h b/WebKit2/Shared/APIObject.h
index a4a9e12..cd5420a 100644
--- a/WebKit2/Shared/APIObject.h
+++ b/WebKit2/Shared/APIObject.h
@@ -67,6 +67,8 @@ public:
 
         // Bundle types
         TypeBundle,
+        TypeBundleBackForwardList,
+        TypeBundleBackForwardListItem,
         TypeBundleFrame,
         TypeBundleHitTestResult,
         TypeBundleNodeHandle,
diff --git a/WebKit2/Shared/ImmutableArray.h b/WebKit2/Shared/ImmutableArray.h
index 9f3f96b..e26e4aa 100644
--- a/WebKit2/Shared/ImmutableArray.h
+++ b/WebKit2/Shared/ImmutableArray.h
@@ -52,7 +52,7 @@ public:
         return adoptRef(new ImmutableArray(entries));
     }
 
-    ~ImmutableArray();
+    virtual ~ImmutableArray();
 
     template<typename T>
     T* at(size_t i) { if (m_entries[i]->type() != T::APIType) return 0; return static_cast<T*>(m_entries[i].get()); }
diff --git a/WebKit2/Shared/ImmutableDictionary.h b/WebKit2/Shared/ImmutableDictionary.h
index d73ed48..3f592c5 100644
--- a/WebKit2/Shared/ImmutableDictionary.h
+++ b/WebKit2/Shared/ImmutableDictionary.h
@@ -52,7 +52,8 @@ public:
     {
         return adoptRef(new ImmutableDictionary(map));
     }
-    ~ImmutableDictionary();
+
+    virtual ~ImmutableDictionary();
 
     virtual bool isMutable() { return false; }
 
diff --git a/WebKit2/UIProcess/WebBackForwardList.cpp b/WebKit2/UIProcess/WebBackForwardList.cpp
index 1470245..f90300c 100644
--- a/WebKit2/UIProcess/WebBackForwardList.cpp
+++ b/WebKit2/UIProcess/WebBackForwardList.cpp
@@ -137,35 +137,6 @@ int WebBackForwardList::forwardListCount()
     return m_current == NoCurrentItemIndex ? 0 : static_cast<int>(m_entries.size()) - (m_current + 1);
 }
 
-BackForwardListItemVector WebBackForwardList::backListWithLimit(unsigned limit)
-{
-    BackForwardListItemVector list;
-    unsigned size = std::min(backListCount(), static_cast<int>(limit));
-    if (!size)
-        return list;
-
-    list.resize(size);
-    for (unsigned i = std::max(m_current - limit, 0U), j = 0; i < m_current; ++i, ++j)
-        list[j] = m_entries[i];
-
-    return list;
-}
-
-BackForwardListItemVector WebBackForwardList::forwardListWithLimit(unsigned limit)
-{
-    BackForwardListItemVector list;
-    unsigned size = std::min(forwardListCount(), static_cast<int>(limit));
-    if (!size)
-        return list;
-
-    list.resize(size);
-    unsigned last = std::min(m_current + limit, static_cast<unsigned>(m_entries.size() - 1));
-    for (unsigned i = m_current + 1, j = 0; i <= last; ++i, ++j)
-        list[j] = m_entries[i];
-
-    return list;
-}
-
 PassRefPtr<ImmutableArray> WebBackForwardList::backListAsImmutableArrayWithLimit(unsigned limit)
 {
     unsigned backListSize = static_cast<unsigned>(backListCount());
@@ -200,4 +171,19 @@ PassRefPtr<ImmutableArray> WebBackForwardList::forwardListAsImmutableArrayWithLi
     return ImmutableArray::adopt(vector);
 }
 
+void WebBackForwardList::clear()
+{
+    if (m_entries.size() <= 1)
+        return;
+
+    RefPtr<WebBackForwardListItem> item = currentItem();
+    m_entries.resize(1);
+    m_entries[0] = item.release();
+
+    m_current = 0;
+
+    if (m_page)
+        m_page->didChangeBackForwardList();
+}
+
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/WebBackForwardList.h b/WebKit2/UIProcess/WebBackForwardList.h
index 9cbc6b9..48b7498 100644
--- a/WebKit2/UIProcess/WebBackForwardList.h
+++ b/WebKit2/UIProcess/WebBackForwardList.h
@@ -55,10 +55,12 @@ public:
     {
         return adoptRef(new WebBackForwardList(page));
     }
-    ~WebBackForwardList();
+
+    virtual ~WebBackForwardList();
 
     void addItem(WebBackForwardListItem*);
     void goToItem(WebBackForwardListItem*);
+    void clear();
 
     WebBackForwardListItem* currentItem();
     WebBackForwardListItem* backItem();
@@ -68,9 +70,6 @@ public:
     int backListCount();
     int forwardListCount();
 
-    BackForwardListItemVector backListWithLimit(unsigned limit);
-    BackForwardListItemVector forwardListWithLimit(unsigned limit);
-
     PassRefPtr<ImmutableArray> backListAsImmutableArrayWithLimit(unsigned limit);
     PassRefPtr<ImmutableArray> forwardListAsImmutableArrayWithLimit(unsigned limit);
 
diff --git a/WebKit2/UIProcess/WebBackForwardListItem.h b/WebKit2/UIProcess/WebBackForwardListItem.h
index b4c2357..b80b88c 100644
--- a/WebKit2/UIProcess/WebBackForwardListItem.h
+++ b/WebKit2/UIProcess/WebBackForwardListItem.h
@@ -42,7 +42,8 @@ public:
     {
         return adoptRef(new WebBackForwardListItem(originalURL, url, title, itemID));
     }
-    ~WebBackForwardListItem();
+
+    virtual ~WebBackForwardListItem();
 
     uint64_t itemID() const { return m_itemID; }
 
diff --git a/WebKit2/UIProcess/WebContext.h b/WebKit2/UIProcess/WebContext.h
index 1352f58..f432ce1 100644
--- a/WebKit2/UIProcess/WebContext.h
+++ b/WebKit2/UIProcess/WebContext.h
@@ -59,7 +59,7 @@ public:
 
     static PassRefPtr<WebContext> create(const String& injectedBundlePath);
 
-    ~WebContext();
+    virtual ~WebContext();
 
     void initializeInjectedBundleClient(const WKContextInjectedBundleClient*);
     void initializeHistoryClient(const WKContextHistoryClient*);
diff --git a/WebKit2/UIProcess/WebFrameProxy.h b/WebKit2/UIProcess/WebFrameProxy.h
index 16225f2..3f894a0 100644
--- a/WebKit2/UIProcess/WebFrameProxy.h
+++ b/WebKit2/UIProcess/WebFrameProxy.h
@@ -55,7 +55,7 @@ public:
     {
         return adoptRef(new WebFrameProxy(page, frameID));
     }
-    ~WebFrameProxy();
+    virtual ~WebFrameProxy();
 
     enum LoadState {
         LoadStateProvisional,
diff --git a/WebKit2/UIProcess/WebNavigationData.h b/WebKit2/UIProcess/WebNavigationData.h
index 608e18f..e6b6c31 100644
--- a/WebKit2/UIProcess/WebNavigationData.h
+++ b/WebKit2/UIProcess/WebNavigationData.h
@@ -40,7 +40,8 @@ public:
     {
         return adoptRef(new WebNavigationData(store));
     }
-    ~WebNavigationData();
+
+    virtual ~WebNavigationData();
 
     String title() const { return m_store.title; }
     String url() const { return m_store.url; }
diff --git a/WebKit2/UIProcess/WebPageNamespace.h b/WebKit2/UIProcess/WebPageNamespace.h
index b5eaf1e..8048323 100644
--- a/WebKit2/UIProcess/WebPageNamespace.h
+++ b/WebKit2/UIProcess/WebPageNamespace.h
@@ -46,7 +46,7 @@ public:
         return adoptRef(new WebPageNamespace(context));
     }
 
-    ~WebPageNamespace();
+    virtual ~WebPageNamespace();
 
     WebPageProxy* createWebPage();    
 
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index 0a5a836..ea20d82 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -997,24 +997,6 @@ void WebPageProxy::backForwardGoToItem(uint64_t itemID)
     m_backForwardList->goToItem(process()->webBackForwardItem(itemID));
 }
 
-void WebPageProxy::backForwardBackItem(uint64_t& itemID)
-{
-    WebBackForwardListItem* backItem = m_backForwardList->backItem();
-    itemID = backItem ? backItem->itemID() : 0;
-}
-
-void WebPageProxy::backForwardCurrentItem(uint64_t& itemID)
-{
-    WebBackForwardListItem* currentItem = m_backForwardList->currentItem();
-    itemID = currentItem ? currentItem->itemID() : 0;
-}
-
-void WebPageProxy::backForwardForwardItem(uint64_t& itemID)
-{
-    WebBackForwardListItem* forwardItem = m_backForwardList->forwardItem();
-    itemID = forwardItem ? forwardItem->itemID() : 0;
-}
-
 void WebPageProxy::backForwardItemAtIndex(int32_t index, uint64_t& itemID)
 {
     WebBackForwardListItem* item = m_backForwardList->itemAtIndex(index);
@@ -1298,4 +1280,9 @@ void WebPageProxy::didLeaveAcceleratedCompositing()
 }
 #endif // USE(ACCELERATED_COMPOSITING)
 
+void WebPageProxy::backForwardClear()
+{
+    m_backForwardList->clear();
+}
+
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/WebPageProxy.h b/WebKit2/UIProcess/WebPageProxy.h
index fb89847..742f23d 100644
--- a/WebKit2/UIProcess/WebPageProxy.h
+++ b/WebKit2/UIProcess/WebPageProxy.h
@@ -98,7 +98,8 @@ public:
     static const Type APIType = TypePage;
 
     static PassRefPtr<WebPageProxy> create(WebPageNamespace*, uint64_t pageID);
-    ~WebPageProxy();
+
+    virtual ~WebPageProxy();
 
     uint64_t pageID() const { return m_pageID; }
 
@@ -286,12 +287,10 @@ private:
     // Back/Forward list management
     void backForwardAddItem(uint64_t itemID);
     void backForwardGoToItem(uint64_t itemID);
-    void backForwardBackItem(uint64_t& itemID);
-    void backForwardCurrentItem(uint64_t& itemID);
-    void backForwardForwardItem(uint64_t& itemID);
     void backForwardItemAtIndex(int32_t index, uint64_t& itemID);
     void backForwardBackListCount(int32_t& count);
     void backForwardForwardListCount(int32_t& count);
+    void backForwardClear();
 
     // Undo management
     void registerEditCommandForUndo(uint64_t commandID, uint32_t editAction);
diff --git a/WebKit2/UIProcess/WebPageProxy.messages.in b/WebKit2/UIProcess/WebPageProxy.messages.in
index 388e270..fe88cfc 100644
--- a/WebKit2/UIProcess/WebPageProxy.messages.in
+++ b/WebKit2/UIProcess/WebPageProxy.messages.in
@@ -85,12 +85,10 @@ messages -> WebPageProxy {
     # BackForward messages.
     BackForwardAddItem(uint64_t itemID)
     BackForwardGoToItem(uint64_t itemID)
-    BackForwardBackItem() -> (uint64_t itemID)
-    BackForwardCurrentItem() -> (uint64_t itemID)
-    BackForwardForwardItem() -> (uint64_t itemID)
-    BackForwardItemAtIndex(uint64_t itemID) -> (uint64_t itemID)
-    BackForwardBackListCount() -> (int32_t itemID)
-    BackForwardForwardListCount() -> (int32_t itemID)
+    BackForwardItemAtIndex(int32_t itemIndex) -> (uint64_t itemID)
+    BackForwardBackListCount() -> (int32_t count)
+    BackForwardForwardListCount() -> (int32_t count)
+    BackForwardClear()
 
     # Undo/Redo messages.
     RegisterEditCommandForUndo(uint64_t commandID, uint32_t editAction)
diff --git a/WebKit2/UIProcess/WebPreferences.h b/WebKit2/UIProcess/WebPreferences.h
index 862a419..6668292 100644
--- a/WebKit2/UIProcess/WebPreferences.h
+++ b/WebKit2/UIProcess/WebPreferences.h
@@ -51,7 +51,8 @@ public:
     {
         return adoptRef(new WebPreferences(preferences));
     }
-    ~WebPreferences();
+
+    virtual ~WebPreferences();
 
     void addContext(WebContext*);
     void removeContext(WebContext*);
diff --git a/WebKit2/WebKit2.pro b/WebKit2/WebKit2.pro
index 245057d..3f8fe5f 100644
--- a/WebKit2/WebKit2.pro
+++ b/WebKit2/WebKit2.pro
@@ -283,8 +283,10 @@ HEADERS += \
     UIProcess/WebProcessProxy.h \
     UIProcess/WebUIClient.h \
     UIProcess/qt/WebPopupMenuProxyQt.h \
-    WebProcess/Downloads/DownloadManager.h \
     WebProcess/Downloads/Download.h \
+    WebProcess/Downloads/DownloadManager.h \
+    WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.h \
+    WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h \
     WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h \
     WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h \
     WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h \
@@ -435,6 +437,8 @@ SOURCES += \
     WebProcess/Downloads/DownloadManager.cpp \
     WebProcess/Downloads/qt/DownloadQt.cpp \
     WebProcess/InjectedBundle/API/c/WKBundle.cpp \
+    WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp \
+    WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp \
     WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp \
     WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp \
     WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp \
@@ -443,11 +447,13 @@ SOURCES += \
     WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp \
     WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp \
     WebProcess/InjectedBundle/InjectedBundle.cpp \
+    WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp \
+    WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp \
     WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp \
     WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp \
     WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp \
-    WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp \
     WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp \
+    WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp \
     WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp \
     WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp \
     WebProcess/Plugins/JSNPObject.cpp \
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index 1ab56ec..7066780 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -169,6 +169,14 @@
 		762B74AF120BC94F00819339 /* WKPreferencesPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 762B749D120BC8EA00819339 /* WKPreferencesPrivate.cpp */; };
 		8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
 		8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; };
+		935EEB9B1277617C003322B8 /* WKBundleBackForwardListItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 935EEB981277616D003322B8 /* WKBundleBackForwardListItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		935EEB9E127761AC003322B8 /* WKBundleBackForwardList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 935EEB951277616D003322B8 /* WKBundleBackForwardList.cpp */; };
+		935EEB9F127761AC003322B8 /* WKBundleBackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 935EEB961277616D003322B8 /* WKBundleBackForwardList.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		935EEBA0127761AC003322B8 /* WKBundleBackForwardListItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 935EEB971277616D003322B8 /* WKBundleBackForwardListItem.cpp */; };
+		935EEBA1127761CC003322B8 /* InjectedBundleBackForwardList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 935EEB8F1277615D003322B8 /* InjectedBundleBackForwardList.cpp */; };
+		935EEBA2127761D0003322B8 /* InjectedBundleBackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 935EEB901277615D003322B8 /* InjectedBundleBackForwardList.h */; };
+		935EEBA3127761D3003322B8 /* InjectedBundleBackForwardListItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 935EEB911277615D003322B8 /* InjectedBundleBackForwardListItem.cpp */; };
+		935EEBA4127761D6003322B8 /* InjectedBundleBackForwardListItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 935EEB921277615D003322B8 /* InjectedBundleBackForwardListItem.h */; };
 		9391F2CA121B679A00EBF7E8 /* WebFrameNetworkingContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9391F284121B38F500EBF7E8 /* WebFrameNetworkingContext.mm */; };
 		9391F2CB121B67AD00EBF7E8 /* WebFrameNetworkingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 9391F283121B38F500EBF7E8 /* WebFrameNetworkingContext.h */; };
 		BC0092F7115837A300E0AE2A /* RunLoopMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC0092F5115837A300E0AE2A /* RunLoopMac.mm */; };
@@ -659,6 +667,14 @@
 		762B749D120BC8EA00819339 /* WKPreferencesPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKPreferencesPrivate.cpp; sourceTree = "<group>"; };
 		8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		8DC2EF5B0486A6940098B216 /* WebKit2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WebKit2.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+		935EEB8F1277615D003322B8 /* InjectedBundleBackForwardList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleBackForwardList.cpp; sourceTree = "<group>"; };
+		935EEB901277615D003322B8 /* InjectedBundleBackForwardList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleBackForwardList.h; sourceTree = "<group>"; };
+		935EEB911277615D003322B8 /* InjectedBundleBackForwardListItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleBackForwardListItem.cpp; sourceTree = "<group>"; };
+		935EEB921277615D003322B8 /* InjectedBundleBackForwardListItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleBackForwardListItem.h; sourceTree = "<group>"; };
+		935EEB951277616D003322B8 /* WKBundleBackForwardList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleBackForwardList.cpp; sourceTree = "<group>"; };
+		935EEB961277616D003322B8 /* WKBundleBackForwardList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleBackForwardList.h; sourceTree = "<group>"; };
+		935EEB971277616D003322B8 /* WKBundleBackForwardListItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleBackForwardListItem.cpp; sourceTree = "<group>"; };
+		935EEB981277616D003322B8 /* WKBundleBackForwardListItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleBackForwardListItem.h; sourceTree = "<group>"; };
 		9391F283121B38F500EBF7E8 /* WebFrameNetworkingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameNetworkingContext.h; sourceTree = "<group>"; };
 		9391F284121B38F500EBF7E8 /* WebFrameNetworkingContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFrameNetworkingContext.mm; sourceTree = "<group>"; };
 		A72D5D7F1236CBA800A88B15 /* WebSerializedScriptValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSerializedScriptValue.h; sourceTree = "<group>"; };
@@ -1633,6 +1649,10 @@
 				BC4BEE96120A091700FBA0C7 /* DOM */,
 				BC204EE011C83E98008F3375 /* InjectedBundle.cpp */,
 				BC204EE111C83E98008F3375 /* InjectedBundle.h */,
+				935EEB8F1277615D003322B8 /* InjectedBundleBackForwardList.cpp */,
+				935EEB901277615D003322B8 /* InjectedBundleBackForwardList.h */,
+				935EEB911277615D003322B8 /* InjectedBundleBackForwardListItem.cpp */,
+				935EEB921277615D003322B8 /* InjectedBundleBackForwardListItem.h */,
 				BC498617124D10E200D834E1 /* InjectedBundleHitTestResult.cpp */,
 				BC498616124D10E200D834E1 /* InjectedBundleHitTestResult.h */,
 				E1EE53E611F8CFFB00CCBEE4 /* InjectedBundlePageEditorClient.cpp */,
@@ -1672,6 +1692,10 @@
 				BC204EE911C83EC8008F3375 /* WKBundle.cpp */,
 				BC204EEA11C83EC8008F3375 /* WKBundle.h */,
 				BC204EEB11C83EC8008F3375 /* WKBundleAPICast.h */,
+				935EEB951277616D003322B8 /* WKBundleBackForwardList.cpp */,
+				935EEB961277616D003322B8 /* WKBundleBackForwardList.h */,
+				935EEB971277616D003322B8 /* WKBundleBackForwardListItem.cpp */,
+				935EEB981277616D003322B8 /* WKBundleBackForwardListItem.h */,
 				BCD25F1611D6BDE100169B0E /* WKBundleFrame.cpp */,
 				BCD25F1511D6BDE100169B0E /* WKBundleFrame.h */,
 				BCF049E411FE20F600F86A58 /* WKBundleFramePrivate.h */,
@@ -2144,6 +2168,10 @@
 				1C8E28201275D15400BC7BD0 /* WebInspector.h in Headers */,
 				1C8E28341275D73800BC7BD0 /* WebInspectorProxy.h in Headers */,
 				1C8E293912761E5B00BC7BD0 /* WKInspector.h in Headers */,
+				935EEB9B1277617C003322B8 /* WKBundleBackForwardListItem.h in Headers */,
+				935EEB9F127761AC003322B8 /* WKBundleBackForwardList.h in Headers */,
+				935EEBA2127761D0003322B8 /* InjectedBundleBackForwardList.h in Headers */,
+				935EEBA4127761D6003322B8 /* InjectedBundleBackForwardListItem.h in Headers */,
 				1A616150127798B5003ACD86 /* DownloadManager.h in Headers */,
 				1A6161D41278981C003ACD86 /* Download.h in Headers */,
 			);
@@ -2459,6 +2487,10 @@
 				1C8E28211275D15400BC7BD0 /* WebInspector.cpp in Sources */,
 				1C8E28351275D73800BC7BD0 /* WebInspectorProxy.cpp in Sources */,
 				1C8E293A12761E5B00BC7BD0 /* WKInspector.cpp in Sources */,
+				935EEB9E127761AC003322B8 /* WKBundleBackForwardList.cpp in Sources */,
+				935EEBA0127761AC003322B8 /* WKBundleBackForwardListItem.cpp in Sources */,
+				935EEBA1127761CC003322B8 /* InjectedBundleBackForwardList.cpp in Sources */,
+				935EEBA3127761D3003322B8 /* InjectedBundleBackForwardListItem.cpp in Sources */,
 				1A61614F127798B5003ACD86 /* DownloadManager.cpp in Sources */,
 				1A6161D51278981C003ACD86 /* Download.cpp in Sources */,
 				1A61639612789B2F003ACD86 /* DownloadMac.mm in Sources */,
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
index 2539713..100a197 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
@@ -42,6 +42,8 @@ namespace WebCore {
 namespace WebKit {
 
 class InjectedBundle;
+class InjectedBundleBackForwardList;
+class InjectedBundleBackForwardListItem;
 class InjectedBundleHitTestResult;
 class InjectedBundleNodeHandle;
 class InjectedBundleRangeHandle;
@@ -49,6 +51,8 @@ class InjectedBundleScriptWorld;
 class WebFrame;
 class WebPage;
 
+WK_ADD_API_MAPPING(WKBundleBackForwardListRef, InjectedBundleBackForwardList)
+WK_ADD_API_MAPPING(WKBundleBackForwardListItemRef, InjectedBundleBackForwardListItem)
 WK_ADD_API_MAPPING(WKBundleCSSStyleDeclarationRef, WebCore::CSSStyleDeclaration)
 WK_ADD_API_MAPPING(WKBundleFrameRef, WebFrame)
 WK_ADD_API_MAPPING(WKBundleHitTestResultRef, InjectedBundleHitTestResult)
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp
new file mode 100644
index 0000000..288c676
--- /dev/null
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
+ */
+
+#include "WKBundleBackForwardList.h"
+
+#include "InjectedBundleBackForwardList.h"
+#include "InjectedBundleBackForwardListItem.h"
+#include "WKBundleAPICast.h"
+
+using namespace WebKit;
+
+WKTypeID WKBundleBackForwardListGetTypeID()
+{
+    return toAPI(InjectedBundleBackForwardList::APIType);
+}
+
+WKBundleBackForwardListItemRef WKBundleBackForwardListCopyItemAtIndex(WKBundleBackForwardListRef listRef, int index)
+{
+    return toAPI(toImpl(listRef)->itemAtIndex(index).leakRef());
+}
+
+unsigned WKBundleBackForwardListGetBackListCount(WKBundleBackForwardListRef listRef)
+{
+    return toImpl(listRef)->backListCount();
+}
+
+unsigned WKBundleBackForwardListGetForwardListCount(WKBundleBackForwardListRef listRef)
+{
+    return toImpl(listRef)->forwardListCount();
+}
+
+void WKBundleBackForwardListClear(WKBundleBackForwardListRef listRef)
+{
+    return toImpl(listRef)->clear();
+}
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.h
new file mode 100644
index 0000000..7aa573a
--- /dev/null
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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 WKBundleBackForwardList_h
+#define WKBundleBackForwardList_h
+
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKBundleBackForwardListGetTypeID();
+
+WK_EXPORT WKBundleBackForwardListItemRef WKBundleBackForwardListCopyItemAtIndex(WKBundleBackForwardListRef list, int index);
+
+WK_EXPORT unsigned WKBundleBackForwardListGetBackListCount(WKBundleBackForwardListRef list);
+WK_EXPORT unsigned WKBundleBackForwardListGetForwardListCount(WKBundleBackForwardListRef list);
+
+WK_EXPORT void WKBundleBackForwardListClear(WKBundleBackForwardListRef list);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKBundleBackForwardList_h
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp
new file mode 100644
index 0000000..cde15c4
--- /dev/null
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2010 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
+ */
+
+#include "WKBundleBackForwardListItem.h"
+
+#include "ImmutableArray.h"
+#include "InjectedBundleBackForwardListItem.h"
+#include "WKBundleAPICast.h"
+
+using namespace WebKit;
+
+WKTypeID WKBundleBackForwardListItemGetTypeID()
+{
+    return toAPI(InjectedBundleBackForwardListItem::APIType);
+}
+
+bool WKBundleBackForwardListItemIsSame(WKBundleBackForwardListItemRef itemRef1, WKBundleBackForwardListItemRef itemRef2)
+{
+    return toImpl(itemRef1)->item() == toImpl(itemRef2)->item();
+}
+
+WKURLRef WKBundleBackForwardListItemCopyOriginalURL(WKBundleBackForwardListItemRef itemRef)
+{
+    return toCopiedURLAPI(toImpl(itemRef)->originalURL());
+}
+
+WKURLRef WKBundleBackForwardListItemCopyURL(WKBundleBackForwardListItemRef itemRef)
+{
+    return toCopiedURLAPI(toImpl(itemRef)->url());
+}
+
+WKStringRef WKBundleBackForwardListItemCopyTitle(WKBundleBackForwardListItemRef itemRef)
+{
+    return toCopiedAPI(toImpl(itemRef)->title());
+}
+
+WKStringRef WKBundleBackForwardListItemCopyTarget(WKBundleBackForwardListItemRef itemRef)
+{
+    return toCopiedAPI(toImpl(itemRef)->target());
+}
+
+bool WKBundleBackForwardListItemIsTargetItem(WKBundleBackForwardListItemRef itemRef)
+{
+    return toImpl(itemRef)->isTargetItem();
+}
+
+WKArrayRef WKBundleBackForwardListItemCopyChildren(WKBundleBackForwardListItemRef itemRef)
+{
+    return toAPI(toImpl(itemRef)->children().leakRef());
+}
+
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h
new file mode 100644
index 0000000..f256464
--- /dev/null
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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 WKBundleBackForwardListItem_h
+#define WKBundleBackForwardListItem_h
+
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKBundleBackForwardListItemGetTypeID();
+
+WK_EXPORT bool WKBundleBackForwardListItemIsSame(WKBundleBackForwardListItemRef item1, WKBundleBackForwardListItemRef item2);
+
+WK_EXPORT WKURLRef WKBundleBackForwardListItemCopyOriginalURL(WKBundleBackForwardListItemRef item);
+WK_EXPORT WKURLRef WKBundleBackForwardListItemCopyURL(WKBundleBackForwardListItemRef item);
+WK_EXPORT WKStringRef WKBundleBackForwardListItemCopyTitle(WKBundleBackForwardListItemRef item);
+
+WK_EXPORT WKStringRef WKBundleBackForwardListItemCopyTarget(WKBundleBackForwardListItemRef item);
+WK_EXPORT bool WKBundleBackForwardListItemIsTargetItem(WKBundleBackForwardListItemRef item);
+
+WK_EXPORT WKArrayRef WKBundleBackForwardListItemCopyChildren(WKBundleBackForwardListItemRef item);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKBundleBackForwardListItem_h */
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
index 78684fa..089fceb 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
@@ -26,6 +26,7 @@
 #include "WKBundlePage.h"
 #include "WKBundlePagePrivate.h"
 
+#include "InjectedBundleBackForwardList.h"
 #include "WKAPICast.h"
 #include "WKBundleAPICast.h"
 #include "WebPage.h"
@@ -119,3 +120,8 @@ void WKBundlePageSetPageZoomFactor(WKBundlePageRef pageRef, double zoomFactor)
 {
     toImpl(pageRef)->setPageZoomFactor(zoomFactor);
 }
+
+WKBundleBackForwardListRef WKBundlePageGetBackForwardList(WKBundlePageRef pageRef)
+{
+    return toAPI(toImpl(pageRef)->backForwardList());
+}
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
index 1c02e11..53061de 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
@@ -190,6 +190,8 @@ WK_EXPORT void WKBundlePageSetUIClient(WKBundlePageRef page, WKBundlePageUIClien
 
 WK_EXPORT WKBundleFrameRef WKBundlePageGetMainFrame(WKBundlePageRef page);
 
+WK_EXPORT WKBundleBackForwardListRef WKBundlePageGetBackForwardList(WKBundlePageRef page);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h b/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h
index 82b75e1..755afd9 100644
--- a/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h
+++ b/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h
@@ -42,10 +42,10 @@ class InjectedBundleNodeHandle : public APIObject {
 public:
     static const Type APIType = TypeBundleNodeHandle;
 
-    static PassRefPtr<InjectedBundleNodeHandle> getOrCreate(JSContextRef context, JSObjectRef object);
+    static PassRefPtr<InjectedBundleNodeHandle> getOrCreate(JSContextRef, JSObjectRef);
     static PassRefPtr<InjectedBundleNodeHandle> getOrCreate(WebCore::Node*);
 
-    ~InjectedBundleNodeHandle();
+    virtual ~InjectedBundleNodeHandle();
 
     WebCore::Node* coreNode() const;
 
diff --git a/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h b/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h
index dbb28f9..4d6789a 100644
--- a/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h
+++ b/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h
@@ -43,7 +43,8 @@ public:
     static const Type APIType = TypeBundleRangeHandle;
 
     static PassRefPtr<InjectedBundleRangeHandle> getOrCreate(WebCore::Range*);
-    ~InjectedBundleRangeHandle();
+
+    virtual ~InjectedBundleRangeHandle();
 
     WebCore::Range* coreRange() const;
 
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp b/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp
new file mode 100644
index 0000000..9e7500e
--- /dev/null
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2010 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
+ */
+
+#include "InjectedBundleBackForwardList.h"
+
+#include "InjectedBundleBackForwardListItem.h"
+#include "WebBackForwardListProxy.h"
+#include "WebPage.h"
+#include <WebCore/Page.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PassRefPtr<InjectedBundleBackForwardListItem> InjectedBundleBackForwardList::itemAtIndex(int index) const
+{
+    if (!m_page)
+        return 0;
+    Page* page = m_page->corePage();
+    if (!page)
+        return 0;
+    return InjectedBundleBackForwardListItem::create(page->backForwardList()->itemAtIndex(index));
+}
+
+int InjectedBundleBackForwardList::backListCount() const
+{
+    if (!m_page)
+        return 0;
+    Page* page = m_page->corePage();
+    if (!page)
+        return 0;
+    return page->backForwardList()->backListCount();
+}
+
+int InjectedBundleBackForwardList::forwardListCount() const
+{
+    if (!m_page)
+        return 0;
+    Page* page = m_page->corePage();
+    if (!page)
+        return 0;
+    return page->backForwardList()->forwardListCount();
+}
+
+void InjectedBundleBackForwardList::clear()
+{
+    if (!m_page)
+        return;
+    Page* page = m_page->corePage();
+    if (!page)
+        return;
+    static_cast<WebBackForwardListProxy*>(page->backForwardList())->clear();
+}
+
+} // namespace WebKit
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.h b/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.h
new file mode 100644
index 0000000..952bdb6
--- /dev/null
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2010 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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 InjectedBundleBackForwardList_h
+#define InjectedBundleBackForwardList_h
+
+#include "APIObject.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WebKit {
+
+class WebPage;
+
+class InjectedBundleBackForwardListItem;
+
+class InjectedBundleBackForwardList : public APIObject {
+public:
+    static const Type APIType = TypeBundleBackForwardList;
+
+    static PassRefPtr<InjectedBundleBackForwardList> create(WebPage* page)
+    {
+        return adoptRef(new InjectedBundleBackForwardList(page));
+    }
+
+    void detach() { m_page = 0; }
+
+    void clear();
+
+    PassRefPtr<InjectedBundleBackForwardListItem> itemAtIndex(int) const;
+    int backListCount() const;
+    int forwardListCount() const;
+
+private:
+    InjectedBundleBackForwardList(WebPage* page) : m_page(page) { }
+
+    virtual Type type() const { return APIType; }
+
+    WebPage* m_page;
+};
+
+} // namespace WebKit
+
+#endif // InjectedBundleBackForwardList_h
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp b/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp
new file mode 100644
index 0000000..222dfa3
--- /dev/null
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2010 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
+ */
+
+#include "InjectedBundleBackForwardListItem.h"
+
+#include "ImmutableArray.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PassRefPtr<ImmutableArray> InjectedBundleBackForwardListItem::children() const
+{
+    const HistoryItemVector& children = m_item->children();
+    size_t size = children.size();
+    Vector<RefPtr<APIObject> > vector(size);
+    for (size_t i = 0; i < size; ++i)
+        vector[i] = InjectedBundleBackForwardListItem::create(children[i]);
+    return ImmutableArray::adopt(vector);
+}
+
+} // namespace WebKit
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h b/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h
new file mode 100644
index 0000000..6cd9ec6
--- /dev/null
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2010 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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 InjectedBundleBackForwardListItem_h
+#define InjectedBundleBackForwardListItem_h
+
+#include "APIObject.h"
+#include <WebCore/HistoryItem.h>
+
+namespace WebKit {
+
+class ImmutableArray;
+class WebPageProxy;
+
+class InjectedBundleBackForwardListItem : public APIObject {
+public:
+    static const Type APIType = TypeBundleBackForwardListItem;
+
+    static PassRefPtr<InjectedBundleBackForwardListItem> create(PassRefPtr<WebCore::HistoryItem> item)
+    {
+        if (!item)
+            return 0;
+        return adoptRef(new InjectedBundleBackForwardListItem(item));
+    }
+
+    WebCore::HistoryItem* item() const { return m_item.get(); }
+
+    const String& originalURL() const { return m_item->originalURLString(); }
+    const String& url() const { return m_item->urlString(); }
+    const String& title() const { return m_item->title(); }
+
+    const String& target() const { return m_item->target(); }
+    bool isTargetItem() const { return m_item->isTargetItem(); }
+
+    PassRefPtr<ImmutableArray> children() const;
+
+private:
+    InjectedBundleBackForwardListItem(PassRefPtr<WebCore::HistoryItem> item) : m_item(item) { }
+
+    virtual Type type() const { return APIType; }
+
+    RefPtr<WebCore::HistoryItem> m_item;
+};
+
+} // namespace WebKit
+
+#endif // InjectedBundleBackForwardListItem_h
diff --git a/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.h b/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.h
index 1356ae5..00dd14a 100644
--- a/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.h
+++ b/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.h
@@ -44,7 +44,7 @@ public:
     static PassRefPtr<InjectedBundleScriptWorld> getOrCreate(WebCore::DOMWrapperWorld*);
     static InjectedBundleScriptWorld* normalWorld();
 
-    ~InjectedBundleScriptWorld();
+    virtual ~InjectedBundleScriptWorld();
 
     WebCore::DOMWrapperWorld* coreWorld() const;
 
diff --git a/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp b/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp
index dc3ca69..3b02fd1 100644
--- a/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp
+++ b/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp
@@ -101,20 +101,13 @@ HistoryItem* WebBackForwardListProxy::itemForID(uint64_t itemID)
 
 WebBackForwardListProxy::WebBackForwardListProxy(WebPage* page)
     : m_page(page)
-    , m_capacity(DefaultCapacity)
-    , m_closed(true)
-    , m_enabled(true)
 {
     WebCore::notifyHistoryItemChanged = WK2NotifyHistoryItemChanged;
 }
 
-WebBackForwardListProxy::~WebBackForwardListProxy()
-{
-}
-
 void WebBackForwardListProxy::addItem(PassRefPtr<HistoryItem> prpItem)
 {
-    if (!m_capacity || !m_enabled)
+    if (!m_page)
         return;
 
     RefPtr<HistoryItem> item = prpItem;
@@ -122,73 +115,21 @@ void WebBackForwardListProxy::addItem(PassRefPtr<HistoryItem> prpItem)
     WebProcess::shared().connection()->send(Messages::WebPageProxy::BackForwardAddItem(itemID), m_page->pageID());
 }
 
-void WebBackForwardListProxy::goBack()
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebBackForwardListProxy::goForward()
-{
-    ASSERT_NOT_REACHED();
-}
-
 void WebBackForwardListProxy::goToItem(HistoryItem* item)
 {
+    if (!m_page)
+        return;
+
     uint64_t itemID = historyItemToIDMap().get(item);
     WebProcess::shared().connection()->send(Messages::WebPageProxy::BackForwardGoToItem(itemID), m_page->pageID());
 
 }
 
-HistoryItem* WebBackForwardListProxy::backItem()
-{
-    uint64_t backItemID = 0;
-    if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::BackForwardBackItem(),
-             Messages::WebPageProxy::BackForwardBackItem::Reply(backItemID),
-             m_page->pageID(), CoreIPC::Connection::NoTimeout)) {
-        return 0;
-    }
-
-    if (!backItemID)
-        return 0;
-
-    RefPtr<HistoryItem> item = idToHistoryItemMap().get(backItemID);
-    return item.get();
-}
-
-HistoryItem* WebBackForwardListProxy::currentItem()
-{
-    uint64_t currentItemID = 0;
-    if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::BackForwardCurrentItem(),
-             Messages::WebPageProxy::BackForwardCurrentItem::Reply(currentItemID),
-             m_page->pageID(), CoreIPC::Connection::NoTimeout)) {
-        return 0;
-    }
-
-    if (!currentItemID)
-        return 0;
-
-    RefPtr<HistoryItem> item = idToHistoryItemMap().get(currentItemID);
-    return item.get();
-}
-
-HistoryItem* WebBackForwardListProxy::forwardItem()
+HistoryItem* WebBackForwardListProxy::itemAtIndex(int itemIndex)
 {
-    uint64_t forwardItemID = 0;
-    if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::BackForwardForwardItem(),
-             Messages::WebPageProxy::BackForwardForwardItem::Reply(forwardItemID),
-             m_page->pageID(), CoreIPC::Connection::NoTimeout)) {
+    if (!m_page)
         return 0;
-    }
 
-    if (!forwardItemID)
-        return 0;
-
-    RefPtr<HistoryItem> item = idToHistoryItemMap().get(forwardItemID);
-    return item.get();
-}
-
-HistoryItem* WebBackForwardListProxy::itemAtIndex(int itemIndex)
-{
     uint64_t itemID = 0;
     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::BackForwardItemAtIndex(itemIndex),
              Messages::WebPageProxy::BackForwardItemAtIndex::Reply(itemID),
@@ -203,38 +144,11 @@ HistoryItem* WebBackForwardListProxy::itemAtIndex(int itemIndex)
     return item.get();
 }
 
-void WebBackForwardListProxy::backListWithLimit(int, HistoryItemVector&)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebBackForwardListProxy::forwardListWithLimit(int, HistoryItemVector&)
-{
-    ASSERT_NOT_REACHED();
-}
-
-int WebBackForwardListProxy::capacity()
-{
-    return m_capacity;
-}
-
-void WebBackForwardListProxy::setCapacity(int capacity)
-{
-    m_capacity = capacity;
-}
-
-bool WebBackForwardListProxy::enabled()
-{
-    return m_enabled;
-}
-
-void WebBackForwardListProxy::setEnabled(bool enabled)
-{
-    m_enabled = enabled;
-}
-
 int WebBackForwardListProxy::backListCount()
 {
+    if (!m_page)
+        return 0;
+
     int backListCount = 0;
     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::BackForwardBackListCount(),
              Messages::WebPageProxy::BackForwardBackListCount::Reply(backListCount),
@@ -247,6 +161,9 @@ int WebBackForwardListProxy::backListCount()
 
 int WebBackForwardListProxy::forwardListCount()
 {
+    if (!m_page)
+        return 0;
+
     int forwardListCount = 0;
     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::BackForwardForwardListCount(),
              Messages::WebPageProxy::BackForwardForwardListCount::Reply(forwardListCount),
@@ -257,30 +174,20 @@ int WebBackForwardListProxy::forwardListCount()
     return forwardListCount;
 }
 
-bool WebBackForwardListProxy::containsItem(HistoryItem*)
-{
-    return false;
-}
-
 void WebBackForwardListProxy::close()
 {
-    m_closed = true;
     m_page = 0;
 }
 
-bool WebBackForwardListProxy::closed()
-{
-    return m_closed;
-}
-
-void WebBackForwardListProxy::removeItem(HistoryItem*)
+bool WebBackForwardListProxy::isActive()
 {
+    // FIXME: Should check the the list is enabled and has non-zero capacity.
+    return true;
 }
 
-HistoryItemVector& WebBackForwardListProxy::entries()
+void WebBackForwardListProxy::clear()
 {
-    static HistoryItemVector noEntries;
-    return noEntries;
+    WebProcess::shared().connection()->send(Messages::WebPageProxy::BackForwardClear(), m_page->pageID());
 }
 
 #if ENABLE(WML)
diff --git a/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.h b/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.h
index 836655c..bdefa3e 100644
--- a/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.h
+++ b/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.h
@@ -35,49 +35,31 @@ class WebPage;
 class WebBackForwardListProxy : public WebCore::BackForwardList {
 public: 
     static PassRefPtr<WebBackForwardListProxy> create(WebPage* page) { return adoptRef(new WebBackForwardListProxy(page)); }
-    ~WebBackForwardListProxy();
 
     static WebCore::HistoryItem* itemForID(uint64_t);
 
-    void addItem(PassRefPtr<WebCore::HistoryItem>);
-    void goBack();
-    void goForward();
-    void goToItem(WebCore::HistoryItem*);
-        
-    WebCore::HistoryItem* backItem();
-    WebCore::HistoryItem* currentItem();
-    WebCore::HistoryItem* forwardItem();
-    WebCore::HistoryItem* itemAtIndex(int);
+    void clear();
+
+private:
+    WebBackForwardListProxy(WebPage*);
 
-    void backListWithLimit(int, WebCore::HistoryItemVector&);
-    void forwardListWithLimit(int, WebCore::HistoryItemVector&);
+    virtual void addItem(PassRefPtr<WebCore::HistoryItem>);
 
-    int capacity();
-    void setCapacity(int);
-    bool enabled();
-    void setEnabled(bool);
-    int backListCount();
-    int forwardListCount();
-    bool containsItem(WebCore::HistoryItem*);
+    virtual void goToItem(WebCore::HistoryItem*);
+        
+    virtual WebCore::HistoryItem* itemAtIndex(int);
+    virtual int backListCount();
+    virtual int forwardListCount();
 
-    void close();
-    bool closed();
-    
-    void removeItem(WebCore::HistoryItem*);
-    WebCore::HistoryItemVector& entries();
+    virtual bool isActive();
+
+    virtual void close();
     
 #if ENABLE(WML)
     void clearWMLPageHistory();
 #endif
 
-private:
-    WebBackForwardListProxy(WebPage*);
-    
     WebPage* m_page;
-
-    unsigned m_capacity;
-    bool m_closed;
-    bool m_enabled;
 };
 
 } // namespace WebKit
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index 5bcd639..48b30a8 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -28,6 +28,7 @@
 #include "Arguments.h"
 #include "DrawingArea.h"
 #include "InjectedBundle.h"
+#include "InjectedBundleBackForwardList.h"
 #include "MessageID.h"
 #include "NetscapePlugin.h"
 #include "PageOverlay.h"
@@ -138,7 +139,11 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
 
 WebPage::~WebPage()
 {
+    if (m_backForwardList)
+        m_backForwardList->detach();
+
     ASSERT(!m_page);
+
 #if PLATFORM(MAC)
     ASSERT(m_pluginViews.isEmpty());
 #endif
@@ -927,4 +932,11 @@ void WebPage::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Messag
     didReceiveWebPageMessage(connection, messageID, arguments);
 }
 
+InjectedBundleBackForwardList* WebPage::backForwardList()
+{
+    if (!m_backForwardList)
+        m_backForwardList = InjectedBundleBackForwardList::create(this);
+    return m_backForwardList.get();
+}
+
 } // namespace WebKit
diff --git a/WebKit2/WebProcess/WebPage/WebPage.h b/WebKit2/WebProcess/WebPage/WebPage.h
index 277d06b..9728e54 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/WebKit2/WebProcess/WebPage/WebPage.h
@@ -64,6 +64,7 @@ namespace WebCore {
 namespace WebKit {
 
 class DrawingArea;
+class InjectedBundleBackForwardList;
 class PageOverlay;
 class PluginView;
 class WebEvent;
@@ -73,18 +74,21 @@ class WebKeyboardEvent;
 class WebMouseEvent;
 class WebPopupMenu;
 class WebWheelEvent;
+
+struct WebPageCreationParameters;
+struct WebPreferencesStore;
+
 #if ENABLE(TOUCH_EVENTS)
 class WebTouchEvent;
 #endif
-struct WebPageCreationParameters;
-struct WebPreferencesStore;
 
 class WebPage : public APIObject {
 public:
     static const Type APIType = TypeBundlePage;
 
     static PassRefPtr<WebPage> create(uint64_t pageID, const WebPageCreationParameters&);
-    ~WebPage();
+
+    virtual ~WebPage();
 
     void close();
 
@@ -94,8 +98,8 @@ public:
     void setSize(const WebCore::IntSize&);
     const WebCore::IntSize& size() const { return m_viewSize; }
 
+    InjectedBundleBackForwardList* backForwardList();
     DrawingArea* drawingArea() const { return m_drawingArea.get(); }
-
     WebInspector* inspector();
 
     // -- Called by the DrawingArea.
@@ -243,6 +247,7 @@ private:
 
     OwnPtr<WebCore::Page> m_page;
     RefPtr<WebFrame> m_mainFrame;
+    RefPtr<InjectedBundleBackForwardList> m_backForwardList;
 
     String m_customUserAgent;
 
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index 7954a2c..c399472 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -1272,6 +1272,22 @@
 					>
 				</File>
 				<File
+					RelativePath="..\WebProcess\InjectedBundle\InjectedBundleBackForwardList.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\WebProcess\InjectedBundle\InjectedBundleBackForwardList.h"
+					>
+				</File>
+				<File
+					RelativePath="..\WebProcess\InjectedBundle\InjectedBundleBackForwardListItem.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\WebProcess\InjectedBundle\InjectedBundleBackForwardListItem.h"
+					>
+				</File>
+				<File
 					RelativePath="..\WebProcess\InjectedBundle\InjectedBundleHitTestResult.cpp"
 					>
 				</File>
@@ -1342,6 +1358,22 @@
 							>
 						</File>
 						<File
+							RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundleBackForwardList.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundleBackForwardList.h"
+							>
+						</File>
+						<File
+							RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundleBackForwardListItem.cpp"
+							>
+						</File>
+						<File
+							RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundleBackForwardListItem.h"
+							>
+						</File>
+						<File
 							RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundleFrame.cpp"
 							>
 						</File>
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index d9a65f6..86f39dc 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,84 @@
+2010-10-26  Darin Adler  <darin at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        WebKitTestRunner needs to support layoutTestController.dumpBackForwardList
+        https://bugs.webkit.org/show_bug.cgi?id=42322
+        rdar://problem/8193631
+
+        WebKitTestRunner needs to support layoutTestController.clearBackForwardList
+        https://bugs.webkit.org/show_bug.cgi?id=42333
+        rdar://problem/8193643
+
+        * WebKitTestRunner/Configurations/InjectedBundle.xcconfig:
+        Renamed the product to WebKitTestRunnerInjectedBundle to avoid
+        name conflicts in the build directory.
+
+        * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+        Added dumpBackForwardList and clearBackForwardList.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::InjectedBundle): Removed initialization of m_mainPage.
+        (WTR::InjectedBundle::didCreatePage): Removed unneeded underscore.
+        (WTR::InjectedBundle::willDestroyPage): Ditto.
+        (WTR::InjectedBundle::didReceiveMessage): Ditto.
+        (WTR::InjectedBundle::initialize): Ditto.
+        (WTR::InjectedBundle::didCreatePage): Changed code to use m_pages
+        instead of m_mainPage and m_otherPages.
+        (WTR::InjectedBundle::willDestroyPage): Ditto.
+        (WTR::InjectedBundle::page): Ditto.
+        (WTR::InjectedBundle::beginTesting): Ditto.
+        (WTR::InjectedBundle::done): Ditto.
+        (WTR::InjectedBundle::closeOtherPages): Ditto.
+        (WTR::InjectedBundle::dumpBackForwardListsForAllPages): Added.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.h: Changed
+        page function to longer be inline, and pageCount function
+        to use m_pages. Added dumpBackForwardListsForAllPages, and
+        removed some underscores. Replaced m_mainPage and m_otherPageas
+        with m_pages.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::adoptWK): Added.
+        (WTR::hasPrefix): Added.
+        (WTR::InjectedBundlePage::reset): Added code to set up
+        m_previousTestBackForwardListItem.
+        (WTR::InjectedBundlePage::dump): Added code to call
+        dumpBackForwardListsForAllPages.
+        (WTR::compareByTargetName): Added.
+        (WTR::dumpBackForwardListItem): Added.
+        (WTR::InjectedBundlePage::dumpBackForwardList): Added.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Added
+        dumpBackForwardList and m_previousTestBackForwardListItem.
+
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+        (WTR::LayoutTestController::LayoutTestController): Initialize
+        m_shouldDumpBackForwardListsForAllWindows to false.
+        (WTR::LayoutTestController::clearBackForwardList): Added.
+
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+        Added dumpBackForwardList, clearBackForwardList,
+        shouldDumpBackForwardListsForAllWindows, and
+        m_shouldDumpBackForwardListsForAllWindows.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::initialize): Set up
+        didReceiveSynchronousMessageFromInjectedBundle.
+        (WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):
+        Added.
+        * WebKitTestRunner/TestController.h: Ditto.
+
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
+        Added.
+        * WebKitTestRunner/TestInvocation.h: Ditto.
+
+        * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+        Renamed bundle to WebKitTestRunnerInjectedBundle (see above).
+        * WebKitTestRunner/mac/TestControllerMac.mm:
+        (WTR::TestController::initializeInjectedBundlePath): Ditto.
+
 2010-10-27  Chris Rogers  <crogers at google.com>
 
         Reviewed by Chris Marrin.
diff --git a/WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig
index 4d3d1ee..dcf4be0 100644
--- a/WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig
+++ b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig
@@ -21,4 +21,4 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
-PRODUCT_NAME = InjectedBundle
+PRODUCT_NAME = WebKitTestRunnerInjectedBundle
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
index 33515b4..a0e36ad 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
@@ -33,6 +33,7 @@ module WTR {
         void notifyDone();
 
         // Other dumping.
+        void dumpBackForwardList();
         void dumpChildFrameScrollPositions();
         void dumpEditingCallbacks();
         void dumpSelectionRect();
@@ -45,14 +46,15 @@ module WTR {
         void setCanOpenWindows(in boolean value);
         void setCloseRemainingWindowsWhenComplete(in boolean value);
         void setXSSAuditorEnabled(in boolean value);
-        unsigned long windowCount();
 
         // Special DOM functions.
+        void clearBackForwardList();
         object computedStyleIncludingVisitedInfo(in object element);
         DOMString counterValueForElementById(in DOMString elementId);
-        DOMString markerTextForListItem(in object element);
         void execCommand(in DOMString name, in DOMString argument);
         boolean isCommandEnabled(in DOMString name);
+        DOMString markerTextForListItem(in object element);
+        unsigned long windowCount();
 
         // Repaint testing.
         void testRepaint();
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
index af8bb69..6bc1802 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
@@ -27,6 +27,7 @@
 
 #include "ActivateFonts.h"
 #include "InjectedBundlePage.h"
+#include "StringFunctions.h"
 #include <WebKit2/WKBundle.h>
 #include <WebKit2/WKBundlePage.h>
 #include <WebKit2/WKBundlePagePrivate.h>
@@ -46,22 +47,21 @@ InjectedBundle& InjectedBundle::shared()
 
 InjectedBundle::InjectedBundle()
     : m_bundle(0)
-    , m_mainPage(0)
     , m_state(Idle)
 {
 }
 
-void InjectedBundle::_didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
+void InjectedBundle::didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
 {
     static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->didCreatePage(page);
 }
 
-void InjectedBundle::_willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
+void InjectedBundle::willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
 {
     static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->willDestroyPage(page);
 }
 
-void InjectedBundle::_didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo)
+void InjectedBundle::didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo)
 {
     static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->didReceiveMessage(messageName, messageBody);
 }
@@ -73,9 +73,9 @@ void InjectedBundle::initialize(WKBundleRef bundle)
     WKBundleClient client = {
         0,
         this,
-        _didCreatePage,
-        _willDestroyPage,
-        _didReceiveMessage
+        didCreatePage,
+        willDestroyPage,
+        didReceiveMessage
     };
     WKBundleSetClient(m_bundle, &client);
 
@@ -85,20 +85,25 @@ void InjectedBundle::initialize(WKBundleRef bundle)
 
 void InjectedBundle::didCreatePage(WKBundlePageRef page)
 {
-    // FIXME: we really need the main page ref to be sent over from the ui process
-    OwnPtr<InjectedBundlePage> pageWrapper = adoptPtr(new InjectedBundlePage(page));
-    if (!m_mainPage)
-        m_mainPage = pageWrapper.release();
-    else
-        m_otherPages.add(page, pageWrapper.leakPtr());
+    m_pages.append(adoptPtr(new InjectedBundlePage(page)));
 }
 
 void InjectedBundle::willDestroyPage(WKBundlePageRef page)
 {
-    if (m_mainPage && m_mainPage->page() == page)
-        m_mainPage.clear();
-    else
-        delete m_otherPages.take(page);
+    size_t size = m_pages.size();
+    for (size_t i = 0; i < size; ++i) {
+        if (m_pages[i]->page() == page) {
+            m_pages.remove(i);
+            break;
+        }
+    }
+}
+
+InjectedBundlePage* InjectedBundle::page() const
+{
+    // It might be better to have the UI process send over a reference to the main
+    // page instead of just assuming it's the first one.
+    return m_pages[0].get();
 }
 
 void InjectedBundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody)
@@ -134,14 +139,14 @@ void InjectedBundle::beginTesting()
 
     WKBundleRemoveAllUserContent(m_bundle);
 
-    m_mainPage->reset();
+    page()->reset();
 }
 
 void InjectedBundle::done()
 {
     m_state = Stopping;
 
-    m_mainPage->stopLoading();
+    page()->stopLoading();
 
     WKRetainPtr<WKStringRef> doneMessageName(AdoptWK, WKStringCreateWithUTF8CString("Done"));
     WKRetainPtr<WKStringRef> doneMessageBody(AdoptWK, WKStringCreateWithUTF8CString(m_outputStream.str().c_str()));
@@ -153,10 +158,20 @@ void InjectedBundle::done()
 
 void InjectedBundle::closeOtherPages()
 {
-    Vector<WKBundlePageRef> pages;
-    copyKeysToVector(m_otherPages, pages);
-    for (size_t i = 0; i < pages.size(); ++i)
-        WKBundlePageClose(pages[i]);
+    Vector<WKBundlePageRef> pagesToClose;
+    size_t size = m_pages.size();
+    for (size_t i = 1; i < size; ++i)
+        pagesToClose.append(m_pages[i]->page());
+    size = pagesToClose.size();
+    for (size_t i = 0; i < size; ++i)
+        WKBundlePageClose(pagesToClose[i]);
+}
+
+void InjectedBundle::dumpBackForwardListsForAllPages()
+{
+    size_t size = m_pages.size();
+    for (size_t i = 0; i < size; ++i)
+        m_pages[i]->dumpBackForwardList();
 }
 
 } // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
index 6c5c69e..2c6d14b 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
@@ -30,9 +30,9 @@
 #include "GCController.h"
 #include "LayoutTestController.h"
 #include <WebKit2/WKBase.h>
-#include <wtf/HashMap.h>
 #include <wtf/OwnPtr.h>
 #include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
 
 #include <sstream>
 
@@ -53,10 +53,12 @@ public:
     GCController* gcController() { return m_gcController.get(); }
     EventSendingController* eventSendingController() { return m_eventSendingController.get(); }
 
-    InjectedBundlePage* page() { return m_mainPage.get(); }
-    size_t pageCount() { return !!m_mainPage + m_otherPages.size(); }
+    InjectedBundlePage* page() const;
+    size_t pageCount() const { return m_pages.size(); }
     void closeOtherPages();
 
+    void dumpBackForwardListsForAllPages();
+
     void done();
     std::ostringstream& os() { return m_outputStream; }
 
@@ -66,19 +68,18 @@ private:
     InjectedBundle();
     ~InjectedBundle();
 
-    static void _didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo);
-    static void _willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo);
-    static void _didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo);
+    static void didCreatePage(WKBundleRef, WKBundlePageRef, const void* clientInfo);
+    static void willDestroyPage(WKBundleRef, WKBundlePageRef, const void* clientInfo);
+    static void didReceiveMessage(WKBundleRef, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo);
 
-    void didCreatePage(WKBundlePageRef page);
-    void willDestroyPage(WKBundlePageRef page);
+    void didCreatePage(WKBundlePageRef);
+    void willDestroyPage(WKBundlePageRef);
     void didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody);
 
     void beginTesting();
 
     WKBundleRef m_bundle;
-    HashMap<WKBundlePageRef, InjectedBundlePage*> m_otherPages;
-    OwnPtr<InjectedBundlePage> m_mainPage;
+    Vector<OwnPtr<InjectedBundlePage> > m_pages;
 
     RefPtr<LayoutTestController> m_layoutTestController;
     RefPtr<GCController> m_gcController;
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index f449c84..b3f3698 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -30,6 +30,9 @@
 #include <cmath>
 #include <JavaScriptCore/JSRetainPtr.h>
 #include <WebKit2/WKArray.h>
+#include <WebKit2/WKBundle.h>
+#include <WebKit2/WKBundleBackForwardList.h>
+#include <WebKit2/WKBundleBackForwardListItem.h>
 #include <WebKit2/WKBundleFrame.h>
 #include <WebKit2/WKBundleFramePrivate.h>
 #include <WebKit2/WKBundlePagePrivate.h>
@@ -38,6 +41,16 @@ using namespace std;
 
 namespace WTR {
 
+template<typename T> static inline WKRetainPtr<T> adoptWK(T item)
+{
+    return WKRetainPtr<T>(AdoptWK, item);
+}
+
+static bool hasPrefix(const string& string, const string& prefix)
+{
+    return string.length() >= prefix.length() && string.substr(0, prefix.length()) == prefix;
+}
+
 static JSValueRef propertyValue(JSContextRef context, JSObjectRef object, const char* propertyName)
 {
     if (!object)
@@ -228,6 +241,8 @@ void InjectedBundlePage::reset()
 
     WKBundlePageSetPageZoomFactor(m_page, 1);
     WKBundlePageSetTextZoomFactor(m_page, 1);
+
+    m_previousTestBackForwardListItem = adoptWK(WKBundleBackForwardListCopyItemAtIndex(WKBundlePageGetBackForwardList(m_page), 0));
 }
 
 // Loader Client Callbacks
@@ -413,6 +428,9 @@ void InjectedBundlePage::dump()
     else if (InjectedBundle::shared().layoutTestController()->shouldDumpMainFrameScrollPosition())
         dumpFrameScrollPosition(WKBundlePageGetMainFrame(m_page));
 
+    if (InjectedBundle::shared().layoutTestController()->shouldDumpBackForwardListsForAllWindows())
+        InjectedBundle::shared().dumpBackForwardListsForAllPages();
+
     InjectedBundle::shared().done();
 }
 
@@ -765,4 +783,89 @@ void InjectedBundlePage::didChangeSelection(WKStringRef notificationName)
         InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidChangeSelection:" << notificationName << "\n";
 }
 
+static bool compareByTargetName(WKBundleBackForwardListItemRef item1, WKBundleBackForwardListItemRef item2)
+{
+    return toSTD(adoptWK(WKBundleBackForwardListItemCopyTarget(item1))) < toSTD(adoptWK(WKBundleBackForwardListItemCopyTarget(item2)));
+}
+
+static void dumpBackForwardListItem(WKBundleBackForwardListItemRef item, unsigned indent, bool isCurrentItem)
+{
+    unsigned column = 0;
+    if (isCurrentItem) {
+        InjectedBundle::shared().os() << "curr->";
+        column = 6;
+    }
+    for (unsigned i = column; i < indent; i++)
+        InjectedBundle::shared().os() << ' ';
+
+    string url = toSTD(adoptWK(WKURLCopyString(adoptWK(WKBundleBackForwardListItemCopyURL(item)).get())));
+    if (hasPrefix(url, "file:")) {
+        string directoryName = "/LayoutTests/";
+        size_t start = url.find(directoryName);
+        if (start == string::npos)
+            start = 0;
+        else
+            start += directoryName.size();
+        InjectedBundle::shared().os() << "(file test):" << url.substr(start);
+    } else
+        InjectedBundle::shared().os() << url;
+
+    string target = toSTD(adoptWK(WKBundleBackForwardListItemCopyTarget(item)));
+    if (target.length())
+        InjectedBundle::shared().os() << " (in frame \"" << target << "\")";
+
+    // FIXME: Need WKBackForwardListItemIsTargetItem.
+    if (WKBundleBackForwardListItemIsTargetItem(item))
+        InjectedBundle::shared().os() << "  **nav target**";
+
+    InjectedBundle::shared().os() << '\n';
+
+    if (WKRetainPtr<WKArrayRef> kids = adoptWK(WKBundleBackForwardListItemCopyChildren(item))) {
+        // Sort to eliminate arbitrary result ordering which defeats reproducible testing.
+        size_t size = WKArrayGetSize(kids.get());
+        Vector<WKBundleBackForwardListItemRef> sortedKids(size);
+        for (size_t i = 0; i < size; ++i)
+            sortedKids[i] = static_cast<WKBundleBackForwardListItemRef>(WKArrayGetItemAtIndex(kids.get(), i));
+        stable_sort(sortedKids.begin(), sortedKids.end(), compareByTargetName);
+        for (size_t i = 0; i < size; ++i)
+            dumpBackForwardListItem(sortedKids[i], indent + 4, false);
+    }
+}
+
+void InjectedBundlePage::dumpBackForwardList()
+{
+    InjectedBundle::shared().os() << "\n============== Back Forward List ==============\n";
+
+    WKBundleBackForwardListRef list = WKBundlePageGetBackForwardList(m_page);
+
+    // Print out all items in the list after m_previousTestBackForwardListItem.
+    // Gather items from the end of the list, then print them out from oldest to newest.
+    Vector<WKRetainPtr<WKBundleBackForwardListItemRef> > itemsToPrint;
+    for (unsigned i = WKBundleBackForwardListGetForwardListCount(list); i; --i) {
+        WKRetainPtr<WKBundleBackForwardListItemRef> item = adoptWK(WKBundleBackForwardListCopyItemAtIndex(list, i));
+        // Something is wrong if the item from the last test is in the forward part of the list.
+        ASSERT(!WKBundleBackForwardListItemIsSame(item.get(), m_previousTestBackForwardListItem.get()));
+        itemsToPrint.append(item);
+    }
+
+    ASSERT(!WKBundleBackForwardListItemIsSame(adoptWK(WKBundleBackForwardListCopyItemAtIndex(list, 0)).get(), m_previousTestBackForwardListItem.get()));
+
+    itemsToPrint.append(adoptWK(WKBundleBackForwardListCopyItemAtIndex(list, 0)));
+
+    int currentItemIndex = itemsToPrint.size() - 1;
+
+    int backListCount = WKBundleBackForwardListGetBackListCount(list);
+    for (int i = -1; i >= -backListCount; --i) {
+        WKRetainPtr<WKBundleBackForwardListItemRef> item = adoptWK(WKBundleBackForwardListCopyItemAtIndex(list, i));
+        if (WKBundleBackForwardListItemIsSame(item.get(), m_previousTestBackForwardListItem.get()))
+            break;
+        itemsToPrint.append(item);
+    }
+
+    for (int i = itemsToPrint.size() - 1; i >= 0; i--)
+        dumpBackForwardListItem(itemsToPrint[i].get(), 8, i == currentItemIndex);
+
+    InjectedBundle::shared().os() << "===============================================\n";
+}
+
 } // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
index e153b85..b95744f 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
@@ -45,6 +45,8 @@ public:
 
     void reset();
 
+    void dumpBackForwardList();
+
 private:
     // Loader Client
     static void didStartProvisionalLoadForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
@@ -119,6 +121,7 @@ private:
 
     WKBundlePageRef m_page;
     WKRetainPtr<WKBundleScriptWorldRef> m_world;
+    WKRetainPtr<WKBundleBackForwardListItemRef> m_previousTestBackForwardListItem;
     bool m_isLoading;
 };
 
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
index 9875020..e828c46 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
@@ -29,6 +29,7 @@
 #include "InjectedBundlePage.h"
 #include "JSLayoutTestController.h"
 #include "StringFunctions.h"
+#include <WebKit2/WKBundleBackForwardList.h>
 #include <WebKit2/WKBundleFrame.h>
 #include <WebKit2/WKBundleFramePrivate.h>
 #include <WebKit2/WKBundlePagePrivate.h>
@@ -85,6 +86,7 @@ PassRefPtr<LayoutTestController> LayoutTestController::create()
 LayoutTestController::LayoutTestController()
     : m_whatToDump(RenderTree)
     , m_shouldDumpAllFrameScrollPositions(false)
+    , m_shouldDumpBackForwardListsForAllWindows(false)
     , m_shouldAllowEditing(true)
     , m_shouldCloseExtraWindows(false)
     , m_dumpEditingCallbacks(false)
@@ -240,6 +242,11 @@ unsigned LayoutTestController::windowCount()
     return InjectedBundle::shared().pageCount();
 }
 
+void LayoutTestController::clearBackForwardList()
+{
+    WKBundleBackForwardListClear(WKBundlePageGetBackForwardList(InjectedBundle::shared().page()->page()));
+}
+
 // Object Creation
 
 void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
index 16754bd..dfafb55 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
@@ -60,6 +60,7 @@ public:
     void notifyDone();
 
     // Other dumping.
+    void dumpBackForwardList() { m_shouldDumpBackForwardListsForAllWindows = true; }
     void dumpChildFrameScrollPositions() { m_shouldDumpAllFrameScrollPositions = true; }
     void dumpEditingCallbacks() { m_dumpEditingCallbacks = true; }
     void dumpSelectionRect() { } // Will need to do something when we support pixel tests.
@@ -72,14 +73,15 @@ public:
     void setCanOpenWindows(bool);
     void setCloseRemainingWindowsWhenComplete(bool value) { m_shouldCloseExtraWindows = value; }
     void setXSSAuditorEnabled(bool);
-    unsigned windowCount();
 
     // Special DOM functions.
     JSValueRef computedStyleIncludingVisitedInfo(JSValueRef element);
     JSRetainPtr<JSStringRef> counterValueForElementById(JSStringRef elementId);
-    JSRetainPtr<JSStringRef> markerTextForListItem(JSValueRef element);
+    void clearBackForwardList();
     void execCommand(JSStringRef name, JSStringRef argument);
     bool isCommandEnabled(JSStringRef name);
+    JSRetainPtr<JSStringRef> markerTextForListItem(JSValueRef element);
+    unsigned windowCount();
 
     // Repaint testing.
     void testRepaint() { m_testRepaint = true; }
@@ -101,9 +103,9 @@ public:
     WhatToDump whatToDump() const { return m_whatToDump; }
 
     bool shouldDumpAllFrameScrollPositions() const { return m_shouldDumpAllFrameScrollPositions; }
+    bool shouldDumpBackForwardListsForAllWindows() const { return m_shouldDumpBackForwardListsForAllWindows; }
     bool shouldDumpEditingCallbacks() const { return m_dumpEditingCallbacks; }
     bool shouldDumpMainFrameScrollPosition() const { return m_whatToDump == RenderTree; }
-
     bool shouldDumpStatusCallbacks() const { return m_dumpStatusCallbacks; }
     bool shouldDumpTitleChanges() const { return m_dumpTitleChanges; }
 
@@ -125,6 +127,7 @@ private:
 
     WhatToDump m_whatToDump;
     bool m_shouldDumpAllFrameScrollPositions;
+    bool m_shouldDumpBackForwardListsForAllWindows;
 
     bool m_shouldAllowEditing;
     bool m_shouldCloseExtraWindows;
diff --git a/WebKitTools/WebKitTestRunner/TestController.cpp b/WebKitTools/WebKitTestRunner/TestController.cpp
index 69c0265..f141d3c 100644
--- a/WebKitTools/WebKitTestRunner/TestController.cpp
+++ b/WebKitTools/WebKitTestRunner/TestController.cpp
@@ -181,7 +181,7 @@ void TestController::initialize(int argc, const char* argv[])
         0,
         this,
         didReceiveMessageFromInjectedBundle,
-        0
+        didReceiveSynchronousMessageFromInjectedBundle
     };
     WKContextSetInjectedBundleClient(m_context.get(), &injectedBundleClient);
 
@@ -314,11 +314,21 @@ void TestController::didReceiveMessageFromInjectedBundle(WKContextRef context, W
     static_cast<TestController*>(const_cast<void*>(clientInfo))->didReceiveMessageFromInjectedBundle(messageName, messageBody);
 }
 
+void TestController::didReceiveSynchronousMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData, const void* clientInfo)
+{
+    *returnData = static_cast<TestController*>(const_cast<void*>(clientInfo))->didReceiveSynchronousMessageFromInjectedBundle(messageName, messageBody).leakRef();
+}
+
 void TestController::didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody)
 {
     m_currentInvocation->didReceiveMessageFromInjectedBundle(messageName, messageBody);
 }
 
+WKRetainPtr<WKTypeRef> TestController::didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody)
+{
+    return m_currentInvocation->didReceiveSynchronousMessageFromInjectedBundle(messageName, messageBody);
+}
+
 // WKPageLoaderClient
 
 void TestController::didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef, const void* clientInfo)
diff --git a/WebKitTools/WebKitTestRunner/TestController.h b/WebKitTools/WebKitTestRunner/TestController.h
index a9e6ab3..b12f1b2 100644
--- a/WebKitTools/WebKitTestRunner/TestController.h
+++ b/WebKitTools/WebKitTestRunner/TestController.h
@@ -71,8 +71,10 @@ private:
     void resetStateToConsistentValues();
 
     // WKContextInjectedBundleClient
-    static void didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void*);
+    static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, const void*);
+    static void didReceiveSynchronousMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData, const void*);
     void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
+    WKRetainPtr<WKTypeRef> didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
 
     // WKPageLoaderClient
     static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void*);
diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.cpp b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
index c1bf894..04a56f1 100644
--- a/WebKitTools/WebKitTestRunner/TestInvocation.cpp
+++ b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
@@ -182,4 +182,10 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName
     ASSERT_NOT_REACHED();
 }
 
+WKRetainPtr<WKTypeRef> TestInvocation::didReceiveSynchronousMessageFromInjectedBundle(WKStringRef /*messageName*/, WKTypeRef /*messageBody*/)
+{
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
 } // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.h b/WebKitTools/WebKitTestRunner/TestInvocation.h
index 1b33e49..fec1f7a 100644
--- a/WebKitTools/WebKitTestRunner/TestInvocation.h
+++ b/WebKitTools/WebKitTestRunner/TestInvocation.h
@@ -38,6 +38,7 @@ public:
 
     void invoke();
     void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
+    WKRetainPtr<WKTypeRef> didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
 
 private:
     void dump(const char*);
diff --git a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
index 599e09e..a15fe41 100644
--- a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
+++ b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
@@ -95,7 +95,7 @@
 		BC14E4E8120E03D800826C0C /* JSGCController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSGCController.cpp; path = DerivedSources/WebKitTestRunner/JSGCController.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
 		BC14E4E9120E03D800826C0C /* JSGCController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSGCController.h; path = DerivedSources/WebKitTestRunner/JSGCController.h; sourceTree = BUILT_PRODUCTS_DIR; };
 		BC25184611D15767002EBC01 /* InjectedBundleMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleMain.cpp; sourceTree = "<group>"; };
-		BC25186211D15D54002EBC01 /* InjectedBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InjectedBundle.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
+		BC25186211D15D54002EBC01 /* WebKitTestRunnerInjectedBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WebKitTestRunnerInjectedBundle.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
 		BC25186311D15D54002EBC01 /* InjectedBundle-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "InjectedBundle-Info.plist"; sourceTree = "<group>"; };
 		BC25197111D15E61002EBC01 /* InjectedBundle.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = InjectedBundle.xcconfig; sourceTree = "<group>"; };
 		BC251A1711D16774002EBC01 /* WebKitTestRunnerPrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitTestRunnerPrefix.h; sourceTree = "<group>"; };
@@ -203,7 +203,7 @@
 			isa = PBXGroup;
 			children = (
 				8DD76FA10486AA7600D96B5E /* WebKitTestRunner */,
-				BC25186211D15D54002EBC01 /* InjectedBundle.bundle */,
+				BC25186211D15D54002EBC01 /* WebKitTestRunnerInjectedBundle.bundle */,
 			);
 			name = Products;
 			sourceTree = "<group>";
@@ -343,9 +343,9 @@
 			productReference = 8DD76FA10486AA7600D96B5E /* WebKitTestRunner */;
 			productType = "com.apple.product-type.tool";
 		};
-		BC25186111D15D54002EBC01 /* InjectedBundle */ = {
+		BC25186111D15D54002EBC01 /* WebKitTestRunnerInjectedBundle */ = {
 			isa = PBXNativeTarget;
-			buildConfigurationList = BC25186611D15D55002EBC01 /* Build configuration list for PBXNativeTarget "InjectedBundle" */;
+			buildConfigurationList = BC25186611D15D55002EBC01 /* Build configuration list for PBXNativeTarget "WebKitTestRunnerInjectedBundle" */;
 			buildPhases = (
 				BC25185E11D15D54002EBC01 /* Resources */,
 				BC25185F11D15D54002EBC01 /* Sources */,
@@ -356,9 +356,9 @@
 			dependencies = (
 				BC952ED711F3C38B003398B4 /* PBXTargetDependency */,
 			);
-			name = InjectedBundle;
+			name = WebKitTestRunnerInjectedBundle;
 			productName = InjectedBundle;
-			productReference = BC25186211D15D54002EBC01 /* InjectedBundle.bundle */;
+			productReference = BC25186211D15D54002EBC01 /* WebKitTestRunnerInjectedBundle.bundle */;
 			productType = "com.apple.product-type.bundle";
 		};
 /* End PBXNativeTarget section */
@@ -381,7 +381,7 @@
 			projectRoot = "";
 			targets = (
 				8DD76F960486AA7600D96B5E /* WebKitTestRunner */,
-				BC25186111D15D54002EBC01 /* InjectedBundle */,
+				BC25186111D15D54002EBC01 /* WebKitTestRunnerInjectedBundle */,
 				BC952D7711F3BF5D003398B4 /* Derived Sources */,
 			);
 		};
@@ -462,7 +462,7 @@
 /* Begin PBXTargetDependency section */
 		BC25194211D15D94002EBC01 /* PBXTargetDependency */ = {
 			isa = PBXTargetDependency;
-			target = BC25186111D15D54002EBC01 /* InjectedBundle */;
+			target = BC25186111D15D54002EBC01 /* WebKitTestRunnerInjectedBundle */;
 			targetProxy = BC25194111D15D94002EBC01 /* PBXContainerItemProxy */;
 		};
 		BC952ED711F3C38B003398B4 /* PBXTargetDependency */ = {
@@ -558,7 +558,7 @@
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Release;
 		};
-		BC25186611D15D55002EBC01 /* Build configuration list for PBXNativeTarget "InjectedBundle" */ = {
+		BC25186611D15D55002EBC01 /* Build configuration list for PBXNativeTarget "WebKitTestRunnerInjectedBundle" */ = {
 			isa = XCConfigurationList;
 			buildConfigurations = (
 				BC25186411D15D55002EBC01 /* Debug */,
diff --git a/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
index dbe35e2..be9aa33 100644
--- a/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
+++ b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
@@ -36,7 +36,7 @@ void TestController::platformInitialize()
 
 void TestController::initializeInjectedBundlePath()
 {
-    NSString *nsBundlePath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"InjectedBundle.bundle"];
+    NSString *nsBundlePath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"WebKitTestRunnerInjectedBundle.bundle"];
     m_injectedBundlePath.adopt(WKStringCreateWithCFString((CFStringRef)nsBundlePath));
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list