<!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>[165226] 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/165226">165226</a></dd>
<dt>Author</dt> <dd>thiago.lacerda@openbossa.org</dd>
<dt>Date</dt> <dd>2014-03-06 15:41:24 -0800 (Thu, 06 Mar 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>[WebRTC] Updating createOffer and createAnswer methods to match WebRTC editor's draft of 01/27/2014
https://bugs.webkit.org/show_bug.cgi?id=129484
Reviewed by Eric Carlson.
According to the spec, createOffer and createAnswer will no longer have MediaConstraints as an argument,
instead they will have RTCOfferOptions and RTCOfferAnswerOptions, respectively.
Source/WebCore:
Existing tests were updated.
* CMakeLists.txt:
* GNUmakefile.list.am:
* Modules/mediastream/RTCOfferAnswerOptions.cpp: Added.
* Modules/mediastream/RTCOfferAnswerOptions.h: Added.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::createOffer):
(WebCore::RTCPeerConnection::createAnswer):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* platform/mediastream/RTCPeerConnectionHandler.h:
* platform/mock/RTCPeerConnectionHandlerMock.cpp:
(WebCore::RTCPeerConnectionHandlerMock::createOffer):
(WebCore::RTCPeerConnectionHandlerMock::createAnswer):
* platform/mock/RTCPeerConnectionHandlerMock.h:
LayoutTests:
* fast/mediastream/RTCPeerConnection-createAnswer-expected.txt:
* fast/mediastream/RTCPeerConnection-createAnswer.html:
* fast/mediastream/RTCPeerConnection-createOffer-expected.txt:
* fast/mediastream/RTCPeerConnection-createOffer.html:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamRTCPeerConnectioncreateAnswerexpectedtxt">trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamRTCPeerConnectioncreateAnswerhtml">trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer.html</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamRTCPeerConnectioncreateOfferexpectedtxt">trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamRTCPeerConnectioncreateOfferhtml">trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer.html</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</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="#trunkSourceWebCoreplatformmediastreamRTCPeerConnectionHandlerh">trunk/Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmockRTCPeerConnectionHandlerMockcpp">trunk/Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmockRTCPeerConnectionHandlerMockh">trunk/Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCOfferAnswerOptionscpp">trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCOfferAnswerOptionsh">trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (165225 => 165226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-03-06 23:40:48 UTC (rev 165225)
+++ trunk/LayoutTests/ChangeLog        2014-03-06 23:41:24 UTC (rev 165226)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2014-03-06 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org>
+
+ [WebRTC] Updating createOffer and createAnswer methods to match WebRTC editor's draft of 01/27/2014
+ https://bugs.webkit.org/show_bug.cgi?id=129484
+
+ Reviewed by Eric Carlson.
+
+ According to the spec, createOffer and createAnswer will no longer have MediaConstraints as an argument,
+ instead they will have RTCOfferOptions and RTCOfferAnswerOptions, respectively.
+
+ * fast/mediastream/RTCPeerConnection-createAnswer-expected.txt:
+ * fast/mediastream/RTCPeerConnection-createAnswer.html:
+ * fast/mediastream/RTCPeerConnection-createOffer-expected.txt:
+ * fast/mediastream/RTCPeerConnection-createOffer.html:
+
</ins><span class="cx"> 2014-03-05 Oliver Hunt <oliver@apple.com>
</span><span class="cx">
</span><span class="cx"> Support caching of custom setters
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamRTCPeerConnectioncreateAnswerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer-expected.txt (165225 => 165226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer-expected.txt        2014-03-06 23:40:48 UTC (rev 165225)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer-expected.txt        2014-03-06 23:41:24 UTC (rev 165226)
</span><span class="lines">@@ -7,15 +7,10 @@
</span><span class="cx"> PASS createAnswer request succeeded.
</span><span class="cx"> PASS pc.setRemoteDescription(sessionDescription, setDescriptionSucceeded, setDescriptionFailed); did not throw exception.
</span><span class="cx"> PASS setRemoteDescription succeeded.
</span><del>-PASS pc.createAnswer(requestSucceeded2, requestFailed2, {mandatory:{"succeed":false}}); did not throw exception.
</del><ins>+PASS pc.createAnswer(requestSucceeded2, requestFailed2, {}); threw exception Error: TypeMismatchError: DOM Exception 17.
</ins><span class="cx"> PASS createAnswer request failed.
</span><del>-PASS errorReason.name is "IncompatibleConstraintsError"
-PASS pc.createAnswer(requestSucceeded3, requestFailed3); did not throw exception.
-PASS createAnswer request succeeded.
-PASS sessionDescription.type is "answer"
-PASS pc.createAnswer(requestSucceeded4, requestFailed3, {mandatory:{"succeed":true}}); did not throw exception.
-PASS createAnswer request succeeded.
-PASS sessionDescription.type is "answer"
</del><ins>+PASS errorReason.name is "Invalid createAnswer argument."
+PASS pc.createAnswer(requestSucceeded3, requestFailed1, {requestIdentity:"ifconfigured"}); did not throw exception.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamRTCPeerConnectioncreateAnswerhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer.html (165225 => 165226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer.html        2014-03-06 23:40:48 UTC (rev 165225)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer.html        2014-03-06 23:41:24 UTC (rev 165226)
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx">
</span><span class="cx"> var pc = null;
</span><span class="cx">
</span><del>- function requestSucceeded4(sd)
</del><ins>+ function requestSucceeded5(sd)
</ins><span class="cx"> {
</span><span class="cx"> testPassed('createAnswer request succeeded.');
</span><span class="cx">
</span><span class="lines">@@ -19,21 +19,25 @@
</span><span class="cx"> finishJSTest();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function requestFailed3(reason)
</del><ins>+ function requestSucceeded4(sd)
</ins><span class="cx"> {
</span><del>- testFailed('createAnswer request failed.');
</del><ins>+ testPassed('createAnswer request succeeded.');
</ins><span class="cx">
</span><del>- finishJSTest();
</del><ins>+ sessionDescription = sd;
+ shouldBe('sessionDescription.type', '"answer"');
+
+ shouldNotThrow('pc.createAnswer(requestSucceeded5, requestFailed1, {requestIdentity:"no"});');
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function requestSucceeded3(sd)
</span><span class="cx"> {
</span><ins>+ finishJSTest();
</ins><span class="cx"> testPassed('createAnswer request succeeded.');
</span><span class="cx">
</span><span class="cx"> sessionDescription = sd;
</span><span class="cx"> shouldBe('sessionDescription.type', '"answer"');
</span><span class="cx">
</span><del>- shouldNotThrow('pc.createAnswer(requestSucceeded4, requestFailed3, {mandatory:{"succeed":true}});');
</del><ins>+ shouldNotThrow('pc.createAnswer(requestSucceeded4, requestFailed1, {requestIdentity:"yes"});');
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function requestFailed2(reason)
</span><span class="lines">@@ -41,9 +45,8 @@
</span><span class="cx"> testPassed('createAnswer request failed.');
</span><span class="cx">
</span><span class="cx"> errorReason = reason;
</span><del>- shouldBe('errorReason.name', '"IncompatibleConstraintsError"');
-
- shouldNotThrow('pc.createAnswer(requestSucceeded3, requestFailed3);');
</del><ins>+ shouldBe('errorReason.name', '"Invalid createAnswer argument."');
+ shouldNotThrow('pc.createAnswer(requestSucceeded3, requestFailed1, {requestIdentity:"ifconfigured"});');
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function requestSucceeded2()
</span><span class="lines">@@ -78,7 +81,7 @@
</span><span class="cx"> function setDescriptionSucceeded()
</span><span class="cx"> {
</span><span class="cx"> testPassed('setRemoteDescription succeeded.');
</span><del>- shouldNotThrow('pc.createAnswer(requestSucceeded2, requestFailed2, {mandatory:{"succeed":false}});');
</del><ins>+ shouldThrow('pc.createAnswer(requestSucceeded2, requestFailed2, {});');
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamRTCPeerConnectioncreateOfferexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer-expected.txt (165225 => 165226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer-expected.txt        2014-03-06 23:40:48 UTC (rev 165225)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer-expected.txt        2014-03-06 23:41:24 UTC (rev 165226)
</span><span class="lines">@@ -3,13 +3,28 @@
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><span class="cx">
</span><del>-PASS pc.createOffer(requestSucceeded1, requestFailed1, {mandatory:{"succeed":true}}); did not throw exception.
</del><ins>+PASS pc.createOffer(requestSucceeded1, requestFailed1); did not throw exception.
</ins><span class="cx"> PASS createOffer request succeeded.
</span><span class="cx"> PASS sessionDescription.type is "offer"
</span><del>-PASS pc.createOffer(requestSucceeded2, requestFailed2, {mandatory:{"succeed":false}}); did not throw exception.
</del><ins>+PASS pc.createOffer(requestSucceeded2, requestFailed2, {}); threw exception Error: TypeMismatchError: DOM Exception 17.
</ins><span class="cx"> PASS createOffer request failed.
</span><del>-PASS errorReason.name is "IncompatibleConstraintsError"
-PASS pc.createOffer(requestSucceeded3, requestFailed1); did not throw exception.
</del><ins>+PASS errorReason.name is "Invalid createOffer argument."
+PASS pc.createOffer(requestSucceeded2, requestFailed3, {requestIdentity:"yes", offerToReceiveAudio:0}); threw exception Error: TypeMismatchError: DOM Exception 17.
+PASS createOffer request failed.
+PASS errorReason.name is "Invalid createOffer argument."
+PASS pc.createOffer(requestSucceeded2, requestFailed4, {requestIdentity:"yes", offerToReceiveVideo:0}); threw exception Error: TypeMismatchError: DOM Exception 17.
+PASS createOffer request failed.
+PASS errorReason.name is "Invalid createOffer argument."
+PASS pc.createOffer(requestSucceeded2, requestFailed5, {offerToReceiveVideo:0, offerToReceiveAudio:0}); threw exception Error: TypeMismatchError: DOM Exception 17.
+PASS createOffer request failed.
+PASS errorReason.name is "Invalid createOffer argument."
+PASS pc.createOffer(requestSucceeded2, requestFailed6, {requestIdentity:"yes", offerToReceiveVideo:"", offerToReceiveAudio:0}); threw exception Error: TypeMismatchError: DOM Exception 17.
+PASS createOffer request failed.
+PASS errorReason.name is "Invalid createOffer argument."
+PASS pc.createOffer(requestSucceeded2, requestFailed7, {requestIdentity:"yes", offerToReceiveVideo:0, offerToReceiveAudio:""}); threw exception Error: TypeMismatchError: DOM Exception 17.
+PASS createOffer request failed.
+PASS errorReason.name is "Invalid createOffer argument."
+PASS pc.createOffer(requestSucceeded3, requestFailed1, {requestIdentity:"yes", offerToReceiveVideo:0, offerToReceiveAudio:0}); did not throw exception.
</ins><span class="cx"> PASS createOffer request succeeded.
</span><span class="cx"> PASS sessionDescription.type is "offer"
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamRTCPeerConnectioncreateOfferhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer.html (165225 => 165226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer.html        2014-03-06 23:40:48 UTC (rev 165225)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer.html        2014-03-06 23:41:24 UTC (rev 165226)
</span><span class="lines">@@ -18,14 +18,64 @@
</span><span class="cx"> finishJSTest();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ function requestFailed7(reason)
+ {
+ testPassed('createOffer request failed.');
+
+ errorReason = reason;
+ shouldBe('errorReason.name', '"Invalid createOffer argument."');
+
+ shouldNotThrow('pc.createOffer(requestSucceeded3, requestFailed1, {requestIdentity:"yes", offerToReceiveVideo:0, offerToReceiveAudio:0});');
+ }
+
+ function requestFailed6(reason)
+ {
+ testPassed('createOffer request failed.');
+
+ errorReason = reason;
+ shouldBe('errorReason.name', '"Invalid createOffer argument."');
+
+ shouldThrow('pc.createOffer(requestSucceeded2, requestFailed7, {requestIdentity:"yes", offerToReceiveVideo:0, offerToReceiveAudio:""});');
+ }
+
+ function requestFailed5(reason)
+ {
+ testPassed('createOffer request failed.');
+
+ errorReason = reason;
+ shouldBe('errorReason.name', '"Invalid createOffer argument."');
+
+ shouldThrow('pc.createOffer(requestSucceeded2, requestFailed6, {requestIdentity:"yes", offerToReceiveVideo:"", offerToReceiveAudio:0});');
+ }
+
+ function requestFailed4(reason)
+ {
+ testPassed('createOffer request failed.');
+
+ errorReason = reason;
+ shouldBe('errorReason.name', '"Invalid createOffer argument."');
+
+ shouldThrow('pc.createOffer(requestSucceeded2, requestFailed5, {offerToReceiveVideo:0, offerToReceiveAudio:0});');
+ }
+
+ function requestFailed3(reason)
+ {
+ testPassed('createOffer request failed.');
+
+ errorReason = reason;
+ shouldBe('errorReason.name', '"Invalid createOffer argument."');
+
+ shouldThrow('pc.createOffer(requestSucceeded2, requestFailed4, {requestIdentity:"yes", offerToReceiveVideo:0});');
+ }
+
</ins><span class="cx"> function requestFailed2(reason)
</span><span class="cx"> {
</span><span class="cx"> testPassed('createOffer request failed.');
</span><span class="cx">
</span><span class="cx"> errorReason = reason;
</span><del>- shouldBe('errorReason.name', '"IncompatibleConstraintsError"');
</del><ins>+ shouldBe('errorReason.name', '"Invalid createOffer argument."');
</ins><span class="cx">
</span><del>- shouldNotThrow('pc.createOffer(requestSucceeded3, requestFailed1);');
</del><ins>+ shouldThrow('pc.createOffer(requestSucceeded2, requestFailed3, {requestIdentity:"yes", offerToReceiveAudio:0});');
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function requestSucceeded2(sd)
</span><span class="lines">@@ -47,11 +97,11 @@
</span><span class="cx"> sessionDescription = sd;
</span><span class="cx"> shouldBe('sessionDescription.type', '"offer"');
</span><span class="cx">
</span><del>- shouldNotThrow('pc.createOffer(requestSucceeded2, requestFailed2, {mandatory:{"succeed":false}});');
</del><ins>+ shouldThrow('pc.createOffer(requestSucceeded2, requestFailed2, {});');
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> pc = new webkitRTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
</span><del>- shouldNotThrow('pc.createOffer(requestSucceeded1, requestFailed1, {mandatory:{"succeed":true}});');
</del><ins>+ shouldNotThrow('pc.createOffer(requestSucceeded1, requestFailed1);');
</ins><span class="cx">
</span><span class="cx"> window.jsTestIsAsync = true;
</span><span class="cx"> window.successfullyParsed = true;
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (165225 => 165226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-03-06 23:40:48 UTC (rev 165225)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-03-06 23:41:24 UTC (rev 165226)
</span><span class="lines">@@ -860,6 +860,7 @@
</span><span class="cx"> Modules/mediastream/RTCDataChannelEvent.cpp
</span><span class="cx"> Modules/mediastream/RTCIceCandidate.cpp
</span><span class="cx"> Modules/mediastream/RTCIceCandidateEvent.cpp
</span><ins>+ Modules/mediastream/RTCOfferAnswerOptions.cpp
</ins><span class="cx"> Modules/mediastream/RTCPeerConnection.cpp
</span><span class="cx"> Modules/mediastream/RTCSessionDescription.cpp
</span><span class="cx"> Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (165225 => 165226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-06 23:40:48 UTC (rev 165225)
+++ trunk/Source/WebCore/ChangeLog        2014-03-06 23:41:24 UTC (rev 165226)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2014-03-06 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org>
+
+ [WebRTC] Updating createOffer and createAnswer methods to match WebRTC editor's draft of 01/27/2014
+ https://bugs.webkit.org/show_bug.cgi?id=129484
+
+ Reviewed by Eric Carlson.
+
+ According to the spec, createOffer and createAnswer will no longer have MediaConstraints as an argument,
+ instead they will have RTCOfferOptions and RTCOfferAnswerOptions, respectively.
+
+ Existing tests were updated.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Modules/mediastream/RTCOfferAnswerOptions.cpp: Added.
+ * Modules/mediastream/RTCOfferAnswerOptions.h: Added.
+ * Modules/mediastream/RTCPeerConnection.cpp:
+ (WebCore::RTCPeerConnection::createOffer):
+ (WebCore::RTCPeerConnection::createAnswer):
+ * Modules/mediastream/RTCPeerConnection.h:
+ * Modules/mediastream/RTCPeerConnection.idl:
+ * platform/mediastream/RTCPeerConnectionHandler.h:
+ * platform/mock/RTCPeerConnectionHandlerMock.cpp:
+ (WebCore::RTCPeerConnectionHandlerMock::createOffer):
+ (WebCore::RTCPeerConnectionHandlerMock::createAnswer):
+ * platform/mock/RTCPeerConnectionHandlerMock.h:
+
</ins><span class="cx"> 2014-03-06 Brian Burg <bburg@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Replay: premature release() of PassRefPtr in InspectorReplayAgent
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (165225 => 165226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2014-03-06 23:40:48 UTC (rev 165225)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2014-03-06 23:41:24 UTC (rev 165226)
</span><span class="lines">@@ -1945,6 +1945,8 @@
</span><span class="cx">         Source/WebCore/Modules/mediastream/RTCIceCandidate.h \
</span><span class="cx">         Source/WebCore/Modules/mediastream/RTCIceCandidateEvent.cpp \
</span><span class="cx">         Source/WebCore/Modules/mediastream/RTCIceCandidateEvent.h \
</span><ins>+        Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.cpp \
+        Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.h \
</ins><span class="cx">         Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp \
</span><span class="cx">         Source/WebCore/Modules/mediastream/RTCPeerConnection.h \
</span><span class="cx">         Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp \
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCOfferAnswerOptionscpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.cpp (0 => 165226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.cpp         (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.cpp        2014-03-06 23:41:24 UTC (rev 165226)
</span><span class="lines">@@ -0,0 +1,117 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple 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 COMPUTER, INC. ``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 COMPUTER, INC. OR
+ * 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.
+ */
+
+#include "config.h"
+
+#if ENABLE(MEDIA_STREAM)
+#include "RTCOfferAnswerOptions.h"
+
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+static bool validateRequestIdentity(const String& value)
+{
+ return value == "yes" || value == "no" || value == "ifconfigured";
+}
+
+PassRefPtr<RTCOfferAnswerOptions> RTCOfferAnswerOptions::create(const Dictionary& options, ExceptionCode& ec)
+{
+ RefPtr<RTCOfferAnswerOptions> offerAnswerOptions = adoptRef(new RTCOfferAnswerOptions());
+ String requestIdentity;
+ if (!offerAnswerOptions->initialize(options)) {
+ // FIXME: https://webkit.org/b/129800
+ // According to the spec, the error is going to be defined yet, so let's use TYPE_MISMATCH_ERR for now.
+ ec = TYPE_MISMATCH_ERR;
+ return nullptr;
+ }
+
+ return offerAnswerOptions.release();
+}
+
+bool RTCOfferAnswerOptions::initialize(const Dictionary& options)
+{
+ String requestIdentity;
+ if (!options.isUndefinedOrNull() && (!options.get("requestIdentity", requestIdentity) || requestIdentity.isEmpty()))
+ return false;
+
+ if (validateRequestIdentity(requestIdentity))
+ m_requestIdentity = requestIdentity;
+
+ return true;
+}
+
+PassRefPtr<RTCOfferOptions> RTCOfferOptions::create(const Dictionary& options, ExceptionCode& ec)
+{
+ RefPtr<RTCOfferOptions> offerOptions = adoptRef(new RTCOfferOptions());
+ if (!offerOptions->initialize(options)) {
+ // FIXME: https://webkit.org/b/129800
+ // According to the spec, the error is going to be defined yet, so let's use TYPE_MISMATCH_ERR for now.
+ ec = TYPE_MISMATCH_ERR;
+ return nullptr;
+ }
+
+ return offerOptions.release();
+}
+
+bool RTCOfferOptions::initialize(const Dictionary& options)
+{
+ if (options.isUndefinedOrNull())
+ return true;
+
+ if (!RTCOfferAnswerOptions::initialize(options))
+ return false;
+
+ String offerToReceiveVideoStr;
+ bool numberConversionSuccess;
+ if (!options.get("offerToReceiveVideo", offerToReceiveVideoStr))
+ return false;
+
+ m_offerToReceiveVideo = offerToReceiveVideoStr.toInt64Strict(&numberConversionSuccess);
+ if (!numberConversionSuccess)
+ return false;
+
+ String offerToReceiveAudioStr;
+ if (!options.get("offerToReceiveAudio", offerToReceiveAudioStr))
+ return false;
+
+ m_offerToReceiveAudio = offerToReceiveAudioStr.toInt64Strict(&numberConversionSuccess);
+ if (!numberConversionSuccess)
+ return false;
+
+ bool voiceActivityDetection;
+ if (options.get("voiceActivityDetection", voiceActivityDetection))
+ m_voiceActivityDetection = voiceActivityDetection;
+
+ bool iceRestart;
+ if (options.get("iceRestart", iceRestart))
+ m_iceRestart = iceRestart;
+
+ return true;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCOfferAnswerOptionsh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.h (0 => 165226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.h         (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.h        2014-03-06 23:41:24 UTC (rev 165226)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple 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 COMPUTER, INC. ``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 COMPUTER, INC. OR
+ * 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 RTCOfferAnswerOptions_h
+#define RTCOfferAnswerOptions_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "Dictionary.h"
+#include "ExceptionCode.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class Dictionary;
+
+class RTCOfferAnswerOptions : public RefCounted<RTCOfferAnswerOptions> {
+public:
+ static PassRefPtr<RTCOfferAnswerOptions> create(const Dictionary&, ExceptionCode&);
+
+ const String& requestIdentity() const { return m_requestIdentity; }
+
+ virtual ~RTCOfferAnswerOptions() { }
+
+protected:
+ virtual bool initialize(const Dictionary&);
+ RTCOfferAnswerOptions()
+ : m_requestIdentity("ifconfigured")
+ {
+ }
+
+private:
+ String m_requestIdentity;
+};
+
+class RTCOfferOptions : public RTCOfferAnswerOptions {
+public:
+ static PassRefPtr<RTCOfferOptions> create(const Dictionary&, ExceptionCode&);
+
+ int64_t offerToReceiveVideo() const { return m_offerToReceiveVideo; }
+ int64_t offerToReceiveAudio() const { return m_offerToReceiveAudio; }
+ bool voiceActivityDetection() const { return m_voiceActivityDetection; }
+ bool iceRestart() const { return m_iceRestart; }
+
+ virtual ~RTCOfferOptions() { }
+
+private:
+ virtual bool initialize(const Dictionary&) override;
+ RTCOfferOptions()
+ : m_offerToReceiveVideo(0)
+ , m_offerToReceiveAudio(0)
+ , m_voiceActivityDetection(true)
+ , m_iceRestart(false)
+ {
+ }
+
+ int64_t m_offerToReceiveVideo;
+ int64_t m_offerToReceiveAudio;
+ bool m_voiceActivityDetection;
+ bool m_iceRestart;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // RTCOfferAnswerOptions_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (165225 => 165226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp        2014-03-06 23:40:48 UTC (rev 165225)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp        2014-03-06 23:41:24 UTC (rev 165226)
</span><span class="lines">@@ -42,7 +42,6 @@
</span><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "FrameLoader.h"
</span><span class="cx"> #include "FrameLoaderClient.h"
</span><del>-#include "MediaConstraintsImpl.h"
</del><span class="cx"> #include "MediaStreamEvent.h"
</span><span class="cx"> #include "RTCConfiguration.h"
</span><span class="cx"> #include "RTCDTMFSender.h"
</span><span class="lines">@@ -52,6 +51,7 @@
</span><span class="cx"> #include "RTCIceCandidate.h"
</span><span class="cx"> #include "RTCIceCandidateDescriptor.h"
</span><span class="cx"> #include "RTCIceCandidateEvent.h"
</span><ins>+#include "RTCOfferAnswerOptions.h"
</ins><span class="cx"> #include "RTCPeerConnectionErrorCallback.h"
</span><span class="cx"> #include "RTCSessionDescription.h"
</span><span class="cx"> #include "RTCSessionDescriptionCallback.h"
</span><span class="lines">@@ -203,7 +203,7 @@
</span><span class="cx"> (*stream)->removeObserver(this);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void RTCPeerConnection::createOffer(PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback, const Dictionary& mediaConstraints, ExceptionCode& ec)
</del><ins>+void RTCPeerConnection::createOffer(PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback, const Dictionary& offerOptions, ExceptionCode& ec)
</ins><span class="cx"> {
</span><span class="cx"> if (m_signalingState == SignalingStateClosed) {
</span><span class="cx"> ec = INVALID_STATE_ERR;
</span><span class="lines">@@ -215,15 +215,20 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RefPtr<MediaConstraints> constraints = MediaConstraintsImpl::create(mediaConstraints, ec);
- if (ec)
</del><ins>+ RefPtr<RTCOfferOptions> options = RTCOfferOptions::create(offerOptions, ec);
+ if (ec) {
+ callOnMainThread([=] {
+ RefPtr<DOMError> error = DOMError::create("Invalid createOffer argument.");
+ errorCallback->handleEvent(error.get());
+ });
</ins><span class="cx"> return;
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> RefPtr<RTCSessionDescriptionRequestImpl> request = RTCSessionDescriptionRequestImpl::create(scriptExecutionContext(), successCallback, errorCallback);
</span><del>- m_peerHandler->createOffer(request.release(), constraints);
</del><ins>+ m_peerHandler->createOffer(request.release(), options.release());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void RTCPeerConnection::createAnswer(PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback, const Dictionary& mediaConstraints, ExceptionCode& ec)
</del><ins>+void RTCPeerConnection::createAnswer(PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback, const Dictionary& answerOptions, ExceptionCode& ec)
</ins><span class="cx"> {
</span><span class="cx"> if (m_signalingState == SignalingStateClosed) {
</span><span class="cx"> ec = INVALID_STATE_ERR;
</span><span class="lines">@@ -235,12 +240,17 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RefPtr<MediaConstraints> constraints = MediaConstraintsImpl::create(mediaConstraints, ec);
- if (ec)
</del><ins>+ RefPtr<RTCOfferAnswerOptions> options = RTCOfferAnswerOptions::create(answerOptions, ec);
+ if (ec) {
+ callOnMainThread([=] {
+ RefPtr<DOMError> error = DOMError::create("Invalid createAnswer argument.");
+ errorCallback->handleEvent(error.get());
+ });
</ins><span class="cx"> return;
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> RefPtr<RTCSessionDescriptionRequestImpl> request = RTCSessionDescriptionRequestImpl::create(scriptExecutionContext(), successCallback, errorCallback);
</span><del>- m_peerHandler->createAnswer(request.release(), constraints.release());
</del><ins>+ m_peerHandler->createAnswer(request.release(), options.release());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool RTCPeerConnection::checkStateForLocalDescription(RTCSessionDescription* localDescription)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h (165225 => 165226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h        2014-03-06 23:40:48 UTC (rev 165225)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h        2014-03-06 23:41:24 UTC (rev 165226)
</span><span class="lines">@@ -48,7 +48,6 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class MediaConstraints;
</del><span class="cx"> class MediaStreamTrack;
</span><span class="cx"> class RTCConfiguration;
</span><span class="cx"> class RTCDTMFSender;
</span><span class="lines">@@ -64,9 +63,9 @@
</span><span class="cx"> static PassRefPtr<RTCPeerConnection> create(ScriptExecutionContext&, const Dictionary& rtcConfiguration, ExceptionCode&);
</span><span class="cx"> ~RTCPeerConnection();
</span><span class="cx">
</span><del>- void createOffer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>, const Dictionary& mediaConstraints, ExceptionCode&);
</del><ins>+ void createOffer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>, const Dictionary& offerOptions, ExceptionCode&);
</ins><span class="cx">
</span><del>- void createAnswer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>, const Dictionary& mediaConstraints, ExceptionCode&);
</del><ins>+ void createAnswer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>, const Dictionary& answerOptions, ExceptionCode&);
</ins><span class="cx">
</span><span class="cx"> void setLocalDescription(PassRefPtr<RTCSessionDescription>, PassRefPtr<VoidCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>, ExceptionCode&);
</span><span class="cx"> PassRefPtr<RTCSessionDescription> localDescription(ExceptionCode&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl (165225 => 165226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl        2014-03-06 23:40:48 UTC (rev 165225)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl        2014-03-06 23:41:24 UTC (rev 165226)
</span><span class="lines">@@ -39,9 +39,9 @@
</span><span class="cx"> EventTarget,
</span><span class="cx"> InterfaceName=webkitRTCPeerConnection,
</span><span class="cx"> ] interface RTCPeerConnection {
</span><del>- [RaisesException] void createOffer(RTCSessionDescriptionCallback successCallback, [Default=Undefined] optional RTCPeerConnectionErrorCallback failureCallback, optional Dictionary mediaConstraints);
</del><ins>+ [RaisesException] void createOffer(RTCSessionDescriptionCallback successCallback, [Default=Undefined] optional RTCPeerConnectionErrorCallback failureCallback, optional Dictionary offerOptions);
</ins><span class="cx">
</span><del>- [RaisesException] void createAnswer(RTCSessionDescriptionCallback successCallback, [Default=Undefined] optional RTCPeerConnectionErrorCallback failureCallback, optional Dictionary mediaConstraints);
</del><ins>+ [RaisesException] void createAnswer(RTCSessionDescriptionCallback successCallback, [Default=Undefined] optional RTCPeerConnectionErrorCallback failureCallback, optional Dictionary answerOptions);
</ins><span class="cx">
</span><span class="cx"> [RaisesException] void setLocalDescription(RTCSessionDescription description, [Default=Undefined] optional VoidCallback successCallback, [Default=Undefined] optional RTCPeerConnectionErrorCallback failureCallback);
</span><span class="cx"> [GetterRaisesException] readonly attribute RTCSessionDescription localDescription;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamRTCPeerConnectionHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.h (165225 => 165226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.h        2014-03-06 23:40:48 UTC (rev 165225)
+++ trunk/Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.h        2014-03-06 23:41:24 UTC (rev 165226)
</span><span class="lines">@@ -39,12 +39,13 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class MediaConstraints;
</del><span class="cx"> class MediaStreamSource;
</span><span class="cx"> class RTCConfiguration;
</span><span class="cx"> class RTCDTMFSenderHandler;
</span><span class="cx"> class RTCDataChannelHandler;
</span><span class="cx"> class RTCIceCandidateDescriptor;
</span><ins>+class RTCOfferOptions;
+class RTCOfferAnswerOptions;
</ins><span class="cx"> class RTCPeerConnectionHandler;
</span><span class="cx"> class RTCPeerConnectionHandlerClient;
</span><span class="cx"> class RTCSessionDescriptionDescriptor;
</span><span class="lines">@@ -82,8 +83,8 @@
</span><span class="cx">
</span><span class="cx"> virtual bool initialize(PassRefPtr<RTCConfiguration>) = 0;
</span><span class="cx">
</span><del>- virtual void createOffer(PassRefPtr<RTCSessionDescriptionRequest>, PassRefPtr<MediaConstraints>) = 0;
- virtual void createAnswer(PassRefPtr<RTCSessionDescriptionRequest>, PassRefPtr<MediaConstraints>) = 0;
</del><ins>+ virtual void createOffer(PassRefPtr<RTCSessionDescriptionRequest>, PassRefPtr<RTCOfferOptions>) = 0;
+ virtual void createAnswer(PassRefPtr<RTCSessionDescriptionRequest>, PassRefPtr<RTCOfferAnswerOptions>) = 0;
</ins><span class="cx"> virtual void setLocalDescription(PassRefPtr<RTCVoidRequest>, PassRefPtr<RTCSessionDescriptionDescriptor>) = 0;
</span><span class="cx"> virtual void setRemoteDescription(PassRefPtr<RTCVoidRequest>, PassRefPtr<RTCSessionDescriptionDescriptor>) = 0;
</span><span class="cx"> virtual PassRefPtr<RTCSessionDescriptionDescriptor> localDescription() = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockRTCPeerConnectionHandlerMockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.cpp (165225 => 165226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.cpp        2014-03-06 23:40:48 UTC (rev 165225)
+++ trunk/Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.cpp        2014-03-06 23:41:24 UTC (rev 165226)
</span><span class="lines">@@ -58,28 +58,15 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void RTCPeerConnectionHandlerMock::createOffer(PassRefPtr<RTCSessionDescriptionRequest> request, PassRefPtr<MediaConstraints> constraints)
</del><ins>+void RTCPeerConnectionHandlerMock::createOffer(PassRefPtr<RTCSessionDescriptionRequest> request, PassRefPtr<RTCOfferOptions>)
</ins><span class="cx"> {
</span><del>- String succeedValue;
- RefPtr<SessionRequestNotifier> notifier;
- if (constraints->getMandatoryConstraintValue("succeed", succeedValue) && succeedValue == "false")
- notifier = adoptRef(new SessionRequestNotifier(request, 0, RTCPeerConnectionHandler::incompatibleConstraintsErrorName()));
- else
- notifier = adoptRef(new SessionRequestNotifier(request, RTCSessionDescriptionDescriptor::create("offer", "local")));
-
</del><ins>+ RefPtr<SessionRequestNotifier> notifier = adoptRef(new SessionRequestNotifier(request, RTCSessionDescriptionDescriptor::create("offer", "local")));
</ins><span class="cx"> m_timerEvents.append(adoptRef(new TimerEvent(this, notifier)));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void RTCPeerConnectionHandlerMock::createAnswer(PassRefPtr<RTCSessionDescriptionRequest> request, PassRefPtr<MediaConstraints> constraints)
</del><ins>+void RTCPeerConnectionHandlerMock::createAnswer(PassRefPtr<RTCSessionDescriptionRequest> request, PassRefPtr<RTCOfferAnswerOptions>)
</ins><span class="cx"> {
</span><del>- RefPtr<SessionRequestNotifier> notifier;
- // We can only create an answer if we have already had an offer and the remote session description is stored.
- String succeedValue;
- if (constraints->getMandatoryConstraintValue("succeed", succeedValue) && succeedValue == "false")
- notifier = adoptRef(new SessionRequestNotifier(request, 0, RTCPeerConnectionHandler::incompatibleConstraintsErrorName()));
- else
- notifier = adoptRef(new SessionRequestNotifier(request, RTCSessionDescriptionDescriptor::create("answer", "local")));
-
</del><ins>+ RefPtr<SessionRequestNotifier> notifier = adoptRef(new SessionRequestNotifier(request, RTCSessionDescriptionDescriptor::create("answer", "local")));
</ins><span class="cx"> m_timerEvents.append(adoptRef(new TimerEvent(this, notifier)));
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockRTCPeerConnectionHandlerMockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.h (165225 => 165226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.h        2014-03-06 23:40:48 UTC (rev 165225)
+++ trunk/Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.h        2014-03-06 23:41:24 UTC (rev 165226)
</span><span class="lines">@@ -43,8 +43,8 @@
</span><span class="cx">
</span><span class="cx"> virtual bool initialize(PassRefPtr<RTCConfiguration>) override;
</span><span class="cx">
</span><del>- virtual void createOffer(PassRefPtr<RTCSessionDescriptionRequest>, PassRefPtr<MediaConstraints>) override;
- virtual void createAnswer(PassRefPtr<RTCSessionDescriptionRequest>, PassRefPtr<MediaConstraints>) override;
</del><ins>+ virtual void createOffer(PassRefPtr<RTCSessionDescriptionRequest>, PassRefPtr<RTCOfferOptions>) override;
+ virtual void createAnswer(PassRefPtr<RTCSessionDescriptionRequest>, PassRefPtr<RTCOfferAnswerOptions>) override;
</ins><span class="cx"> virtual void setLocalDescription(PassRefPtr<RTCVoidRequest>, PassRefPtr<RTCSessionDescriptionDescriptor>) override;
</span><span class="cx"> virtual void setRemoteDescription(PassRefPtr<RTCVoidRequest>, PassRefPtr<RTCSessionDescriptionDescriptor>) override;
</span><span class="cx"> virtual PassRefPtr<RTCSessionDescriptionDescriptor> localDescription() override;
</span></span></pre>
</div>
</div>
</body>
</html>