[ iOS Sim ] REGRESSION (r242277) Layout Test http/tests/cookies/same-site/lax-samesit...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Mar 2019 20:47:52 +0000 (20:47 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Mar 2019 20:47:52 +0000 (20:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195425
<rdar://problem/48682403>

Reviewed by Alex Christensen.

When process-swapping on history navigation, we lookup the WebProcessProxy we'd like to use from the
process identifier that is saved on the WebBackForwardListItem, to try and load the item in the process
in which it was previously loaded. However, we were failing to check if the WebProcess in question was
still running so we could potentially try to use a process that's already exited.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243562 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebProcessPool.cpp

index a1f9c57..a535f0a 100644 (file)
@@ -1,3 +1,19 @@
+2019-03-27  Chris Dumez  <cdumez@apple.com>
+
+        [ iOS Sim ] REGRESSION (r242277) Layout Test http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php is a flaky timeout
+        https://bugs.webkit.org/show_bug.cgi?id=195425
+        <rdar://problem/48682403>
+
+        Reviewed by Alex Christensen.
+
+        When process-swapping on history navigation, we lookup the WebProcessProxy we'd like to use from the
+        process identifier that is saved on the WebBackForwardListItem, to try and load the item in the process
+        in which it was previously loaded. However, we were failing to check if the WebProcess in question was
+        still running so we could potentially try to use a process that's already exited.
+
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::processForNavigationInternal):
+
 2019-03-27  Zalan Bujtas  <zalan@apple.com>
 
         [ContentChangeObserver] Always dispatch the synthetic click asynchronously
index 98bd496..4c3f1e7 100644 (file)
@@ -2287,18 +2287,20 @@ void WebProcessPool::processForNavigationInternal(WebPageProxy& page, const API:
         }
 
         if (RefPtr<WebProcessProxy> process = WebProcessProxy::processForIdentifier(targetItem->lastProcessIdentifier())) {
-            // FIXME: Architecturally we do not currently support multiple WebPage's with the same ID in a given WebProcess.
-            // In the case where this WebProcess has a SuspendedPageProxy for this WebPage, we can throw it away to support
-            // WebProcess re-use.
-            removeAllSuspendedPagesForPage(page, process.get());
-
-            // Make sure we remove the process from the cache if it is in there since we're about to use it.
-            if (process->isInProcessCache()) {
-                webProcessCache().removeProcess(*process, WebProcessCache::ShouldShutDownProcess::No);
-                ASSERT(!process->isInProcessCache());
-            }
+            if (process->state() != WebProcessProxy::State::Terminated) {
+                // FIXME: Architecturally we do not currently support multiple WebPage's with the same ID in a given WebProcess.
+                // In the case where this WebProcess has a SuspendedPageProxy for this WebPage, we can throw it away to support
+                // WebProcess re-use.
+                removeAllSuspendedPagesForPage(page, process.get());
+
+                // Make sure we remove the process from the cache if it is in there since we're about to use it.
+                if (process->isInProcessCache()) {
+                    webProcessCache().removeProcess(*process, WebProcessCache::ShouldShutDownProcess::No);
+                    ASSERT(!process->isInProcessCache());
+                }
 
-            return completionHandler(process.releaseNonNull(), nullptr, "Using target back/forward item's process"_s);
+                return completionHandler(process.releaseNonNull(), nullptr, "Using target back/forward item's process"_s);
+            }
         }
     }