Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6b704e5e3f5debf5088014a81db4e751bf12a157
https://github.com/WebKit/WebKit/commit/6b704e5e3f5debf5088014a81db4e751bf12a157
Author: David Kilzer <[email protected]>
Date: 2024-11-04 (Mon, 04 Nov 2024)
Changed paths:
M
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
Log Message:
-----------
WebCore::EffectiveRateChangedListener should use a weak observer with
CFNotificationCenter
<https://bugs.webkit.org/show_bug.cgi?id=282468>
<rdar://139098378>
Reviewed by Geoffrey Garen.
*
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(-[WebEffectiveRateChangedListenerObjCAdapter
initWithEffectiveRateChangedListener:]): Add.
(-[WebEffectiveRateChangedListenerObjCAdapter protectedListener]): Add.
- Add WebEffectiveRateChangedListenerObjCAdapter Obj-C class to hold a
weak reference to EffectiveRateChangedListener C++ object.
(WebCore::EffectiveRateChangedListener):
- Change to inherit from
ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr<> so weak references
to EffectiveRateChangedListener may be created.
(WebCore::EffectiveRateChangedListener::~EffectiveRateChangedListener): Add.
- Define a default constructor (drive-by fix).
(WebCore::timebaseEffectiveRateChangedCallback):
- Use WebEffectiveRateChangedListenerObjCAdapter to get RefPtr to
EffectiveRateChangedListener. Either or both may be nil/nullptr if
they have been deallocated.
(WebCore::EffectiveRateChangedListener::stop):
- Switch to use WebEffectiveRateChangedListenerObjCAdapter for observer.
(WebCore::EffectiveRateChangedListener::EffectiveRateChangedListener):
- Instantiate WebEffectiveRateChangedListenerObjCAdapter for
m_objcAdapter.
- Switch to use WebEffectiveRateChangedListenerObjCAdapter for observer.
- Add _CFNotificationObserverIsObjC to suspension behavior so
CFNotificationCenter stores m_objcAdapter using a weak reference.
Canonical link: https://commits.webkit.org/286110@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes