Changeset 238565 in webkit
- Timestamp:
- Nov 27, 2018 11:52:36 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r238562 r238565 1 2018-11-27 Chris Dumez <cdumez@apple.com> 2 3 Regression(PSON) crash under WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame() 4 https://bugs.webkit.org/show_bug.cgi?id=191983 5 <rdar://problem/46246863> 6 7 Reviewed by Geoffrey Garen. 8 9 * UIProcess/WebPageProxy.cpp: 10 (WebKit::WebPageProxy::continueNavigationInNewProcess): 11 Make sure the navigation still exists in m_mainFrameCreationHandler and return early if it 12 does not. 13 14 (WebKit::WebPageProxy::resetState): 15 Clear out m_mainFrameCreationHandler / m_mainFrameWindowCreationHandler if we resetting the state 16 after a crash. At this point, there is no chance the WebProcess will send us the IPC that will 17 cause these to get called and we do not want old state to remain for future navigations. 18 1 19 2018-11-16 Jiewen Tan <jiewen_tan@apple.com> 2 20 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r238562 r238565 2705 2705 2706 2706 ASSERT(!m_mainFrame); 2707 m_mainFrameCreationHandler = [this, protectedThis = WTFMove(protectedThis), navigation = navigation.copyRef(), request = navigation->currentRequest(), mainFrameURL, isServerRedirect = navigation->currentRequestIsRedirect()]() mutable {2707 m_mainFrameCreationHandler = [this, protectedThis = WTFMove(protectedThis), navigationID = navigation->navigationID(), request = navigation->currentRequest(), mainFrameURL, isServerRedirect = navigation->currentRequestIsRedirect()]() mutable { 2708 2708 ASSERT(m_mainFrame); 2709 // This navigation was destroyed so no need to notify of redirect. 2710 if (!navigationState().navigation(navigationID)) 2711 return; 2712 2709 2713 // Restore the main frame's committed URL as some clients may rely on it until the next load is committed. 2710 2714 m_mainFrame->frameLoadState().setURL(mainFrameURL); … … 2715 2719 if (isServerRedirect) { 2716 2720 m_mainFrame->frameLoadState().didStartProvisionalLoad(request.url()); 2717 didReceiveServerRedirectForProvisionalLoadForFrame(m_mainFrame->frameID(), navigation ->navigationID(), WTFMove(request), { });2721 didReceiveServerRedirectForProvisionalLoadForFrame(m_mainFrame->frameID(), navigationID, WTFMove(request), { }); 2718 2722 } 2719 2723 }; … … 6265 6269 { 6266 6270 m_mainFrame = nullptr; 6271 m_mainFrameCreationHandler = nullptr; 6272 m_mainFrameWindowCreationHandler = nullptr; 6273 6267 6274 #if PLATFORM(COCOA) 6268 6275 m_scrollingPerformanceData = nullptr; -
trunk/Tools/ChangeLog
r238548 r238565 1 2018-11-27 Chris Dumez <cdumez@apple.com> 2 3 Regression(PSON) crash under WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame() 4 https://bugs.webkit.org/show_bug.cgi?id=191983 5 <rdar://problem/46246863> 6 7 Reviewed by Geoffrey Garen. 8 9 Add API test coverage. 10 11 * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: 12 1 13 2018-11-27 Aakash Jain <aakash_jain@apple.com> 2 14 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm
r238456 r238565 486 486 } 487 487 488 TEST(ProcessSwap, KillWebContentProcessAfterServerRedirectPolicyDecision) 489 { 490 auto processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]); 491 processPoolConfiguration.get().processSwapsOnNavigation = YES; 492 processPoolConfiguration.get().prewarmsProcessesAutomatically = YES; 493 auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]); 494 495 auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]); 496 [webViewConfiguration setProcessPool:processPool.get()]; 497 auto handler = adoptNS([[PSONScheme alloc] init]); 498 [handler addRedirectFromURLString:@"pson://www.webkit.org/main2.html" toURLString:@"pson://www.apple.com/main.html"]; 499 [webViewConfiguration setURLSchemeHandler:handler.get() forURLScheme:@"PSON"]; 500 501 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]); 502 auto navigationDelegate = adoptNS([[PSONNavigationDelegate alloc] init]); 503 [webView setNavigationDelegate:navigationDelegate.get()]; 504 505 [webView configuration].preferences.safeBrowsingEnabled = NO; 506 507 NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main1.html"]]; 508 [webView loadRequest:request]; 509 510 TestWebKitAPI::Util::run(&done); 511 done = false; 512 513 __block BOOL isRedirection = NO; 514 navigationDelegate->decidePolicyForNavigationAction = ^(WKNavigationAction * action, void (^decisionHandler)(WKNavigationActionPolicy)) { 515 decisionHandler(WKNavigationActionPolicyAllow); 516 if (!isRedirection) { 517 isRedirection = YES; 518 return; 519 } 520 521 navigationDelegate->decidePolicyForNavigationAction = nil; 522 [webView _killWebContentProcessAndResetState]; 523 done = true; 524 }; 525 526 request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main2.html"]]; 527 [webView loadRequest:request]; 528 529 TestWebKitAPI::Util::run(&done); 530 done = false; 531 532 TestWebKitAPI::Util::spinRunLoop(10); 533 [webView reload]; 534 535 TestWebKitAPI::Util::run(&done); 536 done = false; 537 } 538 488 539 TEST(ProcessSwap, NoSwappingForeTLDPlus2) 489 540 {
Note: See TracChangeset
for help on using the changeset viewer.