Diff
Modified: trunk/LayoutTests/ChangeLog (130767 => 130768)
--- trunk/LayoutTests/ChangeLog 2012-10-09 15:54:04 UTC (rev 130767)
+++ trunk/LayoutTests/ChangeLog 2012-10-09 15:56:07 UTC (rev 130768)
@@ -1,3 +1,14 @@
+2012-10-09 Harald Alvestrand <[email protected]>
+
+ Change PeerConnection getStats function to single value local / remote
+ elements in RTCStatsReport.
+ https://bugs.webkit.org/show_bug.cgi?id=98753
+
+ Reviewed by Adam Barth.
+
+ * fast/mediastream/RTCPeerConnection-stats-expected.txt:
+ * fast/mediastream/RTCPeerConnection-stats.html:
+
2012-10-09 Adam Barth <[email protected]>
Unreviewed. Add chromium-mac specific results for these tests. They
Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats-expected.txt (130767 => 130768)
--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats-expected.txt 2012-10-09 15:54:04 UTC (rev 130767)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats-expected.txt 2012-10-09 15:56:07 UTC (rev 130768)
@@ -13,9 +13,8 @@
PASS pc.getStats(statsHandler2) did not throw exception.
PASS statsHandler2 was called
PASS result.length is >= 2
-PASS local.length is 1
PASS timestamp is >= startTime
-PASS local[0].stat("type") is "audio"
+PASS local.stat("type") is "audio"
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats.html (130767 => 130768)
--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats.html 2012-10-09 15:54:04 UTC (rev 130767)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats.html 2012-10-09 15:56:07 UTC (rev 130768)
@@ -48,11 +48,10 @@
testPassed("statsHandler2 was called");
result = status.result();
shouldBeGreaterThanOrEqual('result.length', '2');
- local = result[0].local();
- shouldBe('local.length', '1');
- timestamp = local[0].timestamp;
+ local = result[0].local;
+ timestamp = local.timestamp;
shouldBeGreaterThanOrEqual('timestamp', 'startTime');
- shouldBe('local[0].stat("type")', '"audio"');
+ shouldBe('local.stat("type")', '"audio"');
finishJSTest();
}
Modified: trunk/Source/Platform/ChangeLog (130767 => 130768)
--- trunk/Source/Platform/ChangeLog 2012-10-09 15:54:04 UTC (rev 130767)
+++ trunk/Source/Platform/ChangeLog 2012-10-09 15:56:07 UTC (rev 130768)
@@ -1,3 +1,14 @@
+2012-10-09 Harald Alvestrand <[email protected]>
+
+ Change PeerConnection getStats function to single value local / remote
+ elements in RTCStatsReport.
+ https://bugs.webkit.org/show_bug.cgi?id=98753
+
+ Reviewed by Adam Barth.
+
+ * chromium/public/WebRTCStatsResponse.h:
+ (WebRTCStatsResponse):
+
2012-10-04 Harald Alvestrand <[email protected]>
Change RTCPeerConnection GetStats to use Date timestamp format
Modified: trunk/Source/Platform/chromium/public/WebRTCStatsResponse.h (130767 => 130768)
--- trunk/Source/Platform/chromium/public/WebRTCStatsResponse.h 2012-10-09 15:54:04 UTC (rev 130767)
+++ trunk/Source/Platform/chromium/public/WebRTCStatsResponse.h 2012-10-09 15:56:07 UTC (rev 130768)
@@ -52,8 +52,8 @@
WEBKIT_EXPORT void reset();
WEBKIT_EXPORT size_t addReport();
- WEBKIT_EXPORT size_t addElement(size_t report, bool isLocal, double timestamp);
- WEBKIT_EXPORT void addStatistic(size_t report, bool isLocal, size_t element, WebString name, WebString value);
+ WEBKIT_EXPORT void addElement(size_t report, bool isLocal, double timestamp);
+ WEBKIT_EXPORT void addStatistic(size_t report, bool isLocal, WebString name, WebString value);
#if WEBKIT_IMPLEMENTATION
WebRTCStatsResponse(const WTF::PassRefPtr<WebCore::RTCStatsResponseBase>&);
Modified: trunk/Source/WebCore/ChangeLog (130767 => 130768)
--- trunk/Source/WebCore/ChangeLog 2012-10-09 15:54:04 UTC (rev 130767)
+++ trunk/Source/WebCore/ChangeLog 2012-10-09 15:56:07 UTC (rev 130768)
@@ -1,3 +1,38 @@
+2012-10-09 Harald Alvestrand <[email protected]>
+
+ Change PeerConnection getStats function to single value local / remote
+ elements in RTCStatsReport.
+
+ https://bugs.webkit.org/show_bug.cgi?id=98753
+
+ Reviewed by Adam Barth.
+
+ IDL of RTCStatsReport has been changed to make local/remote
+ single valued RTCStatsElement attributes.
+ The RTCStatsReport argument to index the list of RTCStatsElement
+ in the local and remote functions has been removed.
+
+ Tested by modifications to RTCPeerConnection-stats.html
+
+ * Modules/mediastream/RTCStatsReport.cpp:
+ (WebCore::RTCStatsReport::addElement):
+ (WebCore::RTCStatsReport::addStatistic):
+ * Modules/mediastream/RTCStatsReport.h:
+ (WebCore::RTCStatsReport::local):
+ (WebCore::RTCStatsReport::remote):
+ (RTCStatsReport):
+ * Modules/mediastream/RTCStatsReport.idl:
+ * Modules/mediastream/RTCStatsResponse.cpp:
+ (WebCore::RTCStatsResponse::addElement):
+ (WebCore::RTCStatsResponse::addStatistic):
+ * Modules/mediastream/RTCStatsResponse.h:
+ (RTCStatsResponse):
+ * platform/chromium/support/WebRTCStatsResponse.cpp:
+ (WebKit::WebRTCStatsResponse::addElement):
+ (WebKit::WebRTCStatsResponse::addStatistic):
+ * platform/mediastream/RTCStatsResponseBase.h:
+ (RTCStatsResponseBase):
+
2012-10-09 Antonio Gomes <[email protected]>
Get rid of FIXED_POSITION_CREATES_STACKING_CONTEXT in favor of Settings::fixedPositionCreatesStackingContext()
Modified: trunk/Source/WebCore/Modules/mediastream/RTCStatsReport.cpp (130767 => 130768)
--- trunk/Source/WebCore/Modules/mediastream/RTCStatsReport.cpp 2012-10-09 15:54:04 UTC (rev 130767)
+++ trunk/Source/WebCore/Modules/mediastream/RTCStatsReport.cpp 2012-10-09 15:56:07 UTC (rev 130768)
@@ -39,24 +39,24 @@
{
}
-size_t RTCStatsReport::addElement(bool isLocal, double timestamp)
+void RTCStatsReport::addElement(bool isLocal, double timestamp)
{
if (isLocal) {
- m_local.append(RTCStatsElement::create(timestamp));
- return m_local.size() - 1;
+ ASSERT(!m_local);
+ m_local = RTCStatsElement::create(timestamp);
}
- m_remote.append(RTCStatsElement::create(timestamp));
- return m_remote.size() - 1;
+ ASSERT(!m_remote);
+ m_remote = RTCStatsElement::create(timestamp);
}
-void RTCStatsReport::addStatistic(bool isLocal, size_t element, String name, String value)
+void RTCStatsReport::addStatistic(bool isLocal, String name, String value)
{
if (isLocal) {
- ASSERT(element >= 0 && element < m_local.size());
- m_local[element]->addStatistic(name, value);
+ ASSERT(m_local);
+ m_local->addStatistic(name, value);
} else {
- ASSERT(element >= 0 && element < m_remote.size());
- m_remote[element]->addStatistic(name, value);
+ ASSERT(m_remote);
+ m_remote->addStatistic(name, value);
}
}
Modified: trunk/Source/WebCore/Modules/mediastream/RTCStatsReport.h (130767 => 130768)
--- trunk/Source/WebCore/Modules/mediastream/RTCStatsReport.h 2012-10-09 15:54:04 UTC (rev 130767)
+++ trunk/Source/WebCore/Modules/mediastream/RTCStatsReport.h 2012-10-09 15:56:07 UTC (rev 130768)
@@ -37,17 +37,17 @@
public:
static PassRefPtr<RTCStatsReport> create();
- const Vector<RefPtr<RTCStatsElement> >& local() const { return m_local; }
- const Vector<RefPtr<RTCStatsElement> >& remote() const { return m_remote; }
+ const PassRefPtr<RTCStatsElement> local() const { return m_local.get(); }
+ const PassRefPtr<RTCStatsElement> remote() const { return m_remote.get(); }
- size_t addElement(bool isLocal, double timestamp);
- void addStatistic(bool isLocal, size_t element, String name, String value);
+ void addElement(bool isLocal, double timestamp);
+ void addStatistic(bool isLocal, String name, String value);
private:
RTCStatsReport();
- Vector<RefPtr<RTCStatsElement> > m_local;
- Vector<RefPtr<RTCStatsElement> > m_remote;
+ RefPtr<RTCStatsElement> m_local;
+ RefPtr<RTCStatsElement> m_remote;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/Modules/mediastream/RTCStatsReport.idl (130767 => 130768)
--- trunk/Source/WebCore/Modules/mediastream/RTCStatsReport.idl 2012-10-09 15:54:04 UTC (rev 130767)
+++ trunk/Source/WebCore/Modules/mediastream/RTCStatsReport.idl 2012-10-09 15:56:07 UTC (rev 130768)
@@ -27,7 +27,7 @@
interface [
Conditional=MEDIA_STREAM
] RTCStatsReport {
- sequence<RTCStatsElement> local();
- sequence<RTCStatsElement> remote();
+ readonly attribute RTCStatsElement local;
+ readonly attribute RTCStatsElement remote;
};
}
Modified: trunk/Source/WebCore/Modules/mediastream/RTCStatsResponse.cpp (130767 => 130768)
--- trunk/Source/WebCore/Modules/mediastream/RTCStatsResponse.cpp 2012-10-09 15:54:04 UTC (rev 130767)
+++ trunk/Source/WebCore/Modules/mediastream/RTCStatsResponse.cpp 2012-10-09 15:56:07 UTC (rev 130768)
@@ -45,16 +45,16 @@
return m_result.size() - 1;
}
-size_t RTCStatsResponse::addElement(size_t report, bool isLocal, double timestamp)
+void RTCStatsResponse::addElement(size_t report, bool isLocal, double timestamp)
{
ASSERT(report >= 0 && report < m_result.size());
- return m_result[report]->addElement(isLocal, timestamp);
+ m_result[report]->addElement(isLocal, timestamp);
}
-void RTCStatsResponse::addStatistic(size_t report, bool isLocal, size_t element, String name, String value)
+void RTCStatsResponse::addStatistic(size_t report, bool isLocal, String name, String value)
{
ASSERT(report >= 0 && report < m_result.size());
- return m_result[report]->addStatistic(isLocal, element, name, value);
+ m_result[report]->addStatistic(isLocal, name, value);
}
} // namespace WebCore
Modified: trunk/Source/WebCore/Modules/mediastream/RTCStatsResponse.h (130767 => 130768)
--- trunk/Source/WebCore/Modules/mediastream/RTCStatsResponse.h 2012-10-09 15:54:04 UTC (rev 130767)
+++ trunk/Source/WebCore/Modules/mediastream/RTCStatsResponse.h 2012-10-09 15:56:07 UTC (rev 130768)
@@ -45,8 +45,8 @@
const Vector<RefPtr<RTCStatsReport> >& result() const { return m_result; };
virtual size_t addReport() OVERRIDE;
- virtual size_t addElement(size_t report, bool isLocal, double timestamp) OVERRIDE;
- virtual void addStatistic(size_t report, bool isLocal, size_t element, String name, String value) OVERRIDE;
+ virtual void addElement(size_t report, bool isLocal, double timestamp) OVERRIDE;
+ virtual void addStatistic(size_t report, bool isLocal, String name, String value) OVERRIDE;
private:
RTCStatsResponse();
Modified: trunk/Source/WebCore/platform/chromium/support/WebRTCStatsResponse.cpp (130767 => 130768)
--- trunk/Source/WebCore/platform/chromium/support/WebRTCStatsResponse.cpp 2012-10-09 15:54:04 UTC (rev 130767)
+++ trunk/Source/WebCore/platform/chromium/support/WebRTCStatsResponse.cpp 2012-10-09 15:56:07 UTC (rev 130768)
@@ -60,14 +60,14 @@
return m_private->addReport();
}
-size_t WebRTCStatsResponse::addElement(size_t report, bool isLocal, double timestamp)
+void WebRTCStatsResponse::addElement(size_t report, bool isLocal, double timestamp)
{
- return m_private->addElement(report, isLocal, timestamp);
+ m_private->addElement(report, isLocal, timestamp);
}
-void WebRTCStatsResponse::addStatistic(size_t report, bool isLocal, size_t element, WebString name, WebString value)
+void WebRTCStatsResponse::addStatistic(size_t report, bool isLocal, WebString name, WebString value)
{
- m_private->addStatistic(report, isLocal, element, name, value);
+ m_private->addStatistic(report, isLocal, name, value);
}
} // namespace WebKit
Modified: trunk/Source/WebCore/platform/mediastream/RTCStatsResponseBase.h (130767 => 130768)
--- trunk/Source/WebCore/platform/mediastream/RTCStatsResponseBase.h 2012-10-09 15:54:04 UTC (rev 130767)
+++ trunk/Source/WebCore/platform/mediastream/RTCStatsResponseBase.h 2012-10-09 15:56:07 UTC (rev 130768)
@@ -38,8 +38,8 @@
virtual ~RTCStatsResponseBase() { }
virtual size_t addReport() = 0;
- virtual size_t addElement(size_t report, bool isLocal, double timestamp) = 0;
- virtual void addStatistic(size_t report, bool isLocal, size_t element, String name, String value) = 0;
+ virtual void addElement(size_t report, bool isLocal, double timestamp) = 0;
+ virtual void addStatistic(size_t report, bool isLocal, String name, String value) = 0;
};
} // namespace WebCore
@@ -47,3 +47,4 @@
#endif // ENABLE(MEDIA_STREAM)
#endif // RTCStatsResponseBase_h
+
Modified: trunk/Tools/ChangeLog (130767 => 130768)
--- trunk/Tools/ChangeLog 2012-10-09 15:54:04 UTC (rev 130767)
+++ trunk/Tools/ChangeLog 2012-10-09 15:56:07 UTC (rev 130768)
@@ -1,3 +1,14 @@
+2012-10-09 Harald Alvestrand <[email protected]>
+
+ Change PeerConnection getStats function to single value local / remote
+ elements in RTCStatsReport.
+ https://bugs.webkit.org/show_bug.cgi?id=98753
+
+ Reviewed by Adam Barth.
+
+ * DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp:
+ (MockWebRTCPeerConnectionHandler::getStats):
+
2012-10-09 Sadrul Habib Chowdhury <[email protected]>
[chromium] Make sure events are transformed correctly for plugins.
Modified: trunk/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp (130767 => 130768)
--- trunk/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp 2012-10-09 15:54:04 UTC (rev 130767)
+++ trunk/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp 2012-10-09 15:56:07 UTC (rev 130768)
@@ -219,11 +219,11 @@
double currentDate = WTF::jsCurrentTime();
for (int i = 0; i < m_streamCount; ++i) {
size_t reportIndex = response.addReport();
- size_t elementIndex = response.addElement(reportIndex, true, currentDate);
- response.addStatistic(reportIndex, true, elementIndex, "type", "audio");
+ response.addElement(reportIndex, true, currentDate);
+ response.addStatistic(reportIndex, true, "type", "audio");
reportIndex = response.addReport();
- elementIndex = response.addElement(reportIndex, true, currentDate);
- response.addStatistic(reportIndex, true, elementIndex, "type", "video");
+ response.addElement(reportIndex, true, currentDate);
+ response.addStatistic(reportIndex, true, "type", "video");
}
postTask(new RTCStatsRequestSucceededTask(this, request, response));
}