From 485c8f20fcaf756bb045c779eb8c4bc52eb40f82 Mon Sep 17 00:00:00 2001 From: "youenn@apple.com" Date: Thu, 15 Nov 2018 18:25:49 +0000 Subject: [PATCH] Modernize RTCPeerConnection handling of pendingActivity https://bugs.webkit.org/show_bug.cgi?id=191661 Reviewed by Eric Carlson. makePendingActivity is the modern way to handle set/unset of pending activity. No change of behavior. * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::create): (WebCore::RTCPeerConnection::doStop): * Modules/mediastream/RTCPeerConnection.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238232 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 15 +++++++++++++++ Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp | 5 ++--- Source/WebCore/Modules/mediastream/RTCPeerConnection.h | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 666eb7c..c7c2ba9 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,18 @@ +2018-11-15 Youenn Fablet + + Modernize RTCPeerConnection handling of pendingActivity + https://bugs.webkit.org/show_bug.cgi?id=191661 + + Reviewed by Eric Carlson. + + makePendingActivity is the modern way to handle set/unset of pending activity. + No change of behavior. + + * Modules/mediastream/RTCPeerConnection.cpp: + (WebCore::RTCPeerConnection::create): + (WebCore::RTCPeerConnection::doStop): + * Modules/mediastream/RTCPeerConnection.h: + 2018-11-15 Keith Rollin Delete old .xcfilelist files diff --git a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp index 62840e6..0945562 100644 --- a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp +++ b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp @@ -69,7 +69,7 @@ Ref RTCPeerConnection::create(ScriptExecutionContext& context // RTCPeerConnection may send events at about any time during its lifetime. // Let's make it uncollectable until the pc is closed by JS or the page stops it. if (!peerConnection->isClosed()) { - peerConnection->setPendingActivity(peerConnection.ptr()); + peerConnection->m_pendingActivity = peerConnection->makePendingActivity(peerConnection.get()); if (auto* page = downcast(context).page()) peerConnection->registerToController(page->rtcController()); } @@ -463,8 +463,7 @@ void RTCPeerConnection::doStop() m_isStopped = true; m_backend->stop(); - - unsetPendingActivity(this); + m_pendingActivity = nullptr; } void RTCPeerConnection::registerToController(RTCController& controller) diff --git a/Source/WebCore/Modules/mediastream/RTCPeerConnection.h b/Source/WebCore/Modules/mediastream/RTCPeerConnection.h index 2c85401..d671d05 100644 --- a/Source/WebCore/Modules/mediastream/RTCPeerConnection.h +++ b/Source/WebCore/Modules/mediastream/RTCPeerConnection.h @@ -228,6 +228,7 @@ private: RTCConfiguration m_configuration; RTCController* m_controller { nullptr }; Vector> m_certificates; + RefPtr> m_pendingActivity; }; } // namespace WebCore -- 1.8.3.1