Title: [256831] trunk
Revision
256831
Author
[email protected]
Date
2020-02-18 09:00:11 -0800 (Tue, 18 Feb 2020)

Log Message

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: trunk/LayoutTests/ChangeLog (256830 => 256831)


--- trunk/LayoutTests/ChangeLog	2020-02-18 16:38:09 UTC (rev 256830)
+++ trunk/LayoutTests/ChangeLog	2020-02-18 17:00:11 UTC (rev 256831)
@@ -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-18  Jason Lawrence  <[email protected]>
 
         REGRESSION: (r254092?) [ Mac wk1 ] imported/w3c/web-platform-tests/css/css-position/fixed-z-index-blend.html is flaky failing.

Added: trunk/LayoutTests/http/tests/navigation/process-swap-on-client-side-redirect-private-expected.txt (0 => 256831)


--- trunk/LayoutTests/http/tests/navigation/process-swap-on-client-side-redirect-private-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/process-swap-on-client-side-redirect-private-expected.txt	2020-02-18 17:00:11 UTC (rev 256831)
@@ -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: trunk/LayoutTests/http/tests/navigation/process-swap-on-client-side-redirect-private.html (0 => 256831)


--- trunk/LayoutTests/http/tests/navigation/process-swap-on-client-side-redirect-private.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/process-swap-on-client-side-redirect-private.html	2020-02-18 17:00:11 UTC (rev 256831)
@@ -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: trunk/Source/WebCore/ChangeLog (256830 => 256831)


--- trunk/Source/WebCore/ChangeLog	2020-02-18 16:38:09 UTC (rev 256830)
+++ trunk/Source/WebCore/ChangeLog	2020-02-18 17:00:11 UTC (rev 256831)
@@ -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-18  Zalan Bujtas  <[email protected]>
 
         [LFC][IFC] Add missing float check in inline line layout

Modified: trunk/Source/WebCore/loader/HistoryController.cpp (256830 => 256831)


--- trunk/Source/WebCore/loader/HistoryController.cpp	2020-02-18 16:38:09 UTC (rev 256830)
+++ trunk/Source/WebCore/loader/HistoryController.cpp	2020-02-18 17:00:11 UTC (rev 256831)
@@ -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();
     }
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to