Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add data passing to the GetStats interface of RTCPeerConnection
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: Canonical link: https://commits.webkit.org/116257@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
472 additions
and 20 deletions.
- +10 −0 LayoutTests/ChangeLog
- +9 −2 LayoutTests/fast/mediastream/RTCPeerConnection-stats-expected.txt
- +38 −3 LayoutTests/fast/mediastream/RTCPeerConnection-stats.html
- +19 −0 Source/Platform/ChangeLog
- +2 −0 Source/Platform/Platform.gypi
- +26 −1 Source/Platform/chromium/public/WebRTCStatsRequest.h
- +70 −0 Source/Platform/chromium/public/WebRTCStatsResponse.h
- +60 −0 Source/WebCore/ChangeLog
- +5 −0 Source/WebCore/Modules/mediastream/RTCStatsElement.cpp
- +1 −0 Source/WebCore/Modules/mediastream/RTCStatsElement.h
- +21 −0 Source/WebCore/Modules/mediastream/RTCStatsReport.cpp
- +3 −0 Source/WebCore/Modules/mediastream/RTCStatsReport.h
- +7 −4 Source/WebCore/Modules/mediastream/RTCStatsRequestImpl.cpp
- +3 −1 Source/WebCore/Modules/mediastream/RTCStatsRequestImpl.h
- +18 −1 Source/WebCore/Modules/mediastream/RTCStatsResponse.cpp
- +6 −1 Source/WebCore/Modules/mediastream/RTCStatsResponse.h
- +1 −0 Source/WebCore/WebCore.gypi
- +9 −2 Source/WebCore/platform/chromium/support/WebRTCStatsRequest.cpp
- +76 −0 Source/WebCore/platform/chromium/support/WebRTCStatsResponse.cpp
- +4 −1 Source/WebCore/platform/mediastream/RTCStatsRequest.h
- +49 −0 Source/WebCore/platform/mediastream/RTCStatsResponseBase.h
- +16 −0 Tools/ChangeLog
- +18 −4 Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp
- +1 −0 Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,70 @@ | ||
/* | ||
* Copyright (C) 2012 Google Inc. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY | ||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY | ||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#ifndef WebRTCStatsResponse_h | ||
#define WebRTCStatsResponse_h | ||
|
||
#include "WebCommon.h" | ||
#include "WebPrivatePtr.h" | ||
#include "WebString.h" | ||
|
||
namespace WebCore { | ||
class RTCStatsResponseBase; | ||
} | ||
|
||
namespace WebKit { | ||
|
||
class WebRTCStatsResponse { | ||
public: | ||
WebRTCStatsResponse() { } | ||
WebRTCStatsResponse(const WebRTCStatsResponse& other) { assign(other); } | ||
~WebRTCStatsResponse() { reset(); } | ||
|
||
WebRTCStatsResponse& operator=(const WebRTCStatsResponse& other) | ||
{ | ||
assign(other); | ||
return *this; | ||
} | ||
|
||
WEBKIT_EXPORT void assign(const WebRTCStatsResponse&); | ||
|
||
WEBKIT_EXPORT void reset(); | ||
|
||
WEBKIT_EXPORT size_t addReport(); | ||
WEBKIT_EXPORT size_t addElement(size_t report, bool isLocal, long timestamp); | ||
WEBKIT_EXPORT void addStatistic(size_t report, bool isLocal, size_t element, WebString name, WebString value); | ||
|
||
#if WEBKIT_IMPLEMENTATION | ||
WebRTCStatsResponse(const WTF::PassRefPtr<WebCore::RTCStatsResponseBase>&); | ||
|
||
operator WTF::PassRefPtr<WebCore::RTCStatsResponseBase>() const; | ||
#endif | ||
|
||
private: | ||
WebPrivatePtr<WebCore::RTCStatsResponseBase> m_private; | ||
}; | ||
|
||
} // namespace WebKit | ||
|
||
#endif // WebRTCStatsResponse_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.