Changeset 235139 in webkit
- Timestamp:
- Aug 21, 2018 2:14:36 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r235137 r235139 1 2018-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 1 24 2018-08-21 Wenson Hsieh <wenson_hsieh@apple.com> 2 25 -
trunk/Source/WebKit/UIProcess/API/APILoaderClient.h
r232668 r235139 91 91 92 92 virtual void didChangeBackForwardList(WebKit::WebPageProxy&, WebKit::WebBackForwardListItem*, Vector<Ref<WebKit::WebBackForwardListItem>>&&) { } 93 virtual bool shouldKeepCurrentBackForwardListItemInList(WebKit::WebPageProxy&, WebKit::WebBackForwardListItem&) { return true; }94 93 virtual void willGoToBackForwardListItem(WebKit::WebPageProxy&, WebKit::WebBackForwardListItem&, API::Object*) { } 95 94 -
trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp
r234989 r235139 1043 1043 { 1044 1044 initialize(client); 1045 ASSERT(!m_client.shouldKeepCurrentBackForwardListItemInList); 1045 1046 } 1046 1047 … … 1247 1248 1248 1249 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) override1252 {1253 if (!m_client.shouldKeepCurrentBackForwardListItemInList)1254 return true;1255 1256 return m_client.shouldKeepCurrentBackForwardListItemInList(toAPI(&page), toAPI(&item), m_client.base.clientInfo);1257 1250 } 1258 1251 -
trunk/Source/WebKit/UIProcess/WebBackForwardList.cpp
r234714 r235139 142 142 m_currentIndex = 0; 143 143 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++; 149 146 150 147 auto* newItemPtr = newItem.ptr(); … … 199 196 // item should remain in the list. 200 197 auto& currentItem = m_entries[m_currentIndex]; 201 bool shouldKeepCurrentItem = true; 202 if (currentItem.ptr() != &item) { 198 if (currentItem.ptr() != &item) 203 199 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 }221 200 222 201 m_currentIndex = targetIndex; 223 202 224 203 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));227 204 } 228 205 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r235137 r235139 1291 1291 } 1292 1292 1293 bool WebPageProxy::shouldKeepCurrentBackForwardListItemInList(WebBackForwardListItem& item)1294 {1295 PageClientProtector protector(m_pageClient);1296 1297 return m_loaderClient->shouldKeepCurrentBackForwardListItemInList(*this, item);1298 }1299 1300 1293 bool WebPageProxy::canShowMIMEType(const String& mimeType) 1301 1294 { -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r235137 r235139 469 469 void willGoToBackForwardListItem(const WebCore::BackForwardItemIdentifier&, bool inPageCache, const UserData&); 470 470 471 bool shouldKeepCurrentBackForwardListItemInList(WebBackForwardListItem&);472 473 471 bool willHandleHorizontalScrollEvents() const; 474 472 -
trunk/Tools/ChangeLog
r235138 r235139 1 2018-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 1 11 2018-08-21 Alex Christensen <achristensen@webkit.org> 2 12 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r234976 r235139 535 535 7CCE7F121A411AE600447C4C /* ScrollPinningBehaviors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D640B5417875DFF00BFAF99 /* ScrollPinningBehaviors.cpp */; }; 536 536 7CCE7F131A411AE600447C4C /* ShouldGoToBackForwardListItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FCF7981534AC6D00104491 /* ShouldGoToBackForwardListItem.cpp */; }; 537 7CCE7F141A411AE600447C4C /* ShouldKeepCurrentBackForwardListItemInList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E5C7041919EA5F00D8B3E1 /* ShouldKeepCurrentBackForwardListItemInList.cpp */; };538 537 7CCE7F151A411AE600447C4C /* SpacebarScrolling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C02B77F1126612140026BF0F /* SpacebarScrolling.cpp */; }; 539 538 7CCE7F161A411AE600447C4C /* TerminateTwice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE72F47173EB214006362F0 /* TerminateTwice.cpp */; }; … … 1500 1499 51D124971E763AF8002B2820 /* WKHTTPCookieStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKHTTPCookieStore.mm; sourceTree = "<group>"; }; 1501 1500 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>"; };1503 1501 51E6A8921D2F1BEC00C004B6 /* LocalStorageClear.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalStorageClear.mm; sourceTree = "<group>"; }; 1504 1502 51E6A8951D2F1C7700C004B6 /* LocalStorageClear.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = LocalStorageClear.html; sourceTree = "<group>"; }; … … 2939 2937 51FCF7981534AC6D00104491 /* ShouldGoToBackForwardListItem.cpp */, 2940 2938 51FCF7971534AC6D00104491 /* ShouldGoToBackForwardListItem_Bundle.cpp */, 2941 51E5C7041919EA5F00D8B3E1 /* ShouldKeepCurrentBackForwardListItemInList.cpp */,2942 2939 C02B77F1126612140026BF0F /* SpacebarScrolling.cpp */, 2943 2940 76734997193016DC00E44DF9 /* StopLoadingDuringDidFailProvisionalLoad.cpp */, … … 3948 3945 A179918B1E1CA24100A505ED /* SharedBufferTest.cpp in Sources */, 3949 3946 7CCE7F131A411AE600447C4C /* ShouldGoToBackForwardListItem.cpp in Sources */, 3950 7CCE7F141A411AE600447C4C /* ShouldKeepCurrentBackForwardListItemInList.cpp in Sources */,3951 3947 37BCA61C1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm in Sources */, 3952 3948 7C83E0C51D0A654600FEBCF3 /* ShrinkToFit.mm in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.