[webkit-changes] [WebKit/WebKit] f394e0: Explicitly close a document RTCNetworkManager on d...
youennf
noreply at github.com
Fri Nov 4 03:38:54 PDT 2022
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: f394e0a05ff1d91c0909c4319c5fecd5e4e86b98
https://github.com/WebKit/WebKit/commit/f394e0a05ff1d91c0909c4319c5fecd5e4e86b98
Author: Youenn Fablet <youennf at gmail.com>
Date: 2022-11-04 (Fri, 04 Nov 2022)
Changed paths:
M Source/WebCore/Modules/mediastream/RTCNetworkManager.h
M Source/WebCore/dom/Document.cpp
M Source/WebKit/WebProcess/Network/webrtc/LibWebRTCNetworkManager.cpp
M Source/WebKit/WebProcess/Network/webrtc/LibWebRTCNetworkManager.h
Log Message:
-----------
Explicitly close a document RTCNetworkManager on document teardown
https://bugs.webkit.org/show_bug.cgi?id=247413
rdar://99799545
Reviewed by Eric Carlson.
The combination of keeping a WeakPtr of a ThreadSafeRefCounted is problematic,
as we might have lost the last Ref/RefPtr (hence the object is scheduled to be deleted)
but we still have a non null reference via a WeakPtr, which we could potentially create a new Ref on it.
We fix the particular issue here by closing explicitly LibWebRTCNetworkManager
which will remove the LibWebRTCNetworkManager from the WebRTCMonitor WeakHashSet.
Add ASSERTs to ensure close is called before destroying LibWebRTCNetworkManager.
* Source/WebCore/Modules/mediastream/RTCNetworkManager.h:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::commonTeardown):
* Source/WebKit/WebProcess/Network/webrtc/LibWebRTCNetworkManager.cpp:
(WebKit::LibWebRTCNetworkManager::getOrCreate):
(WebKit::LibWebRTCNetworkManager::LibWebRTCNetworkManager):
(WebKit::LibWebRTCNetworkManager::~LibWebRTCNetworkManager):
(WebKit::LibWebRTCNetworkManager::close):
Canonical link: https://commits.webkit.org/256319@main
More information about the webkit-changes
mailing list