WebKit Bugzilla
Attachment 360043 Details for
Bug 193788
: Regression(PSON) cross-site provisional page is not canceled if a new same-site one is started
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193788-20190124153739.patch (text/plain), 5.89 KB, created by
Chris Dumez
on 2019-01-24 15:37:40 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2019-01-24 15:37:40 PST
Size:
5.89 KB
patch
obsolete
>Subversion Revision: 240443 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 034c6545c8969630194377b0f2d7e8ca56950d15..5e4f4ca58e859be369e3932c6ca34fa43c7c4a51 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,19 @@ >+2019-01-24 Chris Dumez <cdumez@apple.com> >+ >+ Regression(PSON) cross-site provisional page is not canceled if a new same-site one is started >+ https://bugs.webkit.org/show_bug.cgi?id=193788 >+ <rdar://problem/47531231> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When the page starts a new provisional load, make sure we cancel any pending one in the provisional >+ process, as it would have happened in the first provisional load happened in the same process. >+ Without this, we could have 2 parallel loads happening, one in the committed process and another >+ in the provisional one, leading to assertion failures in debug. >+ >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): >+ > 2019-01-24 Antti Koivisto <antti@apple.com> > > [PSON] Flash on back navigation on Mac >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index e398cf7b73cb66b730dd232c74841a55160921c6..146ac4c1899c9090b26957404b7d46cf7147cc19 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -3775,6 +3775,12 @@ void WebPageProxy::didStartProvisionalLoadForFrameShared(Ref<WebProcessProxy>&& > MESSAGE_CHECK(process, frame); > MESSAGE_CHECK_URL(process, url); > >+ // If the page starts a new main frame provisional load, then cancel any pending one in a provisional process. >+ if (frame->isMainFrame() && m_provisionalPage && m_provisionalPage->mainFrame() != frame) { >+ m_provisionalPage->cancel(); >+ m_provisionalPage = nullptr; >+ } >+ > // FIXME: We should message check that navigationID is not zero here, but it's currently zero for some navigations through the page cache. > RefPtr<API::Navigation> navigation; > if (frame->isMainFrame() && navigationID) >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 13073c5cf042a81372b99d84c831e165c94173d4..ca89fd28fabef6a1469663e8e136ccba7752bb6a 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,16 @@ >+2019-01-24 Chris Dumez <cdumez@apple.com> >+ >+ Regression(PSON) cross-site provisional page is not canceled if a new same-site one is started >+ https://bugs.webkit.org/show_bug.cgi?id=193788 >+ <rdar://problem/47531231> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add API test coverage. >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: >+ (-[PSONNavigationDelegate webView:didStartProvisionalNavigation:]): >+ > 2019-01-24 Antti Koivisto <antti@apple.com> > > [PSON] Flash on back navigation on Mac >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm >index 2e1b4d2b78031b4089cbcd0f6ec3b8e7086a1c56..65c5d7573672ab56c923e4e8a7c2f9c3fa70421b 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm >@@ -61,6 +61,7 @@ - (WKContextRef)_contextForTesting; > @end > > static bool done; >+static bool didStartProvisionalLoad; > static bool failed; > static bool didCreateWebView; > static int numberOfDecidePolicyCalls; >@@ -119,6 +120,11 @@ - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigat > done = true; > } > >+- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(null_unspecified WKNavigation *)navigation >+{ >+ didStartProvisionalLoad = true; >+} >+ > - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler > { > ++numberOfDecidePolicyCalls; >@@ -2189,6 +2195,46 @@ TEST(ProcessSwap, MainFramesOnly) > EXPECT_EQ(1u, seenPIDs.size()); > } > >+TEST(ProcessSwap, DoSameSiteNavigationAfterCrossSiteProvisionalLoadStarted) >+{ >+ auto processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]); >+ [processPoolConfiguration setProcessSwapsOnNavigation:YES]; >+ auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]); >+ >+ auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]); >+ [webViewConfiguration setProcessPool:processPool.get()]; >+ auto handler = adoptNS([[PSONScheme alloc] init]); >+ [webViewConfiguration setURLSchemeHandler:handler.get() forURLScheme:@"PSON"]; >+ >+ auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]); >+ auto delegate = adoptNS([[PSONNavigationDelegate alloc] init]); >+ [webView setNavigationDelegate:delegate.get()]; >+ >+ NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main1.html"]]; >+ [webView loadRequest:request]; >+ >+ TestWebKitAPI::Util::run(&done); >+ done = false; >+ >+ auto webkitPID = [webView _webProcessIdentifier]; >+ >+ didStartProvisionalLoad = false; >+ request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.apple.com/main.html"]]; >+ [webView loadRequest:request]; >+ >+ TestWebKitAPI::Util::run(&didStartProvisionalLoad); >+ didStartProvisionalLoad = false; >+ >+ request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main2.html"]]; >+ [webView loadRequest:request]; >+ >+ TestWebKitAPI::Util::run(&done); >+ done = false; >+ >+ EXPECT_WK_STREQ(@"pson://www.webkit.org/main2.html", [[webView URL] absoluteString]); >+ EXPECT_EQ(webkitPID, [webView _webProcessIdentifier]); >+} >+ > TEST(ProcessSwap, SuspendedPageLimit) > { > auto processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193788
: 360043