• commit-queue@webkit.org's avatar
    Add data passing to the GetStats interface of RTCPeerConnection · 301e929c
    commit-queue@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=98003
    
    Patch by Harald Alvestrand <hta@google.com> on 2012-10-03
    Reviewed by Adam Barth.
    
    Source/Platform:
    
    * Platform.gypi:
    * chromium/public/WebRTCStatsRequest.h:
    (WebKit):
    (WebRTCStatsRequest):
    * chromium/public/WebRTCStatsResponse.h: Added.
    (WebCore):
    (WebKit):
    (WebRTCStatsResponse):
    (WebKit::WebRTCStatsResponse::WebRTCStatsResponse):
    (WebKit::WebRTCStatsResponse::~WebRTCStatsResponse):
    (WebKit::WebRTCStatsResponse::operator=):
    
    Source/WebCore:
    
    Added an RTCStatsResponseBase interface to platform, and let the
    RTCStatsRequestImpl class produce an implementation of it that's returned
    to WebCore.
    
    Tested by extension of the RTCPeerConnection-stats.html test.
    
    * Modules/mediastream/RTCStatsElement.cpp:
    (WebCore::RTCStatsElement::addStatistic):
    (WebCore):
    * Modules/mediastream/RTCStatsElement.h:
    (RTCStatsElement):
    * Modules/mediastream/RTCStatsReport.cpp:
    (WebCore):
    (WebCore::RTCStatsReport::addElement):
    (WebCore::RTCStatsReport::addStatistic):
    * Modules/mediastream/RTCStatsReport.h:
    (RTCStatsReport):
    * Modules/mediastream/RTCStatsRequestImpl.cpp:
    (WebCore::RTCStatsRequestImpl::createResponse):
    (WebCore):
    (WebCore::RTCStatsRequestImpl::requestSucceeded):
    * Modules/mediastream/RTCStatsRequestImpl.h:
    (RTCStatsRequestImpl):
    * Modules/mediastream/RTCStatsResponse.cpp:
    (WebCore::RTCStatsResponse::create):
    (WebCore::RTCStatsResponse::addReport):
    (WebCore):
    (WebCore::RTCStatsResponse::addElement):
    (WebCore::RTCStatsResponse::addStatistic):
    * Modules/mediastream/RTCStatsResponse.h:
    (RTCStatsResponse):
    * WebCore.gypi:
    * platform/chromium/support/WebRTCStatsRequest.cpp:
    (WebKit::WebRTCStatsRequest::response):
    (WebKit):
    (WebKit::WebRTCStatsRequest::requestSucceeded):
    * platform/chromium/support/WebRTCStatsResponse.cpp: Added.
    (WebKit):
    (WebKit::WebRTCStatsResponse::WebRTCStatsResponse):
    (WebKit::WebRTCStatsResponse::assign):
    (WebKit::WebRTCStatsResponse::reset):
    (WebKit::WebRTCStatsResponse::operator WTF::PassRefPtr<WebCore::RTCStatsResponseBase>):
    (WebKit::WebRTCStatsResponse::addReport):
    (WebKit::WebRTCStatsResponse::addElement):
    (WebKit::WebRTCStatsResponse::addStatistic):
    * platform/mediastream/RTCStatsRequest.h:
    (WebCore):
    (RTCStatsRequest):
    * platform/mediastream/RTCStatsResponseBase.h: Added.
    (WebCore):
    (RTCStatsResponseBase):
    (WebCore::RTCStatsResponseBase::~RTCStatsResponseBase):
    
    Tools:
    
    * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp:
    (RTCStatsRequestSucceededTask::RTCStatsRequestSucceededTask):
    (MockWebRTCPeerConnectionHandler::MockWebRTCPeerConnectionHandler):
    (MockWebRTCPeerConnectionHandler::addStream):
    (MockWebRTCPeerConnectionHandler::removeStream):
    (MockWebRTCPeerConnectionHandler::getStats):
    * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h:
    (MockWebRTCPeerConnectionHandler):
    
    LayoutTests:
    
    * fast/mediastream/RTCPeerConnection-stats-expected.txt:
    * fast/mediastream/RTCPeerConnection-stats.html:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    301e929c
RTCStatsRequestImpl.h 2.28 KB