Changeset 283456 in webkit
- Timestamp:
- Oct 2, 2021, 5:24:58 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/Cocoa/WebProcessProxyCocoa.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r283431 r283456 1 2021-10-02 Chris Dumez <cdumez@apple.com> 2 3 REGRESSION (r275455): ASSERTION FAILED: process->hasOneRef() seen with TestWebKitAPI.WKProcessPool.WarmInitialProcess 4 https://bugs.webkit.org/show_bug.cgi?id=231106 5 6 Reviewed by Geoffrey Garen. 7 8 r275455 added a dispatch_async() which captures a Ref<> to a WebProcessProxy. This may cause the WebProcessProxy to 9 outlive its WebProcessPool (prewarmed WebProcessProxies to not ref their WebProcessPool), which is not supported. 10 We could fix the crash by also capturing a Ref<> to the WebProcessPool in the lambda. However, in this particular 11 instance, it does not seem useful to extend the lifetime of the WebProcessProxy / WebProcessPool so I opted to use 12 a WeakPtr. 13 14 No new tests, covered by existing API test crashing in debug. 15 16 * UIProcess/Cocoa/WebProcessProxyCocoa.mm: 17 (WebKit::WebProcessProxy::sendAudioComponentRegistrations): 18 1 19 2021-10-01 Chris Dumez <cdumez@apple.com> 2 20 -
trunk/Source/WebKit/UIProcess/Cocoa/WebProcessProxyCocoa.mm
r282889 r283456 297 297 return; 298 298 299 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), [ protectedThis = Ref { *this }] () mutable {299 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), [weakThis = makeWeakPtr(*this)] () mutable { 300 300 CFDataRef registrations { nullptr }; 301 301 … … 305 305 return; 306 306 307 RunLoop::main().dispatch([protectedThis = WTFMove(protectedThis), registrations = adoptCF(registrations)] () mutable { 307 RunLoop::main().dispatch([weakThis = WTFMove(weakThis), registrations = adoptCF(registrations)] () mutable { 308 if (!weakThis) 309 return; 310 308 311 auto registrationData = WebCore::SharedBuffer::create(registrations.get()); 309 protectedThis->send(Messages::WebProcess::ConsumeAudioComponentRegistrations({ registrationData }), 0);312 weakThis->send(Messages::WebProcess::ConsumeAudioComponentRegistrations({ registrationData }), 0); 310 313 }); 311 314 });
Note:
See TracChangeset
for help on using the changeset viewer.