Move stats gathering out of LibWebRTCMediaEndpoint
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Aug 2018 23:27:20 +0000 (23:27 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Aug 2018 23:27:20 +0000 (23:27 +0000)
commitb8770b6e5f5d980b1b19fa2dc735d731978daceb
tree0d3ab0f1276b718f26bd0a0dfd2ba926152bcec5
parentc3413d46c478a78f6b024e805c7d087ab8926f05
Move stats gathering out of LibWebRTCMediaEndpoint
https://bugs.webkit.org/show_bug.cgi?id=189180

Reviewed by Alejandro G. Castro.

Move stats gathering in LibWebRTCStatsCollector.
Make sure that the lambda given to the collector is always called and destroyed from the main thread.
This allows capturing the promise here instead of storing it into the peer connection backend.
No change of behavior.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::getStats):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::getStats):
(WebCore::LibWebRTCPeerConnectionBackend::doStop):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: Added.
(WebCore::LibWebRTCStatsCollector::LibWebRTCStatsCollector):
(WebCore::LibWebRTCStatsCollector::~LibWebRTCStatsCollector):
(WebCore::fromStdString):
(WebCore::fillRTCStats):
(WebCore::fillRTCRTPStreamStats):
(WebCore::fillInboundRTPStreamStats):
(WebCore::fillOutboundRTPStreamStats):
(WebCore::fillRTCMediaStreamTrackStats):
(WebCore::fillRTCDataChannelStats):
(WebCore::iceCandidatePairState):
(WebCore::fillRTCIceCandidatePairStats):
(WebCore::fillRTCCertificateStats):
(WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.h: Added.
(WebCore::LibWebRTCStatsCollector::create):
* WebCore.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235576 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp [new file with mode: 0644]
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.h [new file with mode: 0644]
Source/WebCore/WebCore.xcodeproj/project.pbxproj