Do not restart WebRTC stats timer if backend is stopped
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Apr 2019 01:11:00 +0000 (01:11 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Apr 2019 01:11:00 +0000 (01:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197257
<rdar://problem/50095879>

Reviewed by Eric Carlson.

We used to stop and reschedule the stat gathering timer in case the
gathering delay is changing. Timer should not be rescheduled if the backend is stopped.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244632 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp

index 80b8138..c5d41d1 100644 (file)
@@ -1,3 +1,17 @@
+2019-04-24  Youenn Fablet  <youenn@apple.com>
+
+        Do not restart WebRTC stats timer if backend is stopped
+        https://bugs.webkit.org/show_bug.cgi?id=197257
+        <rdar://problem/50095879>
+
+        Reviewed by Eric Carlson.
+
+        We used to stop and reschedule the stat gathering timer in case the
+        gathering delay is changing. Timer should not be rescheduled if the backend is stopped.
+
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
+        (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
+
 2019-04-24  Andres Gonzalez  <andresg_22@apple.com>
 
         Flaky crash under WebCore::AXObjectCache::stopCachingComputedObjectAttributes()
index 1a416fa..d50fb09 100644 (file)
@@ -847,7 +847,7 @@ void LibWebRTCMediaEndpoint::OnStatsDelivered(const rtc::scoped_refptr<const web
         m_statsFirstDeliveredTimestamp = timestamp;
 
     callOnMainThread([protectedThis = makeRef(*this), this, timestamp, report] {
-        if (m_statsLogTimer.repeatInterval() != statsLogInterval(timestamp)) {
+        if (m_backend && m_statsLogTimer.repeatInterval() != statsLogInterval(timestamp)) {
             m_statsLogTimer.stop();
             m_statsLogTimer.startRepeating(statsLogInterval(timestamp));
         }