⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 184056 in webkit


Ignore:
Timestamp:
May 10, 2015, 2:45:25 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Get rid of the public item accessors in BackForwardClient
https://bugs.webkit.org/show_bug.cgi?id=144827

Patch by Sungmann Cho <sungmann.cho@navercorp.com> on 2015-05-10
Reviewed by Darin Adler.

Remove backItem(), currentItem(), and forwardItem() from BackForwardClient.
We can still use these functionalities through BackForwardController.

No new tests, no behavior change.

Source/WebCore:

  • history/BackForwardClient.h:

(WebCore::BackForwardClient::backItem): Deleted.
(WebCore::BackForwardClient::currentItem): Deleted.
(WebCore::BackForwardClient::forwardItem): Deleted.

Source/WebKit/mac:

  • WebView/WebView.mm:

(-[WebView _loadBackForwardListFromOtherView:]):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r184055 r184056  
     12015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
     2
     3        Get rid of the public item accessors in BackForwardClient
     4        https://bugs.webkit.org/show_bug.cgi?id=144827
     5
     6        Reviewed by Darin Adler.
     7
     8        Remove backItem(), currentItem(), and forwardItem() from BackForwardClient.
     9        We can still use these functionalities through BackForwardController.
     10
     11        No new tests, no behavior change.
     12
     13        * history/BackForwardClient.h:
     14        (WebCore::BackForwardClient::backItem): Deleted.
     15        (WebCore::BackForwardClient::currentItem): Deleted.
     16        (WebCore::BackForwardClient::forwardItem): Deleted.
     17
    1182015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
    219
  • trunk/Source/WebCore/history/BackForwardClient.h

    r179472 r184056  
    6060    virtual bool clearAllPageCaches() = 0;
    6161#endif
    62 
    63     // FIXME: Delete these once all callers are using BackForwardController
    64     // instead of calling this directly.
    65     HistoryItem* backItem() { return itemAtIndex(-1); }
    66     HistoryItem* currentItem() { return itemAtIndex(0); }
    67     HistoryItem* forwardItem() { return itemAtIndex(1); }
    6862};
    6963
  • trunk/Source/WebKit/mac/ChangeLog

    r184040 r184056  
     12015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
     2
     3        Get rid of the public item accessors in BackForwardClient
     4        https://bugs.webkit.org/show_bug.cgi?id=144827
     5
     6        Reviewed by Darin Adler.
     7
     8        Remove backItem(), currentItem(), and forwardItem() from BackForwardClient.
     9        We can still use these functionalities through BackForwardController.
     10
     11        No new tests, no behavior change.
     12
     13        * WebView/WebView.mm:
     14        (-[WebView _loadBackForwardListFromOtherView:]):
     15
    1162015-05-09  Yoav Weiss  <yoav@yoav.ws>
    217
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r183976 r184056  
    20092009    // in the back forward list, and go to the current one.
    20102010
    2011     BackForwardClient* backForwardClient = _private->page->backForward().client();
    2012     ASSERT(!backForwardClient->currentItem()); // destination list should be empty
    2013 
    2014     BackForwardClient* otherBackForwardClient = otherView->_private->page->backForward().client();
    2015     if (!otherBackForwardClient->currentItem())
     2011    BackForwardController& backForward = _private->page->backForward();
     2012    ASSERT(!backForward.currentItem()); // destination list should be empty
     2013
     2014    BackForwardController& otherBackForward = otherView->_private->page->backForward();
     2015    if (!otherBackForward.currentItem())
    20162016        return; // empty back forward list, bail
    20172017   
    20182018    HistoryItem* newItemToGoTo = nullptr;
    20192019
    2020     int lastItemIndex = otherBackForwardClient->forwardListCount();
    2021     for (int i = -otherBackForwardClient->backListCount(); i <= lastItemIndex; ++i) {
     2020    int lastItemIndex = otherBackForward.forwardCount();
     2021    for (int i = -otherBackForward.backCount(); i <= lastItemIndex; ++i) {
    20222022        if (i == 0) {
    20232023            // If this item is showing , save away its current scroll and form state,
     
    20262026            otherView->_private->page->mainFrame().loader().history().saveDocumentAndScrollState();
    20272027        }
    2028         Ref<HistoryItem> newItem = otherBackForwardClient->itemAtIndex(i)->copy();
     2028        Ref<HistoryItem> newItem = otherBackForward.itemAtIndex(i)->copy();
    20292029        if (i == 0)
    20302030            newItemToGoTo = newItem.ptr();
    2031         backForwardClient->addItem(WTF::move(newItem));
    2032     }
    2033    
     2031        backForward.client()->addItem(WTF::move(newItem));
     2032    }
     2033
    20342034    ASSERT(newItemToGoTo);
    20352035    _private->page->goToItem(*newItemToGoTo, FrameLoadType::IndexedBackForward);
  • trunk/Source/WebKit/win/WebView.cpp

    r183181 r184056  
    39663966        /* [retval][out] */ BOOL* result)
    39673967{
    3968     *result = !!(m_page->backForward().client()->backItem() && !m_page->defersLoading());
     3968    *result = !!(m_page->backForward().backItem() && !m_page->defersLoading());
    39693969    return S_OK;
    39703970}
     
    39813981        /* [retval][out] */ BOOL* result)
    39823982{
    3983     *result = !!(m_page->backForward().client()->forwardItem() && !m_page->defersLoading());
     3983    *result = !!(m_page->backForward().forwardItem() && !m_page->defersLoading());
    39843984    return S_OK;
    39853985}
     
    54925492    // type.  (See behavior matrix at the top of WebFramePrivate.)  So we copy all the items
    54935493    // in the back forward list, and go to the current one.
    5494     BackForwardClient* backForwardClient = m_page->backForward().client();
    5495     ASSERT(!backForwardClient->currentItem()); // destination list should be empty
     5494    BackForwardController& backForward = m_page->backForward();
     5495    ASSERT(!backForward.currentItem()); // destination list should be empty
    54965496
    54975497    COMPtr<WebView> otherWebView;
    54985498    if (FAILED(otherView->QueryInterface(&otherWebView)))
    54995499        return E_FAIL;
    5500     BackForwardClient* otherBackForwardClient = otherWebView->m_page->backForward().client();
    5501     if (!otherBackForwardClient->currentItem())
     5500    BackForwardController& otherBackForward = otherWebView->m_page->backForward();
     5501    if (!otherBackForward.currentItem())
    55025502        return S_OK; // empty back forward list, bail
    55035503   
    55045504    HistoryItem* newItemToGoTo = 0;
    55055505
    5506     int lastItemIndex = otherBackForwardClient->forwardListCount();
    5507     for (int i = -otherBackForwardClient->backListCount(); i <= lastItemIndex; ++i) {
     5506    int lastItemIndex = otherBackForward.forwardCount();
     5507    for (int i = -otherBackForward.backCount(); i <= lastItemIndex; ++i) {
    55085508        if (!i) {
    55095509            // If this item is showing , save away its current scroll and form state,
     
    55125512            otherWebView->m_page->mainFrame().loader().history().saveDocumentAndScrollState();
    55135513        }
    5514         Ref<HistoryItem> newItem = otherBackForwardClient->itemAtIndex(i)->copy();
     5514        Ref<HistoryItem> newItem = otherBackForward.itemAtIndex(i)->copy();
    55155515        if (!i)
    55165516            newItemToGoTo = newItem.ptr();
    5517         backForwardClient->addItem(WTF::move(newItem));
     5517        backForward.client()->addItem(WTF::move(newItem));
    55185518    }
    55195519   
Note: See TracChangeset for help on using the changeset viewer.