Changeset 261394 in webkit
- Timestamp:
- May 8, 2020 10:33:58 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r261390 r261394 1 2020-05-08 Chris Dumez <cdumez@apple.com> 2 3 REGRESSION(r259209) Webview's pending URL is null after restoring session state 4 https://bugs.webkit.org/show_bug.cgi?id=211626 5 <rdar://problem/62992262> 6 7 Reviewed by Alex Christensen. 8 9 The issue was that WebPageProxy::goToBackForwardItem() would behave differently whether 10 the page has a running process or not. In particular, when the page did not have a 11 running process, goToBackForwardItem() would return early and call launchProcessWithItem() 12 instead. Unlike goToBackForwardItem(), launchProcessWithItem() would fail to set the 13 pending API request. 14 15 To address the issue, I am getting rid of launchProcessWithItem() and merging its logic 16 into goToBackForwardItem() instead. Both methods shared a lot of code anyway and having 17 2 separate code paths that may diverge is error prone. 18 19 Change is covered by new API test. 20 21 * UIProcess/WebPageProxy.cpp: 22 (WebKit::WebPageProxy::goToBackForwardItem): 23 (WebKit::WebPageProxy::launchProcessWithItem): Deleted. 24 * UIProcess/WebPageProxy.h: 25 1 26 2020-05-08 Alex Christensen <achristensen@webkit.org> 2 27 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r261390 r261394 1025 1025 } 1026 1026 1027 RefPtr<API::Navigation> WebPageProxy::launchProcessWithItem(WebBackForwardListItem& item)1028 {1029 RELEASE_LOG_IF_ALLOWED(Loading, "launchProcessWithItem:");1030 1031 if (m_isClosed) {1032 RELEASE_LOG_IF_ALLOWED(Loading, "launchProcessWithItem: page is closed");1033 return nullptr;1034 }1035 1036 ASSERT(!hasRunningProcess());1037 launchProcess(RegistrableDomain { URL(URL(), item.url()) }, ProcessLaunchReason::InitialProcess);1038 1039 if (&item != m_backForwardList->currentItem())1040 m_backForwardList->goToItem(item);1041 1042 auto navigation = m_navigationState->createBackForwardNavigation(item, m_backForwardList->currentItem(), FrameLoadType::IndexedBackForward);1043 1044 send(Messages::WebPage::GoToBackForwardItem(navigation->navigationID(), item.itemID(), FrameLoadType::IndexedBackForward, ShouldTreatAsContinuingLoad::No, WTF::nullopt));1045 m_process->startResponsivenessTimer();1046 1047 return navigation;1048 }1049 1050 1027 void WebPageProxy::setDrawingArea(std::unique_ptr<DrawingAreaProxy>&& drawingArea) 1051 1028 { … … 1655 1632 LOG(Loading, "WebPageProxy %p goToBackForwardItem to item URL %s", this, item.url().utf8().data()); 1656 1633 1657 if (!hasRunningProcess()) 1658 return launchProcessWithItem(item); 1634 if (m_isClosed) { 1635 RELEASE_LOG_IF_ALLOWED(Loading, "goToBackForwardItem: page is closed"); 1636 return nullptr; 1637 } 1638 1639 if (!hasRunningProcess()) { 1640 launchProcess(RegistrableDomain { URL(URL(), item.url()) }, ProcessLaunchReason::InitialProcess); 1641 1642 if (&item != m_backForwardList->currentItem()) 1643 m_backForwardList->goToItem(item); 1644 } 1659 1645 1660 1646 RefPtr<API::Navigation> navigation; -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r261364 r261394 1948 1948 1949 1949 RefPtr<API::Navigation> launchProcessForReload(); 1950 RefPtr<API::Navigation> launchProcessWithItem(WebBackForwardListItem&);1951 1950 1952 1951 void requestNotificationPermission(uint64_t notificationID, const String& originString); -
trunk/Tools/ChangeLog
r261390 r261394 1 2020-05-08 Chris Dumez <cdumez@apple.com> 2 3 REGRESSION(r259209) Webview's pending URL is null after restoring session state 4 https://bugs.webkit.org/show_bug.cgi?id=211626 5 <rdar://problem/62992262> 6 7 Reviewed by Alex Christensen. 8 9 Add API test coverage. 10 11 * TestWebKitAPI/Tests/WebKit/RestoreSessionState.cpp: 12 (TestWebKitAPI::TEST): 13 1 14 2020-05-08 Alex Christensen <achristensen@webkit.org> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebKit/RestoreSessionState.cpp
r244390 r261394 138 138 WKPageRestoreFromSessionState(webView.page(), sessionState.get()); 139 139 } 140 141 TEST(WebKit, PendingURLAfterRestoreSessionState) 142 { 143 auto context = adoptWK(WKContextCreateWithConfiguration(nullptr)); 144 PlatformWebView webView(context.get()); 145 setPageLoaderClient(webView.page()); 146 auto data = createSessionStateData(context.get()); 147 EXPECT_NOT_NULL(data); 148 auto sessionState = adoptWK(WKSessionStateCreateFromData(data.get())); 149 WKPageRestoreFromSessionState(webView.page(), sessionState.get()); 150 auto pendingURL = adoptWK(WKPageCopyPendingAPIRequestURL(webView.page())); 151 EXPECT_NOT_NULL(pendingURL); 152 if (!pendingURL) 153 return; 154 155 auto expectedURL = adoptWK(Util::createURLForResource("simple-form", "html")); 156 EXPECT_WK_STREQ(adoptWK(WKURLCopyString(expectedURL.get())).get(), adoptWK(WKURLCopyString(pendingURL.get())).get()); 157 } 140 158 141 159 } // namespace TestWebKitAPI
Note: See TracChangeset
for help on using the changeset viewer.