Changeset 285877 in webkit
- Timestamp:
- Nov 16, 2021, 11:55:35 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/WebPageProxy.cpp (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r285873 r285877 1 2021-11-16 Chris Dumez <cdumez@apple.com> 2 3 Crash under WebKit::WebPageProxy::commitProvisionalPage() 4 https://bugs.webkit.org/show_bug.cgi?id=233199 5 <rdar://57659921> 6 7 Reviewed by Youenn Fablet. 8 9 In the event where the committed WebProcess would crash while a cross-site provisional load 10 is going on in a provisional page / WebProcess, we would do a null dereference of the page's 11 drawing area when trying to commit the provisional page later on. We would also hit various 12 assertions in debug since the page's state gets completely reset when its WebProcess crashes. 13 14 To address the issue, we now clear the provisional page if the page's WebProcess crashes. 15 16 * UIProcess/WebPageProxy.cpp: 17 (WebKit::WebPageProxy::resetStateAfterProcessExited): 18 1 19 2021-11-16 Chris Dumez <cdumez@apple.com> 2 20 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r285694 r285877 7937 7937 m_cachedFontAttributesAtSelectionStart.reset(); 7938 7938 7939 if (terminationReason != ProcessTerminationReason::NavigationSwap) 7940 m_provisionalPage = nullptr; 7941 7939 7942 if (terminationReason == ProcessTerminationReason::NavigationSwap) 7940 7943 pageClient().processWillSwap(); -
trunk/Tools/ChangeLog
r285876 r285877 1 2021-11-16 Chris Dumez <cdumez@apple.com> 2 3 Crash under WebKit::WebPageProxy::commitProvisionalPage() 4 https://bugs.webkit.org/show_bug.cgi?id=233199 5 <rdar://57659921> 6 7 Reviewed by Youenn Fablet. 8 9 Add API test coverage. 10 11 * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: 12 1 13 2021-11-16 Fujii Hironori <Hironori.Fujii@sony.com> 2 14 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm
r285873 r285877 5526 5526 EXPECT_NE(pid1, pid4); 5527 5527 EXPECT_NE(pid3, pid4); 5528 } 5529 5530 TEST(ProcessSwap, CommittedProcessCrashDuringCrossSiteNavigation) 5531 { 5532 auto processPoolConfiguration = psonProcessPoolConfiguration(); 5533 auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]); 5534 5535 auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]); 5536 [webViewConfiguration setProcessPool:processPool.get()]; 5537 auto handler = adoptNS([[PSONScheme alloc] init]); 5538 [webViewConfiguration setURLSchemeHandler:handler.get() forURLScheme:@"PSON"]; 5539 5540 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]); 5541 auto navigationDelegate = adoptNS([[PSONNavigationDelegate alloc] init]); 5542 [webView setNavigationDelegate:navigationDelegate.get()]; 5543 5544 done = false; 5545 NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]]; 5546 [webView loadRequest:request]; 5547 5548 TestWebKitAPI::Util::run(&done); 5549 done = false; 5550 5551 auto pid1 = [webView _webProcessIdentifier]; 5552 5553 static bool didKill = false; 5554 navigationDelegate->decidePolicyForNavigationAction = ^(WKNavigationAction *, void (^decisionHandler)(WKNavigationActionPolicy)) { 5555 decisionHandler(WKNavigationActionPolicyAllow); // Will ask the load to proceed in a new provisional WebProcess since the navigation is cross-site. 5556 5557 // Simulate a crash of the committed WebProcess while the provisional navigation starts in the new provisional WebProcess. 5558 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ 5559 kill(pid1, 9); 5560 didKill = true; 5561 }); 5562 }; 5563 5564 request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.apple.com/main.html"]]; 5565 [webView loadRequest:request]; 5566 5567 TestWebKitAPI::Util::run(&didKill); 5568 5569 TestWebKitAPI::Util::sleep(0.5); 5528 5570 } 5529 5571
Note:
See TracChangeset
for help on using the changeset viewer.