Changeset 271479 in webkit
- Timestamp:
- Jan 13, 2021, 10:31:21 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/PlatformWebView.h (modified) (2 diffs)
-
Tools/TestWebKitAPI/Tests/WebKit/DeferredViewInWindowStateChange.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r271477 r271479 1 2021-01-13 Tim Horton <timothy_horton@apple.com> 2 3 REGRESSION (r266634): Messages crashes sometimes while scrolling around and playing YouTube videos 4 https://bugs.webkit.org/show_bug.cgi?id=220602 5 <rdar://problem/70402593> 6 7 Reviewed by Wenson Hsieh. 8 9 No new tests; we are unable to API test video full-screen because of the lack of UIApp; 10 I have written a stand-alone test app that can reliably reproduce before this patch 11 and not afterwards. 12 13 * UIProcess/Cocoa/WebPageProxyCocoa.mm: 14 (WebKit::WebPageProxy::scheduleActivityStateUpdate): 15 We can't call dispatchActivityStateChange directly underneath a post-commit callback, 16 because it has side-effects (like un-parenting the full-screen window) that may result 17 in other frameworks (e.g. UIKit) trying to install commit handlers for the same phase, 18 which is not allowed. 19 20 To fix this, add a dispatch_async; we _only_ care that the activity state change 21 doesn't apply until after the active commit is complete. 22 23 1 24 2021-01-13 Chris Dumez <cdumez@apple.com> 2 25 -
trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
r271469 r271479 506 506 if (hasActiveCATransaction) { 507 507 [CATransaction addCommitHandler:[weakThis = makeWeakPtr(*this)] { 508 auto protectedThis = makeRefPtr(weakThis.get()); 509 if (!protectedThis) 510 return; 511 512 protectedThis->dispatchActivityStateChange(); 508 // We can't call dispatchActivityStateChange directly underneath this commit handler, because it has side-effects 509 // that may result in other frameworks trying to install commit handlers for the same phase, which is not allowed. 510 // So, dispatch_async here; we only care that the activity state change doesn't apply until after the active commit is complete. 511 dispatch_async(dispatch_get_main_queue(), [weakThis] { 512 auto protectedThis = makeRefPtr(weakThis.get()); 513 if (!protectedThis) 514 return; 515 516 protectedThis->dispatchActivityStateChange(); 517 }); 513 518 } forPhase:kCATransactionPhasePostCommit]; 514 519 return; -
trunk/Tools/ChangeLog
r271475 r271479 1 2021-01-13 Tim Horton <timothy_horton@apple.com> 2 3 REGRESSION (r266634): Messages crashes sometimes while scrolling around and playing YouTube videos 4 https://bugs.webkit.org/show_bug.cgi?id=220602 5 <rdar://problem/70402593> 6 7 Reviewed by Wenson Hsieh. 8 9 * TestWebKitAPI/PlatformWebView.h: 10 Mark PlatformWebView noncopyable, since it is effectively noncopyable 11 (at least, the macOS implementation will overrelease the view if you 12 copy it, whoops). 13 14 * TestWebKitAPI/Tests/WebKit/DeferredViewInWindowStateChange.mm: 15 (TestWebKitAPI::TEST): 16 Add a matching dispatch_async, or this test fails. 17 1 18 2021-01-13 Alex Christensen <achristensen@webkit.org> 2 19 -
trunk/Tools/TestWebKitAPI/PlatformWebView.h
r262022 r271479 28 28 29 29 #include <wtf/FastMalloc.h> 30 #include <wtf/Noncopyable.h> 30 31 31 32 #if USE(CG) … … 70 71 class PlatformWebView { 71 72 WTF_MAKE_FAST_ALLOCATED; 73 WTF_MAKE_NONCOPYABLE(PlatformWebView); 72 74 public: 73 75 explicit PlatformWebView(WKPageConfigurationRef); -
trunk/Tools/TestWebKitAPI/Tests/WebKit/DeferredViewInWindowStateChange.mm
r260366 r271479 76 76 [wkView endDeferringViewInWindowChanges]; 77 77 78 EXPECT_JS_TRUE(webView.page(), "document.hidden"); 78 __block bool done = false; 79 WKPageRef page = webView.page(); 80 dispatch_async(dispatch_get_main_queue(), ^{ 81 EXPECT_JS_TRUE(page, "document.hidden"); 82 done = true; 83 }); 84 85 Util::run(&done); 79 86 } 80 87
Note:
See TracChangeset
for help on using the changeset viewer.