Implement the GetStats interface on PeerConnection
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Sep 2012 16:25:45 +0000 (16:25 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Sep 2012 16:25:45 +0000 (16:25 +0000)
commit80f57e60a981d5f240321bea0602a5ef3b501331
tree3d09bff0295c075327c1baaaa4cefcbdc9f0a2b8
parent5040cf6cc6b0735ebc0b37e4b80d6d054e19e94e
Implement the GetStats interface on PeerConnection
https://bugs.webkit.org/show_bug.cgi?id=95193

Source/Platform:

Patch by Harald Tveit Alvestrand <harald@alvestrand.no> on 2012-09-28
Reviewed by Adam Barth.

* chromium/public/WebRTCPeerConnectionHandler.h:
(WebKit):
(WebRTCPeerConnectionHandler):
(WebKit::WebRTCPeerConnectionHandler::getStats):
* chromium/public/WebRTCStatsRequest.h: added.
(WebCore):
(WebKit):
(WebRTCStatsRequest):
(WebKit::WebRTCStatsRequest::WebRTCStatsRequest):
(WebKit::WebRTCStatsRequest::~WebRTCStatsRequest):
(WebKit::WebRTCStatsRequest::operator=):

Source/WebCore:

Specification:
http://dev.w3.org/2011/webrtc/editor/webrtc-20120920.html

Patch by Harald Tveit Alvestrand <harald@alvestrand.no> on 2012-09-28
Reviewed by Adam Barth.

The implementation consists of a pure virtual platform object
(RTCStatsRequest) that is implemented in WebCore, and stores
its information in a straightforward data hierarchy.
This patch adds the call path and the storage structures.
It does not add filling in data.

Test: fast/mediastream/RTCPeerConnection-stats.html

* CMakeLists.txt:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::getStats):
(WebCore):
* Modules/mediastream/RTCPeerConnection.h:
(WebCore):
(RTCPeerConnection):
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCStatsCallback.h: Added.
(WebCore):
(RTCStatsCallback):
(WebCore::RTCStatsCallback::~RTCStatsCallback):
* Modules/mediastream/RTCStatsCallback.idl: Added.
* Modules/mediastream/RTCStatsElement.cpp: Added.
(WebCore):
(WebCore::RTCStatsElement::create):
(WebCore::RTCStatsElement::RTCStatsElement):
(WebCore::RTCStatsElement::stat):
* Modules/mediastream/RTCStatsElement.h: Added.
(WebCore):
(RTCStatsElement):
* Modules/mediastream/RTCStatsElement.idl: Added.
* Modules/mediastream/RTCStatsReport.cpp: Added.
(WebCore):
(WebCore::RTCStatsReport::create):
(WebCore::RTCStatsReport::RTCStatsReport):
* Modules/mediastream/RTCStatsReport.h: Added.
(WebCore):
(RTCStatsReport):
(WebCore::RTCStatsReport::local):
(WebCore::RTCStatsReport::remote):
* Modules/mediastream/RTCStatsReport.idl: Added.
* Modules/mediastream/RTCStatsRequestImpl.cpp: Added.
(WebCore):
(WebCore::RTCStatsRequestImpl::create):
(WebCore::RTCStatsRequestImpl::RTCStatsRequestImpl):
(WebCore::RTCStatsRequestImpl::~RTCStatsRequestImpl):
(WebCore::RTCStatsRequestImpl::requestSucceeded):
(WebCore::RTCStatsRequestImpl::stop):
(WebCore::RTCStatsRequestImpl::clear):
* Modules/mediastream/RTCStatsRequestImpl.h: Added.
(WebCore):
(RTCStatsRequestImpl):
* Modules/mediastream/RTCStatsResponse.cpp: Added.
(WebCore):
(WebCore::RTCStatsResponse::create):
(WebCore::RTCStatsResponse::RTCStatsResponse):
* Modules/mediastream/RTCStatsResponse.h: Added.
(WebCore):
(RTCStatsResponse):
(WebCore::RTCStatsResponse::result):
* Modules/mediastream/RTCStatsResponse.idl: Added.
* WebCore.gypi:
* platform/chromium/support/WebRTCStatsRequest.cpp: Copied from Source/Platform/chromium/public/WebRTCPeerConnectionHandler.h.
(WebKit):
(WebKit::WebRTCStatsRequest::WebRTCStatsRequest):
(WebKit::WebRTCStatsRequest::assign):
(WebKit::WebRTCStatsRequest::reset):
(WebKit::WebRTCStatsRequest::requestSucceeded):
* platform/mediastream/RTCPeerConnectionHandler.h:
(WebCore):
(RTCPeerConnectionHandler):
* platform/mediastream/RTCStatsRequest.h: Copied from Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.h.
(WebCore):
(RTCStatsRequest):
(WebCore::RTCStatsRequest::~RTCStatsRequest):
(WebCore::RTCStatsRequest::RTCStatsRequest):
* platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp:
(WebCore::RTCPeerConnectionHandlerChromium::getStats):
(WebCore):
* platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.h:
(RTCPeerConnectionHandlerChromium):

Tools:

Patch by Harald Tveit Alvestrand <harald@alvestrand.no> on 2012-09-28
Reviewed by Adam Barth.

* DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp:
(RTCStatsRequestSucceededTask):
(RTCStatsRequestSucceededTask::RTCStatsRequestSucceededTask):
(MockWebRTCPeerConnectionHandler::getStats):
* DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h:
(MockWebRTCPeerConnectionHandler):

LayoutTests:

Patch by Harald Tveit Alvestrand <harald@alvestrand.no> on 2012-09-28
Reviewed by Adam Barth.

* fast/mediastream/RTCPeerConnection-stats-expected.txt: Added.
* fast/mediastream/RTCPeerConnection-stats.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
35 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/mediastream/RTCPeerConnection-stats-expected.txt [new file with mode: 0644]
LayoutTests/fast/mediastream/RTCPeerConnection-stats.html [new file with mode: 0644]
Source/Platform/ChangeLog
Source/Platform/chromium/public/WebRTCPeerConnectionHandler.h
Source/Platform/chromium/public/WebRTCStatsRequest.h [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
Source/WebCore/Modules/mediastream/RTCPeerConnection.h
Source/WebCore/Modules/mediastream/RTCPeerConnection.idl
Source/WebCore/Modules/mediastream/RTCStatsCallback.h [new file with mode: 0644]
Source/WebCore/Modules/mediastream/RTCStatsCallback.idl [new file with mode: 0644]
Source/WebCore/Modules/mediastream/RTCStatsElement.cpp [new file with mode: 0644]
Source/WebCore/Modules/mediastream/RTCStatsElement.h [new file with mode: 0644]
Source/WebCore/Modules/mediastream/RTCStatsElement.idl [new file with mode: 0644]
Source/WebCore/Modules/mediastream/RTCStatsReport.cpp [new file with mode: 0644]
Source/WebCore/Modules/mediastream/RTCStatsReport.h [new file with mode: 0644]
Source/WebCore/Modules/mediastream/RTCStatsReport.idl [new file with mode: 0644]
Source/WebCore/Modules/mediastream/RTCStatsRequestImpl.cpp [new file with mode: 0644]
Source/WebCore/Modules/mediastream/RTCStatsRequestImpl.h [new file with mode: 0644]
Source/WebCore/Modules/mediastream/RTCStatsResponse.cpp [new file with mode: 0644]
Source/WebCore/Modules/mediastream/RTCStatsResponse.h [new file with mode: 0644]
Source/WebCore/Modules/mediastream/RTCStatsResponse.idl [new file with mode: 0644]
Source/WebCore/WebCore.gypi
Source/WebCore/platform/chromium/support/WebRTCStatsRequest.cpp [new file with mode: 0644]
Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.cpp
Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.h
Source/WebCore/platform/mediastream/RTCStatsRequest.h [new file with mode: 0644]
Source/WebCore/platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp
Source/WebCore/platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.h
Tools/ChangeLog
Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp
Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h