Title: [240599] trunk
- Revision
- 240599
- Author
- [email protected]
- Date
- 2019-01-28 13:19:52 -0800 (Mon, 28 Jan 2019)
Log Message
Regression(PSON) Crash under WebPageProxy::didStartProgress()
https://bugs.webkit.org/show_bug.cgi?id=193915
<rdar://problem/47560907>
Reviewed by Alex Christensen.
Source/WebKit:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
Make sure we destroy the ProvisionalPageProxy if the page gets closed as we do not want to keep receiving
IPC after this or even worse, commit the provisional page.
(WebKit::WebPageProxy::didStartProgress):
Add an assertion in didStartProgress() to make sure we do not receive this IPC after the page has been
closed.
Tools:
Add API test coverage.
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (240598 => 240599)
--- trunk/Source/WebKit/ChangeLog 2019-01-28 20:21:39 UTC (rev 240598)
+++ trunk/Source/WebKit/ChangeLog 2019-01-28 21:19:52 UTC (rev 240599)
@@ -1,3 +1,20 @@
+2019-01-28 Chris Dumez <[email protected]>
+
+ Regression(PSON) Crash under WebPageProxy::didStartProgress()
+ https://bugs.webkit.org/show_bug.cgi?id=193915
+ <rdar://problem/47560907>
+
+ Reviewed by Alex Christensen.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::close):
+ Make sure we destroy the ProvisionalPageProxy if the page gets closed as we do not want to keep receiving
+ IPC after this or even worse, commit the provisional page.
+
+ (WebKit::WebPageProxy::didStartProgress):
+ Add an assertion in didStartProgress() to make sure we do not receive this IPC after the page has been
+ closed.
+
2019-01-28 Antoine Quint <[email protected]>
Limit user-agent interactions based on the touch-action property on iOS
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (240598 => 240599)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2019-01-28 20:21:39 UTC (rev 240598)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2019-01-28 21:19:52 UTC (rev 240599)
@@ -965,6 +965,8 @@
m_activeContextMenu = nullptr;
#endif
+ m_provisionalPage = nullptr;
+
m_inspector->invalidate();
m_backForwardList->pageClosed();
@@ -3711,6 +3713,8 @@
void WebPageProxy::didStartProgress()
{
+ ASSERT(!m_isClosed);
+
PageClientProtector protector(pageClient());
auto transaction = m_pageLoadState.transaction();
Modified: trunk/Tools/ChangeLog (240598 => 240599)
--- trunk/Tools/ChangeLog 2019-01-28 20:21:39 UTC (rev 240598)
+++ trunk/Tools/ChangeLog 2019-01-28 21:19:52 UTC (rev 240599)
@@ -1,3 +1,15 @@
+2019-01-28 Chris Dumez <[email protected]>
+
+ Regression(PSON) Crash under WebPageProxy::didStartProgress()
+ https://bugs.webkit.org/show_bug.cgi?id=193915
+ <rdar://problem/47560907>
+
+ Reviewed by Alex Christensen.
+
+ Add API test coverage.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+
2019-01-28 Aakash Jain <[email protected]>
[ews-app] Rename id variables
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm (240598 => 240599)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm 2019-01-28 20:21:39 UTC (rev 240598)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm 2019-01-28 21:19:52 UTC (rev 240599)
@@ -3351,6 +3351,44 @@
EXPECT_NE(applePID, [webView _webProcessIdentifier]);
}
+
+TEST(ProcessSwap, ClosePageAfterCrossSiteProvisionalLoad)
+{
+ auto processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]);
+ processPoolConfiguration.get().processSwapsOnNavigation = 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 navigationDelegate = adoptNS([[PSONNavigationDelegate alloc] init]);
+ [webView setNavigationDelegate:navigationDelegate.get()];
+
+ [webView configuration].preferences.safeBrowsingEnabled = NO;
+
+ [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]]];
+ TestWebKitAPI::Util::run(&done);
+ done = false;
+
+ didStartProvisionalLoad = false;
+ [webView loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
+
+ navigationDelegate->decidePolicyForNavigationAction = ^(WKNavigationAction *, void (^decisionHandler)(WKNavigationActionPolicy)) {
+ decisionHandler(WKNavigationActionPolicyAllow);
+
+ [webView _close];
+ done = true;
+ };
+
+ TestWebKitAPI::Util::run(&done);
+ done = false;
+
+ TestWebKitAPI::Util::sleep(0.5);
+}
+
#if PLATFORM(MAC)
static const char* saveOpenerTestBytes = R"PSONRESOURCE(
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes