Clean up unnecessary methods in the BackForwardClient interface
authorburg@cs.washington.edu <burg@cs.washington.edu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Apr 2014 20:42:19 +0000 (20:42 +0000)
committerburg@cs.washington.edu <burg@cs.washington.edu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Apr 2014 20:42:19 +0000 (20:42 +0000)
commitb036452a9bc6b6a474ba38f88f8a9a213094cea4
tree3b727871051b63631757837ba2af84835acfaacd
parentc19ca534186f972f5b228fe31606e803281eb94e
Clean up unnecessary methods in the BackForwardClient interface
https://bugs.webkit.org/show_bug.cgi?id=131637

Reviewed by Andreas Kling.

Source/WebCore:
Demote back/current/forwardItem and iOS-specific methods from the
BackForwardClient interface. Convert the class to not be refcounted.

No new tests, no behavior was changed.

* WebCore.exp.in:
* history/BackForwardClient.h:
(WebCore::BackForwardClient::~BackForwardClient): Deleted.
(WebCore::BackForwardClient::backItem): Deleted.
(WebCore::BackForwardClient::currentItem): Deleted.
(WebCore::BackForwardClient::forwardItem): Deleted.
* history/BackForwardController.cpp:
(WebCore::BackForwardController::BackForwardController):
* history/BackForwardController.h: Take ownership of the passed BackForwardClient.
(WebCore::BackForwardController::client): Return a reference.
* history/BackForwardList.h: Remove the Page field, since it isn't used any more.
(WebCore::BackForwardList::create): Deleted.
* page/Page.h: Remove RefPtr from PageClient.
* page/Page.cpp:
(WebCore::PageClients::PageClients): Initialize client to nullptr.

Source/WebKit/efl:
Remove uses of reference counting for BackForwardList.
Use references to BackForwardClient instead of pointers.
Stop using BackForwardClient::page() since it was removed.

* ewk/ewk_history.cpp:
(ewk_history_clear):
(ewk_history_new):
(ewk_history_free):
* ewk/ewk_view.cpp:
(_ewk_view_priv_new):
(ewk_view_history_enable_get):
(ewk_view_history_enable_set):
(ewk_view_history_get):

Source/WebKit/mac:
BackForwardClient instances now have ownership lifetime semantics, so
WebBackForwardList now explicitly deletes its inner BackForwardList.

Convert uses of WebCore::BackForwardList through backForward().client() to
accept references instead of pointers.

Use BackForwardController methods rather than directly operating with the
BackForwardClient where possible.

Remove page cache-related methods that are not used anywhere and that call
BackForwardClient::page(), which is removed by this change.

* History/WebBackForwardList.mm:
(-[WebBackForwardList initWithBackForwardList:]):
(-[WebBackForwardList init]):
(-[WebBackForwardList dealloc]):
(-[WebBackForwardList finalize]):
(-[WebBackForwardList setPageCacheSize]): Deleted.
(-[WebBackForwardList pageCacheSize]): Deleted.
(-[WebBackForwardList itemAtIndex:]): Deleted.
* History/WebBackForwardListInternal.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::canCachePage):
* WebView/WebFrameView.mm:
(-[WebFrameView keyDown:keyDown:]):
* WebView/WebView.mm:
(-[WebView _loadBackForwardListFromOtherView:]):
(-[WebView initWithCoder:]):
(-[WebView encodeWithCoder:]):
(-[WebView backForwardList]):
(-[WebView setMaintainsBackForwardList:]):

Source/WebKit/win:
Remove uses of reference counting for BackForwardList.
Use BackForwardController instead of BackForwardClient where possible.

* WebBackForwardList.cpp:
(WebBackForwardList::WebBackForwardList):
(WebBackForwardList::~WebBackForwardList):
(WebBackForwardList::createInstance):
* WebBackForwardList.h:
* WebView.cpp:
(WebView::backForwardList):
(WebView::canGoBack):
(WebView::canGoForward):
(WebView::loadBackForwardListFromOtherView):

Source/WebKit2:
Remove stubs for iOS-specific methods in the BackForwardClient interface.

Construct a WebBackForwardListProxy directly, and make the WebCore page
own the BackForwardClient instance. Convert uses of backForward().client()
to accept references instead of raw pointers.

* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp:
(WebKit::InjectedBundleBackForwardList::clear):
* WebProcess/WebPage/WebBackForwardListProxy.cpp: Store a reference to
WebCore::Page instead of a pointer.
(WebKit::WebBackForwardListProxy::WebBackForwardListProxy):
(WebKit::WebBackForwardListProxy::create): Deleted.
(WebKit::WebBackForwardListProxy::addItem):
(WebKit::WebBackForwardListProxy::goToItem):
(WebKit::WebBackForwardListProxy::itemAtIndex):
(WebKit::WebBackForwardListProxy::backListCount):
(WebKit::WebBackForwardListProxy::forwardListCount):
(WebKit::WebBackForwardListProxy::close):
(WebKit::WebBackForwardListProxy::clear):
(WebKit::WebBackForwardListProxy::isActive):
* WebProcess/WebPage/WebBackForwardListProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168041 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/history/BackForwardClient.h
Source/WebCore/history/BackForwardController.cpp
Source/WebCore/history/BackForwardController.h
Source/WebCore/history/BackForwardList.cpp
Source/WebCore/history/BackForwardList.h
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/ewk/ewk_history.cpp
Source/WebKit/efl/ewk/ewk_view.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/History/WebBackForwardList.mm
Source/WebKit/mac/History/WebBackForwardListInternal.h
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit/mac/WebView/WebFrameView.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebBackForwardList.cpp
Source/WebKit/win/WebBackForwardList.h
Source/WebKit/win/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp
Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp
Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm [deleted file]