Title: [135500] trunk
Revision
135500
Author
[email protected]
Date
2012-11-22 02:59:51 -0800 (Thu, 22 Nov 2012)

Log Message

Name enumerator function for GetStats RTCStatsElement
https://bugs.webkit.org/show_bug.cgi?id=102933

Patch by Harald Alvestrand <[email protected]> on 2012-11-22
Reviewed by Adam Barth.

Source/WebCore:

Tested by extensions to the RTCPeerConnection-stats test.

* Modules/mediastream/RTCStatsElement.cpp:
(WebCore::RTCStatsElement::names):
(WebCore):
* Modules/mediastream/RTCStatsElement.h:
(RTCStatsElement):
* Modules/mediastream/RTCStatsElement.idl:

LayoutTests:

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

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (135499 => 135500)


--- trunk/LayoutTests/ChangeLog	2012-11-22 10:12:07 UTC (rev 135499)
+++ trunk/LayoutTests/ChangeLog	2012-11-22 10:59:51 UTC (rev 135500)
@@ -1,3 +1,13 @@
+2012-11-22  Harald Alvestrand  <[email protected]>
+
+        Name enumerator function for GetStats RTCStatsElement
+        https://bugs.webkit.org/show_bug.cgi?id=102933
+
+        Reviewed by Adam Barth.
+
+        * fast/mediastream/RTCPeerConnection-stats-expected.txt:
+        * fast/mediastream/RTCPeerConnection-stats.html:
+
 2012-11-22  Kristóf Kosztyó  <[email protected]>
 
         [Qt] Unreviewed gardening

Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats-expected.txt (135499 => 135500)


--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats-expected.txt	2012-11-22 10:12:07 UTC (rev 135499)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats-expected.txt	2012-11-22 10:59:51 UTC (rev 135500)
@@ -14,6 +14,8 @@
 PASS statsHandler2 was called
 PASS result.length is >= 2
 PASS timestamp is >= startTime
+PASS local.names().length is >= 1
+PASS local.names().indexOf("type") is >= 0
 PASS local.stat("type") is "audio"
 PASS successfullyParsed is true
 

Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats.html (135499 => 135500)


--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats.html	2012-11-22 10:12:07 UTC (rev 135499)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats.html	2012-11-22 10:59:51 UTC (rev 135500)
@@ -1,3 +1,4 @@
+
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 <html>
 <head>
@@ -51,6 +52,8 @@
     local = result[0].local;
     timestamp = local.timestamp;
     shouldBeGreaterThanOrEqual('timestamp', 'startTime');
+    shouldBeGreaterThanOrEqual('local.names().length', '1');
+    shouldBeGreaterThanOrEqual('local.names().indexOf("type")', '0');
     shouldBe('local.stat("type")', '"audio"');
     finishJSTest();
 }

Modified: trunk/Source/WebCore/ChangeLog (135499 => 135500)


--- trunk/Source/WebCore/ChangeLog	2012-11-22 10:12:07 UTC (rev 135499)
+++ trunk/Source/WebCore/ChangeLog	2012-11-22 10:59:51 UTC (rev 135500)
@@ -1,3 +1,19 @@
+2012-11-22  Harald Alvestrand  <[email protected]>
+
+        Name enumerator function for GetStats RTCStatsElement
+        https://bugs.webkit.org/show_bug.cgi?id=102933
+
+        Reviewed by Adam Barth.
+
+        Tested by extensions to the RTCPeerConnection-stats test.
+
+        * Modules/mediastream/RTCStatsElement.cpp:
+        (WebCore::RTCStatsElement::names):
+        (WebCore):
+        * Modules/mediastream/RTCStatsElement.h:
+        (RTCStatsElement):
+        * Modules/mediastream/RTCStatsElement.idl:
+
 2012-11-22  Kentaro Hara  <[email protected]>
 
         Rename the "eden" bit to something more descriptive

Modified: trunk/Source/WebCore/Modules/mediastream/RTCStatsElement.cpp (135499 => 135500)


--- trunk/Source/WebCore/Modules/mediastream/RTCStatsElement.cpp	2012-11-22 10:12:07 UTC (rev 135499)
+++ trunk/Source/WebCore/Modules/mediastream/RTCStatsElement.cpp	2012-11-22 10:59:51 UTC (rev 135500)
@@ -47,6 +47,16 @@
     return m_stats.get(name);
 }
 
+Vector<String> RTCStatsElement::names() const
+{
+    Vector<String> result;
+    for (HashMap<String, String>::const_iterator it = m_stats.begin();
+        it != m_stats.end(); ++it) {
+        result.append(it->key);
+    }
+    return result;
+}
+
 void RTCStatsElement::addStatistic(const String& name, const String& value)
 {
     m_stats.add(name, value);

Modified: trunk/Source/WebCore/Modules/mediastream/RTCStatsElement.h (135499 => 135500)


--- trunk/Source/WebCore/Modules/mediastream/RTCStatsElement.h	2012-11-22 10:12:07 UTC (rev 135499)
+++ trunk/Source/WebCore/Modules/mediastream/RTCStatsElement.h	2012-11-22 10:59:51 UTC (rev 135500)
@@ -37,6 +37,7 @@
     static PassRefPtr<RTCStatsElement> create(double timestamp);
     double timestamp() const { return m_timestamp; }
     String stat(const String& name) const;
+    Vector<String> names() const;
     void addStatistic(const String& name, const String& value);
 
 private:

Modified: trunk/Source/WebCore/Modules/mediastream/RTCStatsElement.idl (135499 => 135500)


--- trunk/Source/WebCore/Modules/mediastream/RTCStatsElement.idl	2012-11-22 10:12:07 UTC (rev 135499)
+++ trunk/Source/WebCore/Modules/mediastream/RTCStatsElement.idl	2012-11-22 10:59:51 UTC (rev 135500)
@@ -27,4 +27,5 @@
 ] interface RTCStatsElement {
     readonly attribute Date timestamp;
     DOMString stat(in DOMString name);
+    sequence<String> names();
 };
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to