From 5fa196cc119788a895b88791c1b488af87eb832a Mon Sep 17 00:00:00 2001 From: "cdumez@apple.com" Date: Mon, 16 Jul 2018 18:55:08 +0000 Subject: [PATCH] Make sure LibWebRTCMediaEndpoint is always destroyed on the main thread https://bugs.webkit.org/show_bug.cgi?id=187702 Reviewed by Youenn Fablet. Make sure LibWebRTCMediaEndpoint is always constructed and destructed on the main thread since it has a Timer data member and it would not be safe otherwise. LibWebRTCMediaEndpoint is ThreadSafeRefCounted and frequently passed to other threads. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233857 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 15 +++++++++++++++ .../mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp | 1 + .../mediastream/libwebrtc/LibWebRTCMediaEndpoint.h | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 98097e7..e020dce 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,18 @@ +2018-07-16 Chris Dumez + + Make sure LibWebRTCMediaEndpoint is always destroyed on the main thread + https://bugs.webkit.org/show_bug.cgi?id=187702 + + Reviewed by Youenn Fablet. + + Make sure LibWebRTCMediaEndpoint is always constructed and destructed on the main thread since + it has a Timer data member and it would not be safe otherwise. LibWebRTCMediaEndpoint is + ThreadSafeRefCounted and frequently passed to other threads. + + * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: + (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint): + * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: + 2018-07-16 Sihui Liu IndexedDB: closeAndDeleteDatabasesForOrigins should remove all databases for those origins diff --git a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp index 64e2bbf..ac97196 100644 --- a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp +++ b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp @@ -74,6 +74,7 @@ LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint(LibWebRTCPeerConnectionBackend& p , m_logIdentifier(peerConnection.logIdentifier()) #endif { + ASSERT(isMainThread()); ASSERT(client.factory()); } diff --git a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h index 22ae284..297b60c 100644 --- a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h +++ b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h @@ -57,7 +57,7 @@ class MediaStreamTrack; class RTCSessionDescription; class LibWebRTCMediaEndpoint - : public ThreadSafeRefCounted + : public ThreadSafeRefCounted , private webrtc::PeerConnectionObserver , private webrtc::RTCStatsCollectorCallback #if !RELEASE_LOG_DISABLED -- 1.8.3.1