Changeset 235139 in webkit


Ignore:
Timestamp:
Aug 21, 2018 2:14:36 PM (6 years ago)
Author:
achristensen@apple.com
Message:

Remove unused shouldKeepCurrentBackForwardListItemInList check
https://bugs.webkit.org/show_bug.cgi?id=188805

Reviewed by Andy Estes.

Source/WebKit:

The check was only done in WKPageLoaderClient, and nobody implements the check.
It was not needed to put in WKPageNavigationClient or WKNavigationDelegate, so let's remove it!
This removes the unused ability to go back and remove the current back/forward list item.

  • UIProcess/API/APILoaderClient.h:

(API::LoaderClient::didChangeBackForwardList):
(API::LoaderClient::shouldKeepCurrentBackForwardListItemInList): Deleted.

  • UIProcess/API/C/WKPage.cpp:

(WKPageSetPageLoaderClient):

  • UIProcess/WebBackForwardList.cpp:

(WebKit::WebBackForwardList::addItem):
(WebKit::WebBackForwardList::goToItem):

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList): Deleted.

  • UIProcess/WebPageProxy.h:

Tools:

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKit/ShouldKeepCurrentBackForwardListItemInList.cpp: Removed.
Location:
trunk
Files:
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r235137 r235139  
     12018-08-21  Alex Christensen  <achristensen@webkit.org>
     2
     3        Remove unused shouldKeepCurrentBackForwardListItemInList check
     4        https://bugs.webkit.org/show_bug.cgi?id=188805
     5
     6        Reviewed by Andy Estes.
     7
     8        The check was only done in WKPageLoaderClient, and nobody implements the check.
     9        It was not needed to put in WKPageNavigationClient or WKNavigationDelegate, so let's remove it!
     10        This removes the unused ability to go back and remove the current back/forward list item.
     11
     12        * UIProcess/API/APILoaderClient.h:
     13        (API::LoaderClient::didChangeBackForwardList):
     14        (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList): Deleted.
     15        * UIProcess/API/C/WKPage.cpp:
     16        (WKPageSetPageLoaderClient):
     17        * UIProcess/WebBackForwardList.cpp:
     18        (WebKit::WebBackForwardList::addItem):
     19        (WebKit::WebBackForwardList::goToItem):
     20        * UIProcess/WebPageProxy.cpp:
     21        (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList): Deleted.
     22        * UIProcess/WebPageProxy.h:
     23
    1242018-08-21  Wenson Hsieh  <wenson_hsieh@apple.com>
    225
  • trunk/Source/WebKit/UIProcess/API/APILoaderClient.h

    r232668 r235139  
    9191
    9292    virtual void didChangeBackForwardList(WebKit::WebPageProxy&, WebKit::WebBackForwardListItem*, Vector<Ref<WebKit::WebBackForwardListItem>>&&) { }
    93     virtual bool shouldKeepCurrentBackForwardListItemInList(WebKit::WebPageProxy&, WebKit::WebBackForwardListItem&) { return true; }
    9493    virtual void willGoToBackForwardListItem(WebKit::WebPageProxy&, WebKit::WebBackForwardListItem&, API::Object*) { }
    9594
  • trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp

    r234989 r235139  
    10431043        {
    10441044            initialize(client);
     1045            ASSERT(!m_client.shouldKeepCurrentBackForwardListItemInList);
    10451046        }
    10461047
     
    12471248
    12481249            m_client.didChangeBackForwardList(toAPI(&page), toAPI(addedItem), toAPI(removedItemsArray.get()), m_client.base.clientInfo);
    1249         }
    1250 
    1251         bool shouldKeepCurrentBackForwardListItemInList(WebKit::WebPageProxy& page, WebKit::WebBackForwardListItem& item) override
    1252         {
    1253             if (!m_client.shouldKeepCurrentBackForwardListItemInList)
    1254                 return true;
    1255 
    1256             return m_client.shouldKeepCurrentBackForwardListItemInList(toAPI(&page), toAPI(&item), m_client.base.clientInfo);
    12571250        }
    12581251
  • trunk/Source/WebKit/UIProcess/WebBackForwardList.cpp

    r234714 r235139  
    142142        m_currentIndex = 0;
    143143        m_hasCurrentIndex = true;
    144     } else {
    145         shouldKeepCurrentItem = m_page->shouldKeepCurrentBackForwardListItemInList(m_entries[m_currentIndex]);
    146         if (shouldKeepCurrentItem)
    147             m_currentIndex++;
    148     }
     144    } else
     145        m_currentIndex++;
    149146
    150147    auto* newItemPtr = newItem.ptr();
     
    199196    // item should remain in the list.
    200197    auto& currentItem = m_entries[m_currentIndex];
    201     bool shouldKeepCurrentItem = true;
    202     if (currentItem.ptr() != &item) {
     198    if (currentItem.ptr() != &item)
    203199        m_page->recordAutomaticNavigationSnapshot();
    204         shouldKeepCurrentItem = m_page->shouldKeepCurrentBackForwardListItemInList(m_entries[m_currentIndex]);
    205     }
    206 
    207     // If the client said to remove the current item, remove it and then update the target index.
    208     Vector<Ref<WebBackForwardListItem>> removedItems;
    209     if (!shouldKeepCurrentItem) {
    210         removedItems.append(currentItem.copyRef());
    211         m_entries.remove(m_currentIndex);
    212         targetIndex = notFound;
    213         for (size_t i = 0; i < m_entries.size(); ++i) {
    214             if (m_entries[i].ptr() == &item) {
    215                 targetIndex = i;
    216                 break;
    217             }
    218         }
    219         ASSERT(targetIndex != notFound);
    220     }
    221200
    222201    m_currentIndex = targetIndex;
    223202
    224203    LOG(BackForward, "(Back/Forward) WebBackForwardList %p going to item %s, is now at index %zu", this, item.itemID().logString(), targetIndex);
    225 
    226     m_page->didChangeBackForwardList(nullptr, WTFMove(removedItems));
    227204}
    228205
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r235137 r235139  
    12911291}
    12921292
    1293 bool WebPageProxy::shouldKeepCurrentBackForwardListItemInList(WebBackForwardListItem& item)
    1294 {
    1295     PageClientProtector protector(m_pageClient);
    1296 
    1297     return m_loaderClient->shouldKeepCurrentBackForwardListItemInList(*this, item);
    1298 }
    1299 
    13001293bool WebPageProxy::canShowMIMEType(const String& mimeType)
    13011294{
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r235137 r235139  
    469469    void willGoToBackForwardListItem(const WebCore::BackForwardItemIdentifier&, bool inPageCache, const UserData&);
    470470
    471     bool shouldKeepCurrentBackForwardListItemInList(WebBackForwardListItem&);
    472 
    473471    bool willHandleHorizontalScrollEvents() const;
    474472
  • trunk/Tools/ChangeLog

    r235138 r235139  
     12018-08-21  Alex Christensen  <achristensen@webkit.org>
     2
     3        Remove unused shouldKeepCurrentBackForwardListItemInList check
     4        https://bugs.webkit.org/show_bug.cgi?id=188805
     5
     6        Reviewed by Andy Estes.
     7
     8        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     9        * TestWebKitAPI/Tests/WebKit/ShouldKeepCurrentBackForwardListItemInList.cpp: Removed.
     10
    1112018-08-21  Alex Christensen  <achristensen@webkit.org>
    212
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r234976 r235139  
    535535                7CCE7F121A411AE600447C4C /* ScrollPinningBehaviors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D640B5417875DFF00BFAF99 /* ScrollPinningBehaviors.cpp */; };
    536536                7CCE7F131A411AE600447C4C /* ShouldGoToBackForwardListItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FCF7981534AC6D00104491 /* ShouldGoToBackForwardListItem.cpp */; };
    537                 7CCE7F141A411AE600447C4C /* ShouldKeepCurrentBackForwardListItemInList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E5C7041919EA5F00D8B3E1 /* ShouldKeepCurrentBackForwardListItemInList.cpp */; };
    538537                7CCE7F151A411AE600447C4C /* SpacebarScrolling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C02B77F1126612140026BF0F /* SpacebarScrolling.cpp */; };
    539538                7CCE7F161A411AE600447C4C /* TerminateTwice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE72F47173EB214006362F0 /* TerminateTwice.cpp */; };
     
    15001499                51D124971E763AF8002B2820 /* WKHTTPCookieStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKHTTPCookieStore.mm; sourceTree = "<group>"; };
    15011500                51DB16CD1F085047001FA4C5 /* WebViewIconLoading.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WebViewIconLoading.mm; sourceTree = "<group>"; };
    1502                 51E5C7041919EA5F00D8B3E1 /* ShouldKeepCurrentBackForwardListItemInList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShouldKeepCurrentBackForwardListItemInList.cpp; sourceTree = "<group>"; };
    15031501                51E6A8921D2F1BEC00C004B6 /* LocalStorageClear.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalStorageClear.mm; sourceTree = "<group>"; };
    15041502                51E6A8951D2F1C7700C004B6 /* LocalStorageClear.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = LocalStorageClear.html; sourceTree = "<group>"; };
     
    29392937                                51FCF7981534AC6D00104491 /* ShouldGoToBackForwardListItem.cpp */,
    29402938                                51FCF7971534AC6D00104491 /* ShouldGoToBackForwardListItem_Bundle.cpp */,
    2941                                 51E5C7041919EA5F00D8B3E1 /* ShouldKeepCurrentBackForwardListItemInList.cpp */,
    29422939                                C02B77F1126612140026BF0F /* SpacebarScrolling.cpp */,
    29432940                                76734997193016DC00E44DF9 /* StopLoadingDuringDidFailProvisionalLoad.cpp */,
     
    39483945                                A179918B1E1CA24100A505ED /* SharedBufferTest.cpp in Sources */,
    39493946                                7CCE7F131A411AE600447C4C /* ShouldGoToBackForwardListItem.cpp in Sources */,
    3950                                 7CCE7F141A411AE600447C4C /* ShouldKeepCurrentBackForwardListItemInList.cpp in Sources */,
    39513947                                37BCA61C1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm in Sources */,
    39523948                                7C83E0C51D0A654600FEBCF3 /* ShrinkToFit.mm in Sources */,
Note: See TracChangeset for help on using the changeset viewer.