BackForwardClient needs to be able to support UIProcess-only back/forward lists
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Oct 2018 20:37:36 +0000 (20:37 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Oct 2018 20:37:36 +0000 (20:37 +0000)
commit31df67e59ae759b04ac0f840e1eddb6e538cd97d
treea80a62f4904488dab1cd491deda914524cfea1ea
parentefc8971a1fe7024cef151e73d9225c3f4d31e8b1
BackForwardClient needs to be able to support UIProcess-only back/forward lists
https://bugs.webkit.org/show_bug.cgi?id=190675

Reviewed by Chris Dumez.

Source/WebCore:

Return a RefPtr<HistoryItem> instead of a HistoryItem so that we will be able to return a
HistoryItem that has been created instead of a pointer to a HistoryItem that is owned by something else.
Also use unsigned for the back and forward list counts because they can never be negative.

* history/BackForwardClient.h:
* history/BackForwardController.cpp:
(WebCore::BackForwardController::backItem):
(WebCore::BackForwardController::currentItem):
(WebCore::BackForwardController::forwardItem):
(WebCore::BackForwardController::canGoBackOrForward const):
(WebCore::BackForwardController::goBackOrForward):
(WebCore::BackForwardController::goBack):
(WebCore::BackForwardController::goForward):
(WebCore::BackForwardController::count const):
(WebCore::BackForwardController::backCount const):
(WebCore::BackForwardController::forwardCount const):
(WebCore::BackForwardController::itemAtIndex):
* history/BackForwardController.h:
(WebCore::BackForwardController::backItem): Deleted.
(WebCore::BackForwardController::currentItem): Deleted.
(WebCore::BackForwardController::forwardItem): Deleted.
* loader/EmptyClients.cpp:
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::scheduleHistoryNavigation):

Source/WebKit:

* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::itemAtIndex const):
(WebKit::WebBackForwardList::backListCount const):
(WebKit::WebBackForwardList::forwardListCount const):
* UIProcess/WebBackForwardList.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::backForwardBackListCount):
(WebKit::WebPageProxy::backForwardForwardListCount):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::itemAtIndex):
(WebKit::WebBackForwardListProxy::backListCount const):
(WebKit::WebBackForwardListProxy::forwardListCount const):
* WebProcess/WebPage/WebBackForwardListProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::dumpHistoryForTesting):

Source/WebKitLegacy/mac:

* History/BackForwardList.h:
* History/BackForwardList.mm:
(BackForwardList::backItem):
(BackForwardList::currentItem):
(BackForwardList::forwardItem):
(BackForwardList::backListCount const):
(BackForwardList::forwardListCount const):
(BackForwardList::itemAtIndex):
* History/WebBackForwardList.mm:
(-[WebBackForwardList backItem]):
(-[WebBackForwardList currentItem]):
(-[WebBackForwardList forwardItem]):
(-[WebBackForwardList itemAtIndex:]):

Source/WebKitLegacy/win:

* BackForwardList.cpp:
(BackForwardList::backItem):
(BackForwardList::currentItem):
(BackForwardList::forwardItem):
(BackForwardList::backListCount const):
(BackForwardList::forwardListCount const):
(BackForwardList::itemAtIndex):
* BackForwardList.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237233 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
Source/WebCore/ChangeLog
Source/WebCore/history/BackForwardClient.h
Source/WebCore/history/BackForwardController.cpp
Source/WebCore/history/BackForwardController.h
Source/WebCore/loader/EmptyClients.cpp
Source/WebCore/loader/NavigationScheduler.cpp
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebBackForwardList.cpp
Source/WebKit/UIProcess/WebBackForwardList.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebPageProxy.messages.in
Source/WebKit/WebProcess/WebPage/WebBackForwardListProxy.cpp
Source/WebKit/WebProcess/WebPage/WebBackForwardListProxy.h
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/History/BackForwardList.h
Source/WebKitLegacy/mac/History/BackForwardList.mm
Source/WebKitLegacy/mac/History/WebBackForwardList.mm
Source/WebKitLegacy/win/BackForwardList.cpp
Source/WebKitLegacy/win/BackForwardList.h
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebBackForwardList.cpp