Title: [290493] trunk
Revision
290493
Author
achristen...@apple.com
Date
2022-02-24 21:10:14 -0800 (Thu, 24 Feb 2022)

Log Message

Unreviewed, reverting r290371.

Caused assertion

Reverted changeset:

"Call WKNavigationDelegate.didFailProvisionalNavigation even
after a cross-origin navigation with COOP"
https://bugs.webkit.org/show_bug.cgi?id=237071
https://commits.webkit.org/r290371

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (290492 => 290493)


--- trunk/Source/WebKit/ChangeLog	2022-02-25 04:56:28 UTC (rev 290492)
+++ trunk/Source/WebKit/ChangeLog	2022-02-25 05:10:14 UTC (rev 290493)
@@ -1,3 +1,16 @@
+2022-02-24  Alex Christensen  <achristen...@webkit.org>
+
+        Unreviewed, reverting r290371.
+
+        Caused assertion
+
+        Reverted changeset:
+
+        "Call WKNavigationDelegate.didFailProvisionalNavigation even
+        after a cross-origin navigation with COOP"
+        https://bugs.webkit.org/show_bug.cgi?id=237071
+        https://commits.webkit.org/r290371
+
 2022-02-24  Gavin Phillips  <gavi...@apple.com>
 
         Port CaptivePortalMode preferences to AnyHost in order to support CFPrefs Direct Mode propagation

Modified: trunk/Source/WebKit/UIProcess/ProvisionalPageProxy.cpp (290492 => 290493)


--- trunk/Source/WebKit/UIProcess/ProvisionalPageProxy.cpp	2022-02-25 04:56:28 UTC (rev 290492)
+++ trunk/Source/WebKit/UIProcess/ProvisionalPageProxy.cpp	2022-02-25 05:10:14 UTC (rev 290493)
@@ -297,6 +297,15 @@
     ASSERT(!m_provisionalLoadURL.isNull());
     m_provisionalLoadURL = { };
 
+    if (m_isProcessSwappingOnNavigationResponse) {
+        // If the provisional load fails and we were process-swapping on navigation response, then we simply destroy ourselves.
+        // In this case, the provisional load is still ongoing in the committed process and the ProvisionalPageProxy destructor
+        // will stop it and cause the committed process to send its own DidFailProvisionalLoadForFrame IPC.
+        ASSERT(m_page.provisionalPageProxy() == this);
+        m_page.destroyProvisionalPage();
+        return;
+    }
+
     // Make sure the Page's main frame's expectedURL gets cleared since we updated it in didStartProvisionalLoad.
     if (auto* pageMainFrame = m_page.mainFrame())
         pageMainFrame->didFailProvisionalLoad();

Modified: trunk/Tools/ChangeLog (290492 => 290493)


--- trunk/Tools/ChangeLog	2022-02-25 04:56:28 UTC (rev 290492)
+++ trunk/Tools/ChangeLog	2022-02-25 05:10:14 UTC (rev 290493)
@@ -1,3 +1,16 @@
+2022-02-24  Alex Christensen  <achristen...@webkit.org>
+
+        Unreviewed, reverting r290371.
+
+        Caused assertion
+
+        Reverted changeset:
+
+        "Call WKNavigationDelegate.didFailProvisionalNavigation even
+        after a cross-origin navigation with COOP"
+        https://bugs.webkit.org/show_bug.cgi?id=237071
+        https://commits.webkit.org/r290371
+
 2022-02-24  Aditya Keerthi  <akeer...@apple.com>
 
         [iOS] Add support for replacing WKFoundTextRanges

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm (290492 => 290493)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm	2022-02-25 04:56:28 UTC (rev 290492)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm	2022-02-25 05:10:14 UTC (rev 290493)
@@ -38,8 +38,6 @@
 #import <WebKit/WKNavigationPrivate.h>
 #import <WebKit/WKWebView.h>
 #import <WebKit/WKWebViewConfigurationPrivate.h>
-#import <WebKit/WKWebsiteDataStorePrivate.h>
-#import <WebKit/_WKWebsiteDataStoreConfiguration.h>
 #import <wtf/RetainPtr.h>
 #import <wtf/Vector.h>
 
@@ -1012,54 +1010,3 @@
 
     EXPECT_FALSE(didTryToLoadRadarURL);
 }
-
-TEST(WKNavigation, CrossOriginCOOPCancelResponseFailProvisionalNavigationCallback)
-{
-    using namespace TestWebKitAPI;
-    HTTPServer server({
-        { "/path1", { "hi" } },
-        { "/path2", { "hi" } },
-        { "/path3", { { { "Cross-Origin-Opener-Policy", "same-origin" } }, "hi" } }
-    }, HTTPServer::Protocol::HttpsProxy);
-
-    auto storeConfiguration = adoptNS([[_WKWebsiteDataStoreConfiguration alloc] initNonPersistentConfiguration]);
-    [storeConfiguration setProxyConfiguration:@{
-        (NSString *)kCFStreamPropertyHTTPSProxyHost: @"127.0.0.1",
-        (NSString *)kCFStreamPropertyHTTPSProxyPort: @(server.port())
-    }];
-    auto dataStore = adoptNS([[WKWebsiteDataStore alloc] _initWithConfiguration:storeConfiguration.get()]);
-    auto configuration = adoptNS([WKWebViewConfiguration new]);
-    [configuration setWebsiteDataStore:dataStore.get()];
-    auto webView = adoptNS([[WKWebView alloc] initWithFrame:CGRectZero configuration:configuration.get()]);
-
-    __block Vector<bool> finishedSuccessfullyCallbacks;
-    auto loadWithResponsePolicy = ^(WKWebView *webView, NSString *url, WKNavigationResponsePolicy responsePolicy) {
-        auto callbacksSizeBefore = finishedSuccessfullyCallbacks.size();
-
-        auto delegate = adoptNS([TestNavigationDelegate new]);
-        delegate.get().decidePolicyForNavigationResponse = ^(WKNavigationResponse *response, void (^decisionHandler)(WKNavigationResponsePolicy)) {
-            decisionHandler(responsePolicy);
-        };
-
-        delegate.get().didReceiveAuthenticationChallenge = ^(WKWebView *, NSURLAuthenticationChallenge *challenge, void (^completionHandler)(NSURLSessionAuthChallengeDisposition, NSURLCredential *)) {
-            completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]);
-        };
-        delegate.get().didFailProvisionalNavigation = ^(WKWebView *, WKNavigation *, NSError *) {
-            finishedSuccessfullyCallbacks.append(false);
-        };
-        delegate.get().didFinishNavigation = ^(WKWebView *, WKNavigation *) {
-            finishedSuccessfullyCallbacks.append(true);
-        };
-        [webView setNavigationDelegate:delegate.get()];
-        [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
-        while (finishedSuccessfullyCallbacks.size() == callbacksSizeBefore)
-            TestWebKitAPI::Util::spinRunLoop(10);
-    };
-
-    loadWithResponsePolicy(webView.get(), @"https://webkit.org/path1", WKNavigationResponsePolicyAllow);
-    loadWithResponsePolicy(webView.get(), @"https://webkit.org/path2", WKNavigationResponsePolicyCancel);
-    loadWithResponsePolicy(webView.get(), @"https://example.com/path3", WKNavigationResponsePolicyCancel);
-
-    Vector<bool> expectedCallbacks { true, false, false };
-    EXPECT_EQ(finishedSuccessfullyCallbacks, expectedCallbacks);
-}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to