Title: [258272] trunk
- Revision
- 258272
- Author
- cdu...@apple.com
- Date
- 2020-03-11 12:34:01 -0700 (Wed, 11 Mar 2020)
Log Message
Assertion hit under WebPageProxy::suspendCurrentPageIfPossible() when bypassing certificate warning page
https://bugs.webkit.org/show_bug.cgi?id=208927
<rdar://problem/55448331>
Reviewed by Alex Christensen.
Source/WebKit:
When suspending a previous page after a process-swap, we refuse to do the suspension if the currently
committed URL does not match the url of the current back/forward list item. This makes sense since we
will store the suspended page on the back/forward list item and restore that back when navigating back
to that item. I had a debug assertion in there to help me figure out how this could happen. It turns
out that calling loadAlternateHTML on the view will replace the content of the view with the provided
HTML string, update the committed URL but not create a new back/forward list item. This is so that
if you reload or go/back to this back/forward list item, we will attempt to load the original URL
again. This would however trip my assertion. I am therefore removing my debug assertion and adding API
test coverage.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::suspendCurrentPageIfPossible):
Tools:
Add API test coverage.
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (258271 => 258272)
--- trunk/Source/WebKit/ChangeLog 2020-03-11 18:34:18 UTC (rev 258271)
+++ trunk/Source/WebKit/ChangeLog 2020-03-11 19:34:01 UTC (rev 258272)
@@ -1,3 +1,24 @@
+2020-03-11 Chris Dumez <cdu...@apple.com>
+
+ Assertion hit under WebPageProxy::suspendCurrentPageIfPossible() when bypassing certificate warning page
+ https://bugs.webkit.org/show_bug.cgi?id=208927
+ <rdar://problem/55448331>
+
+ Reviewed by Alex Christensen.
+
+ When suspending a previous page after a process-swap, we refuse to do the suspension if the currently
+ committed URL does not match the url of the current back/forward list item. This makes sense since we
+ will store the suspended page on the back/forward list item and restore that back when navigating back
+ to that item. I had a debug assertion in there to help me figure out how this could happen. It turns
+ out that calling loadAlternateHTML on the view will replace the content of the view with the provided
+ HTML string, update the committed URL but not create a new back/forward list item. This is so that
+ if you reload or go/back to this back/forward list item, we will attempt to load the original URL
+ again. This would however trip my assertion. I am therefore removing my debug assertion and adding API
+ test coverage.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
+
2020-03-11 Alex Christensen <achristen...@webkit.org>
Introduce ResourceLoadStatisticsParameters and move members from NetworkSessionCreationParameters
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (258271 => 258272)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2020-03-11 18:34:18 UTC (rev 258271)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2020-03-11 19:34:01 UTC (rev 258272)
@@ -832,7 +832,6 @@
if (fromItem && fromItem->url() != pageLoadState().url()) {
RELEASE_LOG_ERROR_IF_ALLOWED(ProcessSwapping, "suspendCurrentPageIfPossible: Not suspending current page for process pid %i because fromItem's URL does not match the page URL.", m_process->processIdentifier());
- ASSERT_NOT_REACHED();
return false;
}
Modified: trunk/Tools/ChangeLog (258271 => 258272)
--- trunk/Tools/ChangeLog 2020-03-11 18:34:18 UTC (rev 258271)
+++ trunk/Tools/ChangeLog 2020-03-11 19:34:01 UTC (rev 258272)
@@ -1,3 +1,15 @@
+2020-03-11 Chris Dumez <cdu...@apple.com>
+
+ Assertion hit under WebPageProxy::suspendCurrentPageIfPossible() when bypassing certificate warning page
+ https://bugs.webkit.org/show_bug.cgi?id=208927
+ <rdar://problem/55448331>
+
+ Reviewed by Alex Christensen.
+
+ Add API test coverage.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+
2020-03-11 Diego Pino Garcia <dp...@igalia.com>
[GTK] Switch EWS api-gtk bot from buildAndTest to testOnly
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm (258271 => 258272)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm 2020-03-11 18:34:18 UTC (rev 258271)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm 2020-03-11 19:34:01 UTC (rev 258272)
@@ -6237,6 +6237,67 @@
done = false;
}
+TEST(ProcessSwap, LoadAlternativeHTML)
+{
+ [[WKContentRuleListStore defaultStore] removeContentRuleListForIdentifier:@"ContentBlockingAfterProcessSwapExtension" completionHandler:^(NSError *error) {
+ done = true;
+ }];
+ TestWebKitAPI::Util::run(&done);
+ done = false;
+
+ auto processPoolConfiguration = psonProcessPoolConfiguration();
+ auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]);
+
+ auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);
+ [webViewConfiguration setProcessPool:processPool.get()];
+ webViewConfiguration.get()._allowTopNavigationToDataURLs = YES;
+
+ RetainPtr<PSONMessageHandler> messageHandler = adoptNS([[PSONMessageHandler alloc] init]);
+ [[webViewConfiguration userContentController] addScriptMessageHandler:messageHandler.get() name:@"pson"];
+
+ __block bool doneCompiling = false;
+ [[WKContentRuleListStore defaultStore] compileContentRuleListForIdentifier:@"ContentBlockingAfterProcessSwapExtension" encodedContentRuleList:blockmeFilter completionHandler:^(WKContentRuleList *ruleList, NSError *error) {
+
+ EXPECT_NOT_NULL(ruleList);
+ EXPECT_NULL(error);
+
+ [webViewConfiguration.get().userContentController addContentRuleList:ruleList];
+
+ doneCompiling = true;
+ }];
+ TestWebKitAPI::Util::run(&doneCompiling);
+
+ auto handler = adoptNS([[PSONScheme alloc] init]);
+ [handler addMappingFromURLString:@"pson://www.apple.com/blockme.html" toData:notifyLoadedBytes];
+ [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/main.html"]];
+ [webView loadRequest:request];
+ TestWebKitAPI::Util::run(&done);
+ done = false;
+
+ receivedMessage = false;
+ failed = false;
+ request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.apple.com/blockme.html"]];
+ [webView loadRequest:request];
+ TestWebKitAPI::Util::run(&failed);
+ failed = false;
+ EXPECT_FALSE(receivedMessage);
+
+ [webView _loadAlternateHTMLString:@"Blocked" baseURL:[NSURL URLWithString:@"foo:blockedWarning.html"] forUnreachableURL:[NSURL URLWithString:@"pson://www.apple.com/blockme.html"]];
+ TestWebKitAPI::Util::run(&done);
+ done = false;
+
+ request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]];
+ [webView loadRequest:request];
+ TestWebKitAPI::Util::run(&done);
+ done = false;
+}
+
static bool isCapturing = false;
@interface GetUserMediaUIDelegate : NSObject<WKUIDelegate>
- (void)_webView:(WKWebView *)webView requestUserMediaAuthorizationForDevices:(_WKCaptureDevices)devices url:(NSURL *)url mainFrameURL:(NSURL *)mainFrameURL decisionHandler:(void (^)(BOOL authorized))decisionHandler;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes