- Revision
- 257430
- Author
- [email protected]
- Date
- 2020-02-26 02:56:00 -0800 (Wed, 26 Feb 2020)
Log Message
Merge r256831 - ASSERT_NOT_REACHED() under WebPageProxy::suspendCurrentPageIfPossible()
https://bugs.webkit.org/show_bug.cgi?id=207868
<rdar://problem/59464606>
Reviewed by John Wilander.
Source/WebCore:
Test: http/tests/navigation/process-swap-on-client-side-redirect-private.html
* loader/HistoryController.cpp:
(WebCore::HistoryController::updateForSameDocumentNavigation):
Methods in HistoryController avoids updating visited links and calling updateGlobalHistory()
on the FrameLoaderClient when in an ephemeral session. However, updateForSameDocumentNavigation()
was returning early in ephemeral sessions, which was overly aggressive and bypasses things we
really need to do, like updating the current HistoryItem's url.
LayoutTests:
Add layout test that was hitting the assertion before my change.
* http/tests/navigation/process-swap-on-client-side-redirect-private-expected.txt: Added.
* http/tests/navigation/process-swap-on-client-side-redirect-private.html: Added.
Modified Paths
Added Paths
Diff
Modified: releases/WebKitGTK/webkit-2.28/LayoutTests/ChangeLog (257429 => 257430)
--- releases/WebKitGTK/webkit-2.28/LayoutTests/ChangeLog 2020-02-26 10:55:53 UTC (rev 257429)
+++ releases/WebKitGTK/webkit-2.28/LayoutTests/ChangeLog 2020-02-26 10:56:00 UTC (rev 257430)
@@ -1,3 +1,16 @@
+2020-02-18 Chris Dumez <[email protected]>
+
+ ASSERT_NOT_REACHED() under WebPageProxy::suspendCurrentPageIfPossible()
+ https://bugs.webkit.org/show_bug.cgi?id=207868
+ <rdar://problem/59464606>
+
+ Reviewed by John Wilander.
+
+ Add layout test that was hitting the assertion before my change.
+
+ * http/tests/navigation/process-swap-on-client-side-redirect-private-expected.txt: Added.
+ * http/tests/navigation/process-swap-on-client-side-redirect-private.html: Added.
+
2020-02-17 Pinki Gyanchandani <[email protected]>
Null Ptr Deref @ WebCore::Node::Treescope
Added: releases/WebKitGTK/webkit-2.28/LayoutTests/http/tests/navigation/process-swap-on-client-side-redirect-private-expected.txt (0 => 257430)
--- releases/WebKitGTK/webkit-2.28/LayoutTests/http/tests/navigation/process-swap-on-client-side-redirect-private-expected.txt (rev 0)
+++ releases/WebKitGTK/webkit-2.28/LayoutTests/http/tests/navigation/process-swap-on-client-side-redirect-private-expected.txt 2020-02-26 10:56:00 UTC (rev 257430)
@@ -0,0 +1,9 @@
+Tests process swapping on client-side redirect in an ephemeral session.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: releases/WebKitGTK/webkit-2.28/LayoutTests/http/tests/navigation/process-swap-on-client-side-redirect-private.html (0 => 257430)
--- releases/WebKitGTK/webkit-2.28/LayoutTests/http/tests/navigation/process-swap-on-client-side-redirect-private.html (rev 0)
+++ releases/WebKitGTK/webkit-2.28/LayoutTests/http/tests/navigation/process-swap-on-client-side-redirect-private.html 2020-02-26 10:56:00 UTC (rev 257430)
@@ -0,0 +1,33 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body _onload_="run()">
+<script>
+ description("Tests process swapping on client-side redirect in an ephemeral session.");
+ jsTestIsAsync = true;
+
+ function runTest() {
+ switch (document.location.hash) {
+ case "#step1":
+ document.location.href = ""
+ break;
+ case "#step2":
+ finishJSTest();
+ break;
+ }
+ }
+
+ function run() {
+ if (document.location.hash === "") {
+ document.location.hash = "step1";
+ setTimeout(runTest, 0);
+ return;
+ }
+ runTest();
+ }
+</script>
+</body>
+</html>
Modified: releases/WebKitGTK/webkit-2.28/Source/WebCore/ChangeLog (257429 => 257430)
--- releases/WebKitGTK/webkit-2.28/Source/WebCore/ChangeLog 2020-02-26 10:55:53 UTC (rev 257429)
+++ releases/WebKitGTK/webkit-2.28/Source/WebCore/ChangeLog 2020-02-26 10:56:00 UTC (rev 257430)
@@ -1,3 +1,20 @@
+2020-02-18 Chris Dumez <[email protected]>
+
+ ASSERT_NOT_REACHED() under WebPageProxy::suspendCurrentPageIfPossible()
+ https://bugs.webkit.org/show_bug.cgi?id=207868
+ <rdar://problem/59464606>
+
+ Reviewed by John Wilander.
+
+ Test: http/tests/navigation/process-swap-on-client-side-redirect-private.html
+
+ * loader/HistoryController.cpp:
+ (WebCore::HistoryController::updateForSameDocumentNavigation):
+ Methods in HistoryController avoids updating visited links and calling updateGlobalHistory()
+ on the FrameLoaderClient when in an ephemeral session. However, updateForSameDocumentNavigation()
+ was returning early in ephemeral sessions, which was overly aggressive and bypasses things we
+ really need to do, like updating the current HistoryItem's url.
+
2020-02-17 Pinki Gyanchandani <[email protected]>
Null Ptr Deref @ WebCore::Node::Treescope
Modified: releases/WebKitGTK/webkit-2.28/Source/WebCore/loader/HistoryController.cpp (257429 => 257430)
--- releases/WebKitGTK/webkit-2.28/Source/WebCore/loader/HistoryController.cpp 2020-02-26 10:55:53 UTC (rev 257429)
+++ releases/WebKitGTK/webkit-2.28/Source/WebCore/loader/HistoryController.cpp 2020-02-26 10:56:00 UTC (rev 257430)
@@ -381,7 +381,7 @@
FrameLoader& frameLoader = m_frame.loader();
- bool needPrivacy = m_frame.page() ? m_frame.page()->usesEphemeralSession() : true;
+ bool usesEphemeralSession = m_frame.page() ? m_frame.page()->usesEphemeralSession() : true;
const URL& historyURL = frameLoader.documentLoader()->urlForHistory();
if (!frameLoader.documentLoader()->isClientRedirect()) {
@@ -388,7 +388,7 @@
if (!historyURL.isEmpty()) {
if (updateType != UpdateAllExceptBackForwardList)
updateBackForwardListClippedAtTarget(true);
- if (!needPrivacy) {
+ if (!usesEphemeralSession) {
frameLoader.client().updateGlobalHistory();
frameLoader.documentLoader()->setDidCreateGlobalHistoryEntry(true);
if (frameLoader.documentLoader()->unreachableURL().isEmpty())
@@ -400,7 +400,7 @@
updateCurrentItem();
}
- if (!historyURL.isEmpty() && !needPrivacy) {
+ if (!historyURL.isEmpty() && !usesEphemeralSession) {
if (Page* page = m_frame.page())
addVisitedLink(*page, historyURL);
@@ -413,7 +413,7 @@
{
LOG(History, "HistoryController %p updateForRedirectWithLockedBackForwardList: Updating History for redirect load in frame %p (main frame %d) %s", this, &m_frame, m_frame.isMainFrame(), m_frame.loader().documentLoader() ? m_frame.loader().documentLoader()->url().string().utf8().data() : "");
- bool needPrivacy = m_frame.page() ? m_frame.page()->usesEphemeralSession() : true;
+ bool usesEphemeralSession = m_frame.page() ? m_frame.page()->usesEphemeralSession() : true;
const URL& historyURL = m_frame.loader().documentLoader()->urlForHistory();
if (m_frame.loader().documentLoader()->isClientRedirect()) {
@@ -420,7 +420,7 @@
if (!m_currentItem && !m_frame.tree().parent()) {
if (!historyURL.isEmpty()) {
updateBackForwardListClippedAtTarget(true);
- if (!needPrivacy) {
+ if (!usesEphemeralSession) {
m_frame.loader().client().updateGlobalHistory();
m_frame.loader().documentLoader()->setDidCreateGlobalHistoryEntry(true);
if (m_frame.loader().documentLoader()->unreachableURL().isEmpty())
@@ -436,7 +436,7 @@
parentFrame->loader().history().currentItem()->setChildItem(createItem());
}
- if (!historyURL.isEmpty() && !needPrivacy) {
+ if (!historyURL.isEmpty() && !usesEphemeralSession) {
if (Page* page = m_frame.page())
addVisitedLink(*page, historyURL);
@@ -456,10 +456,10 @@
m_currentItem->clearScrollPosition();
}
- bool needPrivacy = m_frame.page() ? m_frame.page()->usesEphemeralSession() : true;
+ bool usesEphemeralSession = m_frame.page() ? m_frame.page()->usesEphemeralSession() : true;
const URL& historyURL = m_frame.loader().documentLoader()->urlForHistory();
- if (!historyURL.isEmpty() && !needPrivacy) {
+ if (!historyURL.isEmpty() && !usesEphemeralSession) {
if (Page* page = m_frame.page())
addVisitedLink(*page, historyURL);
}
@@ -551,15 +551,16 @@
if (!page)
return;
- if (page->usesEphemeralSession())
- return;
+ bool usesEphemeralSession = page->usesEphemeralSession();
+ if (!usesEphemeralSession)
+ addVisitedLink(*page, m_frame.document()->url());
- addVisitedLink(*page, m_frame.document()->url());
m_frame.mainFrame().loader().history().recursiveUpdateForSameDocumentNavigation();
if (m_currentItem) {
m_currentItem->setURL(m_frame.document()->url());
- m_frame.loader().client().updateGlobalHistory();
+ if (!usesEphemeralSession)
+ m_frame.loader().client().updateGlobalHistory();
}
}