Changeset 243240 in webkit
- Timestamp:
- Mar 20, 2019, 2:26:01 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (modified) (3 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r243231 r243240 1 2019-03-20 Chris Dumez <cdumez@apple.com> 2 3 Regression(PSON): ViewGestureController is not properly notified of process swaps on iOS 4 https://bugs.webkit.org/show_bug.cgi?id=196029 5 <rdar://problem/48954651> 6 7 Reviewed by Tim Horton. 8 9 If there is a ViewGestureController when process swapping, make sure we disconnect it 10 from the old process and reconnect it to the new one. This matches what is done in 11 WebViewImpl for macOS (see r238356). 12 13 * UIProcess/API/Cocoa/WKWebView.mm: 14 (-[WKWebView _processWillSwap]): 15 (-[WKWebView _processDidExit]): 16 (-[WKWebView _didRelaunchProcess]): 17 1 18 2019-03-20 Carlos Garcia Campos <cgarcia@igalia.com> 2 19 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r243094 r243240 1841 1841 RELEASE_LOG_IF_ALLOWED("%p -[WKWebView _processWillSwap]", self); 1842 1842 [self _processWillSwapOrDidExit]; 1843 if (_gestureController) 1844 _gestureController->disconnectFromProcess(); 1843 1845 } 1844 1846 … … 1853 1855 [_scrollView setContentOffset:[self _initialContentOffsetForScrollView]]; 1854 1856 [_scrollView setZoomScale:1]; 1855 1857 _gestureController = nullptr; 1856 1858 } 1857 1859 … … 1861 1863 _hasScheduledVisibleRectUpdate = NO; 1862 1864 _visibleContentRectUpdateScheduledFromScrollViewInStableState = YES; 1865 if (_gestureController) 1866 _gestureController->connectToProcess(); 1863 1867 } 1864 1868 -
trunk/Tools/ChangeLog
r243217 r243240 1 2019-03-20 Chris Dumez <cdumez@apple.com> 2 3 Regression(PSON): ViewGestureController is not properly notified of process swaps on iOS 4 https://bugs.webkit.org/show_bug.cgi?id=196029 5 <rdar://problem/48954651> 6 7 Reviewed by Tim Horton. 8 9 Add API test coverage. 10 11 * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: 12 1 13 2019-03-20 Aakash Jain <aakash_jain@apple.com> 2 14 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm
r243094 r243240 4958 4958 } 4959 4959 4960 #if PLATFORM(MAC)4961 4962 4960 TEST(ProcessSwap, TerminateProcessAfterProcessSwap) 4963 4961 { … … 4984 4982 4985 4983 // Make sure there is a gesture controller. 4984 #if PLATFORM(MAC) 4986 4985 [webView _setCustomSwipeViewsTopContentInset:2.]; 4986 #endif 4987 4987 4988 4988 NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]]; … … 5012 5012 done = false; 5013 5013 } 5014 5015 TEST(ProcessSwap, SwapWithGestureController) 5016 { 5017 @autoreleasepool { 5018 auto processPoolConfiguration = psonProcessPoolConfiguration(); 5019 auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]); 5020 5021 auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]); 5022 [webViewConfiguration setProcessPool:processPool.get()]; 5023 auto handler = adoptNS([[PSONScheme alloc] init]); 5024 [webViewConfiguration setURLSchemeHandler:handler.get() forURLScheme:@"PSON"]; 5025 5026 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]); 5027 5028 auto delegate = adoptNS([[PSONNavigationDelegate alloc] init]); 5029 [webView setNavigationDelegate:delegate.get()]; 5030 5031 NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.apple.com/main.html"]]; 5032 [webView loadRequest:request]; 5033 5034 TestWebKitAPI::Util::run(&done); 5035 done = false; 5036 5037 // Ensure a ViewGestureController is created. 5038 [webView setAllowsBackForwardNavigationGestures:YES]; 5039 #if PLATFORM(MAC) 5040 [webView _setCustomSwipeViewsTopContentInset:2.]; 5041 #endif 5042 5043 request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.google.com/main.html"]]; 5044 [webView loadRequest:request]; 5045 5046 TestWebKitAPI::Util::run(&done); 5047 done = false; 5048 } 5049 } 5050 5051 TEST(ProcessSwap, CrashWithGestureController) 5052 { 5053 @autoreleasepool { 5054 auto processPoolConfiguration = psonProcessPoolConfiguration(); 5055 auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]); 5056 5057 auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]); 5058 [webViewConfiguration setProcessPool:processPool.get()]; 5059 auto handler = adoptNS([[PSONScheme alloc] init]); 5060 [webViewConfiguration setURLSchemeHandler:handler.get() forURLScheme:@"PSON"]; 5061 5062 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]); 5063 5064 auto navigationDelegate = adoptNS([[TestNavigationDelegate alloc] init]); 5065 [webView setNavigationDelegate:navigationDelegate.get()]; 5066 __block bool webProcessTerminated = false; 5067 [navigationDelegate setWebContentProcessDidTerminate:^(WKWebView *) { 5068 webProcessTerminated = true; 5069 }]; 5070 [navigationDelegate setDidFinishNavigation:^(WKWebView *, WKNavigation *) { 5071 done = true; 5072 }]; 5073 5074 NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.apple.com/main.html"]]; 5075 [webView loadRequest:request]; 5076 5077 TestWebKitAPI::Util::run(&done); 5078 done = false; 5079 5080 // Ensure a ViewGestureController is created. 5081 [webView setAllowsBackForwardNavigationGestures:YES]; 5082 #if PLATFORM(MAC) 5083 [webView _setCustomSwipeViewsTopContentInset:2.]; 5084 #endif 5085 5086 webProcessTerminated = false; 5087 kill([webView _webProcessIdentifier], 9); 5088 5089 TestWebKitAPI::Util::run(&webProcessTerminated); 5090 5091 TestWebKitAPI::Util::spinRunLoop(1); 5092 5093 [webView reload]; 5094 TestWebKitAPI::Util::run(&done); 5095 done = false; 5096 } 5097 } 5098 5099 #if PLATFORM(MAC) 5014 5100 5015 5101 TEST(ProcessSwap, NavigateCrossOriginWithOpenee)
Note:
See TracChangeset
for help on using the changeset viewer.