Title: [238456] trunk
Revision
238456
Author
[email protected]
Date
2018-11-22 20:36:38 -0800 (Thu, 22 Nov 2018)

Log Message

Regression(r238353) Load sometimes hangs when navigating back after a cross-site navigation
https://bugs.webkit.org/show_bug.cgi?id=191914

Reviewed by Ryosuke Niwa.

Source/WebKit:

When process-swapping on a cross-site server-side redirect, we end up doing a decidePolicyForNavigationResponse
policy check for the about:blank suspension load. This policy decision is ignored by the UIProcess because
SuspendedPageProxy does not handle this particular IPC message. To handle the issue, make sure the WebProcess
never sends a DecidePolicyForNavigationResponse IPC to the UIProcess for about:blank suspension loads and let
the load proceed.

The issue was already there before r238353 but it was made obvious by r238353 which caused a hang when trying
to reuse a Suspended page which is hanging while trying to suspend.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (238455 => 238456)


--- trunk/Source/WebKit/ChangeLog	2018-11-23 04:00:31 UTC (rev 238455)
+++ trunk/Source/WebKit/ChangeLog	2018-11-23 04:36:38 UTC (rev 238456)
@@ -1,3 +1,22 @@
+2018-11-22  Chris Dumez  <[email protected]>
+
+        Regression(r238353) Load sometimes hangs when navigating back after a cross-site navigation
+        https://bugs.webkit.org/show_bug.cgi?id=191914
+
+        Reviewed by Ryosuke Niwa.
+
+        When process-swapping on a cross-site server-side redirect, we end up doing a decidePolicyForNavigationResponse
+        policy check for the about:blank suspension load. This policy decision is ignored by the UIProcess because
+        SuspendedPageProxy does not handle this particular IPC message. To handle the issue, make sure the WebProcess
+        never sends a DecidePolicyForNavigationResponse IPC to the UIProcess for about:blank suspension loads and let
+        the load proceed.
+
+        The issue was already there before r238353 but it was made obvious by r238353 which caused a hang when trying
+        to reuse a Suspended page which is hanging while trying to suspend.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
+
 2018-11-22  Wenson Hsieh  <[email protected]>
 
         [Cocoa] clang emits a warning when building WebKit after r238293

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (238455 => 238456)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2018-11-23 04:00:31 UTC (rev 238455)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2018-11-23 04:36:38 UTC (rev 238456)
@@ -738,6 +738,12 @@
         return;
     }
 
+    // For suspension loads to about:blank, no need to ask the SuspendedPageProxy.
+    if (request.url() == blankURL() && webPage->isSuspended()) {
+        function(PolicyAction::Use);
+        return;
+    }
+
     RefPtr<API::Object> userData;
 
     // Notify the bundle client.

Modified: trunk/Tools/ChangeLog (238455 => 238456)


--- trunk/Tools/ChangeLog	2018-11-23 04:00:31 UTC (rev 238455)
+++ trunk/Tools/ChangeLog	2018-11-23 04:36:38 UTC (rev 238456)
@@ -1,3 +1,14 @@
+2018-11-22  Chris Dumez  <[email protected]>
+
+        Regression(r238353) Load sometimes hangs when navigating back after a cross-site navigation
+        https://bugs.webkit.org/show_bug.cgi?id=191914
+
+        Reviewed by Ryosuke Niwa.
+
+        Add API test coverage.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+
 2018-11-22  Zalan Bujtas  <[email protected]>
 
         [LFC][IFC] Offset formatting context root runs with horizontal margins.

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm (238455 => 238456)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm	2018-11-23 04:00:31 UTC (rev 238455)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm	2018-11-23 04:36:38 UTC (rev 238456)
@@ -1319,6 +1319,15 @@
     EXPECT_FALSE(serverRedirected);
     EXPECT_EQ(3, numberOfDecidePolicyCalls);
     EXPECT_EQ(2u, seenPIDs.size());
+
+    EXPECT_WK_STREQ(@"pson://www.apple.com/main.html", [[webView URL] absoluteString]);
+
+    [webView goBack];
+
+    TestWebKitAPI::Util::run(&done);
+    done = false;
+
+    EXPECT_WK_STREQ(@"pson://www.webkit.org/main1.html", [[webView URL] absoluteString]);
 }
 
 enum class ShouldEnablePSON { No, Yes };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to