<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[211404] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/211404">211404</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2017-01-30 20:34:26 -0800 (Mon, 30 Jan 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WebRTC] getStats does not support legacy callback
https://bugs.webkit.org/show_bug.cgi?id=167617

Patch by Youenn Fablet &lt;youenn@apple.com&gt; on 2017-01-30
Reviewed by Alex Christensen.

Source/WebCore:

Covered by updated tests.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::getStats):
(WebCore::RTCPeerConnection::privateGetStats): Deleted.
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCPeerConnection.js:
(addIceCandidate):
(getStats): Deleted.

LayoutTests:

* fast/mediastream/RTCPeerConnection-js-built-ins-check-this-expected.txt:
* fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt:
* fast/mediastream/RTCPeerConnection-overloaded-operations-params.html:
* fast/mediastream/RTCPeerConnection-stats.html:
* fast/mediastream/RTCPeerConnection-statsSelector.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamRTCPeerConnectionjsbuiltinscheckthisexpectedtxt">trunk/LayoutTests/fast/mediastream/RTCPeerConnection-js-built-ins-check-this-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamRTCPeerConnectionoverloadedoperationsparamsexpectedtxt">trunk/LayoutTests/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamRTCPeerConnectionoverloadedoperationsparamshtml">trunk/LayoutTests/fast/mediastream/RTCPeerConnection-overloaded-operations-params.html</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamRTCPeerConnectionstatshtml">trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats.html</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamRTCPeerConnectionstatsSelectorhtml">trunk/LayoutTests/fast/mediastream/RTCPeerConnection-statsSelector.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCPeerConnectioncpp">trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCPeerConnectionh">trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCPeerConnectionidl">trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCPeerConnectionjs">trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (211403 => 211404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-01-31 03:37:34 UTC (rev 211403)
+++ trunk/LayoutTests/ChangeLog        2017-01-31 04:34:26 UTC (rev 211404)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2017-01-30  Youenn Fablet  &lt;youenn@apple.com&gt;
+
+        [WebRTC] getStats does not support legacy callback
+        https://bugs.webkit.org/show_bug.cgi?id=167617
+
+        Reviewed by Alex Christensen.
+
+        * fast/mediastream/RTCPeerConnection-js-built-ins-check-this-expected.txt:
+        * fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt:
+        * fast/mediastream/RTCPeerConnection-overloaded-operations-params.html:
+        * fast/mediastream/RTCPeerConnection-stats.html:
+        * fast/mediastream/RTCPeerConnection-statsSelector.html:
+
</ins><span class="cx"> 2017-01-30  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, remove a couple JS files that were missed in r211395.
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamRTCPeerConnectionjsbuiltinscheckthisexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-js-built-ins-check-this-expected.txt (211403 => 211404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-js-built-ins-check-this-expected.txt        2017-01-31 03:37:34 UTC (rev 211403)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-js-built-ins-check-this-expected.txt        2017-01-31 04:34:26 UTC (rev 211404)
</span><span class="lines">@@ -8,13 +8,13 @@
</span><span class="cx"> PASS promise RTCPeerConnection.prototype.setLocalDescription.call({}) rejected with TypeError: Function should be called on an RTCPeerConnection
</span><span class="cx"> PASS promise RTCPeerConnection.prototype.setRemoteDescription.call({}) rejected with TypeError: Function should be called on an RTCPeerConnection
</span><span class="cx"> PASS promise RTCPeerConnection.prototype.addIceCandidate.call({}) rejected with TypeError: Function should be called on an RTCPeerConnection
</span><del>-PASS promise RTCPeerConnection.prototype.getStats.call({}, null) rejected with TypeError: Function should be called on an RTCPeerConnection
</del><ins>+FAIL promise RTCPeerConnection.prototype.getStats.call({}, null) rejected with TypeError: Can only call RTCPeerConnection.getStats on instances of RTCPeerConnection; expected reason TypeError: Function should be called on an RTCPeerConnection
</ins><span class="cx"> PASS promise objectWithPcPrototype.createOffer() rejected with TypeError: Function should be called on an RTCPeerConnection
</span><span class="cx"> PASS promise objectWithPcPrototype.createAnswer() rejected with TypeError: Function should be called on an RTCPeerConnection
</span><span class="cx"> PASS promise objectWithPcPrototype.setLocalDescription() rejected with TypeError: Function should be called on an RTCPeerConnection
</span><span class="cx"> PASS promise objectWithPcPrototype.setRemoteDescription() rejected with TypeError: Function should be called on an RTCPeerConnection
</span><span class="cx"> PASS promise objectWithPcPrototype.addIceCandidate() rejected with TypeError: Function should be called on an RTCPeerConnection
</span><del>-PASS promise objectWithPcPrototype.getStats() rejected with TypeError: Function should be called on an RTCPeerConnection
</del><ins>+FAIL promise objectWithPcPrototype.getStats() rejected with TypeError: Can only call RTCPeerConnection.getStats on instances of RTCPeerConnection; expected reason TypeError: Function should be called on an RTCPeerConnection
</ins><span class="cx"> PASS End of test promise chain
</span><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamRTCPeerConnectionoverloadedoperationsparamsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt (211403 => 211404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt        2017-01-31 03:37:34 UTC (rev 211403)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt        2017-01-31 04:34:26 UTC (rev 211404)
</span><span class="lines">@@ -55,20 +55,11 @@
</span><span class="cx"> PASS promise pc.setLocalDescription(null) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
</span><span class="cx"> PASS promise pc.setLocalDescription(null, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
</span><span class="cx"> PASS promise pc.setLocalDescription(1) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
</span><del>-*** Error callback is mandatory
-PASS promise pc.setLocalDescription(desc, emptyFunc) rejected with TypeError: Not enough arguments
-*** Callbacks are not nullable
-PASS promise pc.setLocalDescription(desc, emptyFunc, null) rejected with TypeError: Argument 3 ('errorCallback') to RTCPeerConnection.setLocalDescription must be a function
-PASS promise pc.setLocalDescription(desc, null, emptyFunc) rejected with TypeError: Argument 2 ('successCallback') to RTCPeerConnection.setLocalDescription must be a function
-PASS promise pc.setLocalDescription(desc, null, null) rejected with TypeError: Argument 2 ('successCallback') to RTCPeerConnection.setLocalDescription must be a function
</del><span class="cx"> *** Bad input as desc
</span><span class="cx"> PASS promise pc.setLocalDescription('foo') rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
</span><span class="cx"> PASS promise pc.setLocalDescription('foo', emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
</span><span class="cx"> PASS promise pc.setLocalDescription(1) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
</span><span class="cx"> PASS promise pc.setLocalDescription(1, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
</span><del>-*** Bad input for callback arguments
-PASS promise pc.setLocalDescription(desc, {}, emptyFunc) rejected with TypeError: Argument 2 ('successCallback') to RTCPeerConnection.setLocalDescription must be a function
-PASS promise pc.setLocalDescription(desc, emptyFunc, {}) rejected with TypeError: Argument 3 ('errorCallback') to RTCPeerConnection.setLocalDescription must be a function
</del><span class="cx"> 
</span><span class="cx"> *** Test setRemoteDescription
</span><span class="cx"> PASS promise pc.setRemoteDescription(desc) did not reject with TypeError.
</span><span class="lines">@@ -79,20 +70,11 @@
</span><span class="cx"> PASS promise pc.setRemoteDescription(null) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
</span><span class="cx"> PASS promise pc.setRemoteDescription(null, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
</span><span class="cx"> PASS promise pc.setRemoteDescription(1) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
</span><del>-*** Error callback is mandatory
-PASS promise pc.setRemoteDescription(desc, emptyFunc) rejected with TypeError: Not enough arguments
-*** Callbacks are not nullable
-PASS promise pc.setRemoteDescription(desc, emptyFunc, null) rejected with TypeError: Argument 3 ('errorCallback') to RTCPeerConnection.setRemoteDescription must be a function
-PASS promise pc.setRemoteDescription(desc, null, emptyFunc) rejected with TypeError: Argument 2 ('successCallback') to RTCPeerConnection.setRemoteDescription must be a function
-PASS promise pc.setRemoteDescription(desc, null, null) rejected with TypeError: Argument 2 ('successCallback') to RTCPeerConnection.setRemoteDescription must be a function
</del><span class="cx"> *** Bad input as desc
</span><span class="cx"> PASS promise pc.setRemoteDescription('foo') rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
</span><span class="cx"> PASS promise pc.setRemoteDescription('foo', emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
</span><span class="cx"> PASS promise pc.setRemoteDescription(1) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
</span><span class="cx"> PASS promise pc.setRemoteDescription(1, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
</span><del>-*** Bad input for callback arguments
-PASS promise pc.setRemoteDescription(desc, {}, emptyFunc) rejected with TypeError: Argument 2 ('successCallback') to RTCPeerConnection.setRemoteDescription must be a function
-PASS promise pc.setRemoteDescription(desc, emptyFunc, {}) rejected with TypeError: Argument 3 ('errorCallback') to RTCPeerConnection.setRemoteDescription must be a function
</del><span class="cx"> 
</span><span class="cx"> *** Test addIceCandidate
</span><span class="cx"> PASS promise pc.addIceCandidate(candidate) did not reject with TypeError.
</span><span class="lines">@@ -103,20 +85,11 @@
</span><span class="cx"> PASS promise pc.addIceCandidate(null) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
</span><span class="cx"> PASS promise pc.addIceCandidate(null, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
</span><span class="cx"> PASS promise pc.addIceCandidate(1) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
</span><del>-*** Error callback is mandatory
-PASS promise pc.addIceCandidate(candidate, emptyFunc) rejected with TypeError: Not enough arguments
-*** Callbacks are not nullable
-PASS promise pc.addIceCandidate(candidate, emptyFunc, null) rejected with TypeError: Argument 3 ('errorCallback') to RTCPeerConnection.addIceCandidate must be a function
-PASS promise pc.addIceCandidate(candidate, null, emptyFunc) rejected with TypeError: Argument 2 ('successCallback') to RTCPeerConnection.addIceCandidate must be a function
-PASS promise pc.addIceCandidate(candidate, null, null) rejected with TypeError: Argument 2 ('successCallback') to RTCPeerConnection.addIceCandidate must be a function
</del><span class="cx"> *** Bad input as candidate
</span><span class="cx"> PASS promise pc.addIceCandidate('foo') rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
</span><span class="cx"> PASS promise pc.addIceCandidate('foo', emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
</span><span class="cx"> PASS promise pc.addIceCandidate(1) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
</span><span class="cx"> PASS promise pc.addIceCandidate(1, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
</span><del>-*** Bad input for callback arguments
-PASS promise pc.addIceCandidate(candidate, {}, emptyFunc) rejected with TypeError: Argument 2 ('successCallback') to RTCPeerConnection.addIceCandidate must be a function
-PASS promise pc.addIceCandidate(candidate, emptyFunc, {}) rejected with TypeError: Argument 3 ('errorCallback') to RTCPeerConnection.addIceCandidate must be a function
</del><span class="cx"> 
</span><span class="cx"> *** Test getStats
</span><span class="cx"> PASS promise pc.getStats() did not reject with TypeError.
</span><span class="lines">@@ -125,20 +98,11 @@
</span><span class="cx"> PASS promise pc.getStats(null, emptyFunc, emptyFunc) did not reject with TypeError.
</span><span class="cx"> PASS promise pc.getStats(selector, emptyFunc, emptyFunc) did not reject with TypeError.
</span><span class="cx"> PASS promise pc.getStats(1) rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
</span><del>-*** Error callback is mandatory
-PASS promise pc.getStats(selector, emptyFunc) rejected with TypeError: Not enough arguments
-*** Callbacks are not nullable
-PASS promise pc.getStats(selector, emptyFunc, null) rejected with TypeError: Argument 3 ('errorCallback') to RTCPeerConnection.getStats must be a function
-PASS promise pc.getStats(selector, null, emptyFunc) rejected with TypeError: Argument 2 ('successCallback') to RTCPeerConnection.getStats must be a function
-PASS promise pc.getStats(selector, null, null) rejected with TypeError: Argument 2 ('successCallback') to RTCPeerConnection.getStats must be a function
</del><span class="cx"> *** Bad input as selector
</span><span class="cx"> PASS promise pc.getStats('foo') rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
</span><span class="cx"> PASS promise pc.getStats('foo', emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
</span><span class="cx"> PASS promise pc.getStats(1) rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
</span><span class="cx"> PASS promise pc.getStats(1, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
</span><del>-*** Bad input for callback arguments
-PASS promise pc.getStats(selector, {}, emptyFunc) rejected with TypeError: Argument 2 ('successCallback') to RTCPeerConnection.getStats must be a function
-PASS promise pc.getStats(selector, emptyFunc, {}) rejected with TypeError: Argument 3 ('errorCallback') to RTCPeerConnection.getStats must be a function
</del><span class="cx"> 
</span><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamRTCPeerConnectionoverloadedoperationsparamshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-overloaded-operations-params.html (211403 => 211404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-overloaded-operations-params.html        2017-01-31 03:37:34 UTC (rev 211403)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-overloaded-operations-params.html        2017-01-31 04:34:26 UTC (rev 211404)
</span><span class="lines">@@ -147,23 +147,8 @@
</span><span class="cx">             function badInput(functionName, firstArg, detailedErrorsArg) {
</span><span class="cx">                 detailedErrors = detailedErrorsArg;
</span><span class="cx"> 
</span><del>-                return new Promise(function (resolve) {
-                    promiseShouldReject(`pc.${functionName}(1)`, &quot;detailedErrors.arg1&quot;)
</del><ins>+                return promiseShouldReject(`pc.${functionName}(1)`, &quot;detailedErrors.arg1&quot;)
</ins><span class="cx">                     .then(function () {
</span><del>-                        debug(&quot;*** Error callback is mandatory&quot;)
-                        return promiseShouldReject(`pc.${functionName}(${firstArg}, emptyFunc)`, &quot;'TypeError: Not enough arguments'&quot;);
-                    })
-                    .then(function () {
-                        debug(&quot;*** Callbacks are not nullable&quot;);
-                        return promiseShouldReject(`pc.${functionName}(${firstArg}, emptyFunc, null)`, &quot;detailedErrors.arg3&quot;);
-                    })
-                    .then(function () {
-                        return promiseShouldReject(`pc.${functionName}(${firstArg}, null, emptyFunc)`, &quot;detailedErrors.arg2&quot;);
-                    })
-                    .then(function () {
-                        return promiseShouldReject(`pc.${functionName}(${firstArg}, null, null)`, &quot;detailedErrors.arg2&quot;);
-                    })
-                    .then(function () {
</del><span class="cx">                         debug(`*** Bad input as ${firstArg}`);
</span><span class="cx">                         return promiseShouldReject(`pc.${functionName}('foo')`, &quot;detailedErrors.arg1&quot;);
</span><span class="cx">                     })
</span><span class="lines">@@ -176,21 +161,9 @@
</span><span class="cx">                     .then(function () {
</span><span class="cx">                         return promiseShouldReject(`pc.${functionName}(1, emptyFunc, emptyFunc)`, &quot;detailedErrors.arg1&quot;);
</span><span class="cx">                     })
</span><del>-                    .then(function () {
-                        debug(&quot;*** Bad input for callback arguments&quot;);
-                        return promiseShouldReject(`pc.${functionName}(${firstArg}, {}, emptyFunc)`, &quot;detailedErrors.arg2&quot;);
-                    })
-                    .then(function () {
-                        return promiseShouldReject(`pc.${functionName}(${firstArg}, emptyFunc, {})`, &quot;detailedErrors.arg3&quot;);
-                    })
-                    .then(function () {
-                        resolve();
-                    })
</del><span class="cx">                     .catch(function (error) {
</span><span class="cx">                         testFailed(`Unexpected error in promise chain: ${error}`);
</span><del>-                        resolve();
</del><span class="cx">                     });
</span><del>-                });
</del><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             function testAddIceCandidate() {
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamRTCPeerConnectionstatshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats.html (211403 => 211404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats.html        2017-01-31 03:37:34 UTC (rev 211403)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-stats.html        2017-01-31 04:34:26 UTC (rev 211404)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> 
</span><span class="cx">                 pc.addStream(stream);
</span><span class="cx">                 // FIXME: Test getStats error callback: https://webkit.org/b/129860
</span><del>-                shouldNotThrow('pc.getStats(statsHandler2, statsError)');
</del><ins>+                shouldNotThrow('pc.getStats().then(statsHandler2, statsError)');
</ins><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             function statsHandler2(status)
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">             var startTime = new Date().getTime();
</span><span class="cx">             shouldNotThrow(&quot;pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]})&quot;);
</span><span class="cx">             // FIXME: Test getStats error callback: https://webkit.org/b/129860
</span><del>-            shouldNotThrow('pc.getStats(statsHandler1, statsError)');
</del><ins>+            shouldNotThrow('pc.getStats().then(statsHandler1, statsError)');
</ins><span class="cx"> 
</span><span class="cx">             window.jsTestIsAsync = true;
</span><span class="cx">             window.successfullyParsed = true;
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamRTCPeerConnectionstatsSelectorhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-statsSelector.html (211403 => 211404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-statsSelector.html        2017-01-31 03:37:34 UTC (rev 211403)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-statsSelector.html        2017-01-31 04:34:26 UTC (rev 211404)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx"> 
</span><span class="cx">                 pc.addStream(stream);
</span><span class="cx">                 // FIXME: Test getStats error callback: https://webkit.org/b/129860
</span><del>-                shouldNotThrow('pc.getStats(statsHandler2, statsError, pc.getLocalStreams()[0].getVideoTracks()[0])');
</del><ins>+                shouldNotThrow('pc.getStats(pc.getLocalStreams()[0].getVideoTracks()[0]).then(statsHandler2, statsError)');
</ins><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             function statsHandler2(status)
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (211403 => 211404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-01-31 03:37:34 UTC (rev 211403)
+++ trunk/Source/WebCore/ChangeLog        2017-01-31 04:34:26 UTC (rev 211404)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2017-01-30  Youenn Fablet  &lt;youenn@apple.com&gt;
+
+        [WebRTC] getStats does not support legacy callback
+        https://bugs.webkit.org/show_bug.cgi?id=167617
+
+        Reviewed by Alex Christensen.
+
+        Covered by updated tests.
+
+        * Modules/mediastream/RTCPeerConnection.cpp:
+        (WebCore::RTCPeerConnection::getStats):
+        (WebCore::RTCPeerConnection::privateGetStats): Deleted.
+        * Modules/mediastream/RTCPeerConnection.h:
+        * Modules/mediastream/RTCPeerConnection.idl:
+        * Modules/mediastream/RTCPeerConnection.js:
+        (addIceCandidate):
+        (getStats): Deleted.
+
</ins><span class="cx"> 2017-01-30  Sam Weinig  &lt;sam@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         JSDOMBinding is too big. Split it up!
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (211403 => 211404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp        2017-01-31 03:37:34 UTC (rev 211403)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp        2017-01-31 04:34:26 UTC (rev 211404)
</span><span class="lines">@@ -382,7 +382,7 @@
</span><span class="cx">     return { };
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RTCPeerConnection::privateGetStats(MediaStreamTrack* selector, PeerConnection::StatsPromise&amp;&amp; promise)
</del><ins>+void RTCPeerConnection::getStats(MediaStreamTrack* selector, PeerConnection::StatsPromise&amp;&amp; promise)
</ins><span class="cx"> {
</span><span class="cx">     m_backend-&gt;getStats(selector, WTFMove(promise));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h (211403 => 211404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h        2017-01-31 03:37:34 UTC (rev 211403)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h        2017-01-31 04:34:26 UTC (rev 211404)
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx">     const RTCConfiguration&amp; getConfiguration() const { return m_configuration; }
</span><span class="cx">     ExceptionOr&lt;void&gt; setConfiguration(RTCConfiguration&amp;&amp;);
</span><span class="cx"> 
</span><del>-    void privateGetStats(MediaStreamTrack*, PeerConnection::StatsPromise&amp;&amp;);
</del><ins>+    void getStats(MediaStreamTrack*, PeerConnection::StatsPromise&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     ExceptionOr&lt;Ref&lt;RTCDataChannel&gt;&gt; createDataChannel(ScriptExecutionContext&amp;, String&amp;&amp;, RTCDataChannelInit&amp;&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl (211403 => 211404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl        2017-01-31 03:37:34 UTC (rev 211403)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl        2017-01-31 04:34:26 UTC (rev 211404)
</span><span class="lines">@@ -121,10 +121,7 @@
</span><span class="cx">     RTCConfiguration getConfiguration();
</span><span class="cx">     [MayThrowException] void setConfiguration(RTCConfiguration configuration);
</span><span class="cx"> 
</span><del>-    [JSBuiltin] Promise&lt;RTCStatsReport&gt; getStats(optional MediaStreamTrack? selector = null);
-    // Legacy signature: Promise&lt;void&gt; getStats(MediaStreamTrack? selector
-    //                                    RTCStatsCallback successCallback,
-    //                                    RTCPeerConnectionErrorCallback errorCallback);
</del><ins>+    Promise&lt;RTCStatsReport&gt; getStats(optional MediaStreamTrack? selector = null);
</ins><span class="cx"> 
</span><span class="cx">     // Private API used to implement the overloaded operations above. Queued functions are called by
</span><span class="cx">     // runQueuedOperation() (defined in RTCPeerConnectionInternals.js).
</span><span class="lines">@@ -133,7 +130,6 @@
</span><span class="cx">     [PrivateIdentifier] Promise&lt;void&gt; queuedSetLocalDescription(RTCSessionDescription description);
</span><span class="cx">     [PrivateIdentifier] Promise&lt;void&gt; queuedSetRemoteDescription(RTCSessionDescription description);
</span><span class="cx">     [PrivateIdentifier] Promise&lt;void&gt; queuedAddIceCandidate(RTCIceCandidate candidate);
</span><del>-    [PrivateIdentifier] Promise&lt;RTCStatsReport&gt; privateGetStats(MediaStreamTrack? selector);
</del><span class="cx"> 
</span><span class="cx">     [CallWith=ScriptExecutionContext, MayThrowException] RTCDataChannel createDataChannel([TreatNullAs=EmptyString] DOMString label, optional RTCDataChannelInit options);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectionjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.js (211403 => 211404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.js        2017-01-31 03:37:34 UTC (rev 211403)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.js        2017-01-31 04:34:26 UTC (rev 211404)
</span><span class="lines">@@ -261,29 +261,3 @@
</span><span class="cx">         return @Promise.@resolve(@undefined);
</span><span class="cx">     });
</span><span class="cx"> }
</span><del>-
-function getStats()
-{
-    &quot;use strict&quot;;
-
-    if (!@isRTCPeerConnection(this))
-        return @Promise.@reject(new @TypeError(&quot;Function should be called on an RTCPeerConnection&quot;));
-
-    const peerConnection = this;
-
-    const objectInfo = {
-        &quot;constructor&quot;: @MediaStreamTrack,
-        &quot;argName&quot;: &quot;selector&quot;,
-        &quot;argType&quot;: &quot;MediaStreamTrack&quot;,
-        &quot;defaultsToNull&quot;: true
-    };
-    return @objectAndCallbacksOverload(arguments, &quot;getStats&quot;, objectInfo, function (selector) {
-        // Promise mode
-        return peerConnection.@privateGetStats(selector);
-    }, function (selector, successCallback, errorCallback) {
-        // Legacy callbacks mode
-        peerConnection.@privateGetStats(selector).@then(successCallback, errorCallback);
-
-        return @Promise.@resolve(@undefined);
-    });
-}
</del></span></pre>
</div>
</div>

</body>
</html>