<!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  &lt;thiago.lacerda@openbossa.org&gt;
+
+        [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  &lt;oliver@apple.com&gt;
</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:{&quot;succeed&quot;: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 &quot;IncompatibleConstraintsError&quot;
-PASS pc.createAnswer(requestSucceeded3, requestFailed3); did not throw exception.
-PASS createAnswer request succeeded.
-PASS sessionDescription.type is &quot;answer&quot;
-PASS pc.createAnswer(requestSucceeded4, requestFailed3, {mandatory:{&quot;succeed&quot;:true}}); did not throw exception.
-PASS createAnswer request succeeded.
-PASS sessionDescription.type is &quot;answer&quot;
</del><ins>+PASS errorReason.name is &quot;Invalid createAnswer argument.&quot;
+PASS pc.createAnswer(requestSucceeded3, requestFailed1, {requestIdentity:&quot;ifconfigured&quot;}); 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', '&quot;answer&quot;');
+
+                shouldNotThrow('pc.createAnswer(requestSucceeded5, requestFailed1, {requestIdentity:&quot;no&quot;});');
</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', '&quot;answer&quot;');
</span><span class="cx"> 
</span><del>-                shouldNotThrow('pc.createAnswer(requestSucceeded4, requestFailed3, {mandatory:{&quot;succeed&quot;:true}});');
</del><ins>+                shouldNotThrow('pc.createAnswer(requestSucceeded4, requestFailed1, {requestIdentity:&quot;yes&quot;});');
</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', '&quot;IncompatibleConstraintsError&quot;');
-
-                shouldNotThrow('pc.createAnswer(requestSucceeded3, requestFailed3);');
</del><ins>+                shouldBe('errorReason.name', '&quot;Invalid createAnswer argument.&quot;');
+                shouldNotThrow('pc.createAnswer(requestSucceeded3, requestFailed1, {requestIdentity:&quot;ifconfigured&quot;});');
</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:{&quot;succeed&quot;: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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS pc.createOffer(requestSucceeded1, requestFailed1, {mandatory:{&quot;succeed&quot;: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 &quot;offer&quot;
</span><del>-PASS pc.createOffer(requestSucceeded2, requestFailed2, {mandatory:{&quot;succeed&quot;: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 &quot;IncompatibleConstraintsError&quot;
-PASS pc.createOffer(requestSucceeded3, requestFailed1); did not throw exception.
</del><ins>+PASS errorReason.name is &quot;Invalid createOffer argument.&quot;
+PASS pc.createOffer(requestSucceeded2, requestFailed3, {requestIdentity:&quot;yes&quot;, offerToReceiveAudio:0}); threw exception Error: TypeMismatchError: DOM Exception 17.
+PASS createOffer request failed.
+PASS errorReason.name is &quot;Invalid createOffer argument.&quot;
+PASS pc.createOffer(requestSucceeded2, requestFailed4, {requestIdentity:&quot;yes&quot;, offerToReceiveVideo:0}); threw exception Error: TypeMismatchError: DOM Exception 17.
+PASS createOffer request failed.
+PASS errorReason.name is &quot;Invalid createOffer argument.&quot;
+PASS pc.createOffer(requestSucceeded2, requestFailed5, {offerToReceiveVideo:0, offerToReceiveAudio:0}); threw exception Error: TypeMismatchError: DOM Exception 17.
+PASS createOffer request failed.
+PASS errorReason.name is &quot;Invalid createOffer argument.&quot;
+PASS pc.createOffer(requestSucceeded2, requestFailed6, {requestIdentity:&quot;yes&quot;, offerToReceiveVideo:&quot;&quot;, offerToReceiveAudio:0}); threw exception Error: TypeMismatchError: DOM Exception 17.
+PASS createOffer request failed.
+PASS errorReason.name is &quot;Invalid createOffer argument.&quot;
+PASS pc.createOffer(requestSucceeded2, requestFailed7, {requestIdentity:&quot;yes&quot;, offerToReceiveVideo:0, offerToReceiveAudio:&quot;&quot;}); threw exception Error: TypeMismatchError: DOM Exception 17.
+PASS createOffer request failed.
+PASS errorReason.name is &quot;Invalid createOffer argument.&quot;
+PASS pc.createOffer(requestSucceeded3, requestFailed1, {requestIdentity:&quot;yes&quot;, offerToReceiveVideo:0, offerToReceiveAudio:0}); did not throw exception.
</ins><span class="cx"> PASS createOffer request succeeded.
</span><span class="cx"> PASS sessionDescription.type is &quot;offer&quot;
</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', '&quot;Invalid createOffer argument.&quot;');
+
+                shouldNotThrow('pc.createOffer(requestSucceeded3, requestFailed1, {requestIdentity:&quot;yes&quot;, offerToReceiveVideo:0, offerToReceiveAudio:0});');
+            }
+
+            function requestFailed6(reason)
+            {
+                testPassed('createOffer request failed.');
+
+                errorReason = reason;
+                shouldBe('errorReason.name', '&quot;Invalid createOffer argument.&quot;');
+
+                shouldThrow('pc.createOffer(requestSucceeded2, requestFailed7, {requestIdentity:&quot;yes&quot;, offerToReceiveVideo:0, offerToReceiveAudio:&quot;&quot;});');
+            }
+
+            function requestFailed5(reason)
+            {
+                testPassed('createOffer request failed.');
+
+                errorReason = reason;
+                shouldBe('errorReason.name', '&quot;Invalid createOffer argument.&quot;');
+
+                shouldThrow('pc.createOffer(requestSucceeded2, requestFailed6, {requestIdentity:&quot;yes&quot;, offerToReceiveVideo:&quot;&quot;, offerToReceiveAudio:0});');
+            }
+
+            function requestFailed4(reason)
+            {
+                testPassed('createOffer request failed.');
+
+                errorReason = reason;
+                shouldBe('errorReason.name', '&quot;Invalid createOffer argument.&quot;');
+
+                shouldThrow('pc.createOffer(requestSucceeded2, requestFailed5, {offerToReceiveVideo:0, offerToReceiveAudio:0});');
+            }
+
+            function requestFailed3(reason)
+            {
+                testPassed('createOffer request failed.');
+
+                errorReason = reason;
+                shouldBe('errorReason.name', '&quot;Invalid createOffer argument.&quot;');
+
+                shouldThrow('pc.createOffer(requestSucceeded2, requestFailed4, {requestIdentity:&quot;yes&quot;, 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', '&quot;IncompatibleConstraintsError&quot;');
</del><ins>+                shouldBe('errorReason.name', '&quot;Invalid createOffer argument.&quot;');
</ins><span class="cx"> 
</span><del>-                shouldNotThrow('pc.createOffer(requestSucceeded3, requestFailed1);');
</del><ins>+                shouldThrow('pc.createOffer(requestSucceeded2, requestFailed3, {requestIdentity:&quot;yes&quot;, 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', '&quot;offer&quot;');
</span><span class="cx"> 
</span><del>-                shouldNotThrow('pc.createOffer(requestSucceeded2, requestFailed2, {mandatory:{&quot;succeed&quot;: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:{&quot;succeed&quot;: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  &lt;thiago.lacerda@openbossa.org&gt;
+
+        [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  &lt;bburg@apple.com&gt;
</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 &quot;config.h&quot;
+
+#if ENABLE(MEDIA_STREAM)
+#include &quot;RTCOfferAnswerOptions.h&quot;
+
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+static bool validateRequestIdentity(const String&amp; value)
+{
+    return value == &quot;yes&quot; || value == &quot;no&quot; || value == &quot;ifconfigured&quot;;
+}
+
+PassRefPtr&lt;RTCOfferAnswerOptions&gt; RTCOfferAnswerOptions::create(const Dictionary&amp; options, ExceptionCode&amp; ec)
+{
+    RefPtr&lt;RTCOfferAnswerOptions&gt; offerAnswerOptions = adoptRef(new RTCOfferAnswerOptions());
+    String requestIdentity;
+    if (!offerAnswerOptions-&gt;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&amp; options)
+{
+    String requestIdentity;
+    if (!options.isUndefinedOrNull() &amp;&amp; (!options.get(&quot;requestIdentity&quot;, requestIdentity) || requestIdentity.isEmpty()))
+        return false;
+
+    if (validateRequestIdentity(requestIdentity))
+        m_requestIdentity = requestIdentity;
+
+    return true;
+}
+
+PassRefPtr&lt;RTCOfferOptions&gt; RTCOfferOptions::create(const Dictionary&amp; options, ExceptionCode&amp; ec)
+{
+    RefPtr&lt;RTCOfferOptions&gt; offerOptions = adoptRef(new RTCOfferOptions());
+    if (!offerOptions-&gt;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&amp; options)
+{
+    if (options.isUndefinedOrNull())
+        return true;
+
+    if (!RTCOfferAnswerOptions::initialize(options))
+        return false;
+
+    String offerToReceiveVideoStr;
+    bool numberConversionSuccess;
+    if (!options.get(&quot;offerToReceiveVideo&quot;, offerToReceiveVideoStr))
+        return false;
+
+    m_offerToReceiveVideo = offerToReceiveVideoStr.toInt64Strict(&amp;numberConversionSuccess);
+    if (!numberConversionSuccess)
+        return false;
+
+    String offerToReceiveAudioStr;
+    if (!options.get(&quot;offerToReceiveAudio&quot;, offerToReceiveAudioStr))
+        return false;
+
+    m_offerToReceiveAudio = offerToReceiveAudioStr.toInt64Strict(&amp;numberConversionSuccess);
+    if (!numberConversionSuccess)
+        return false;
+
+    bool voiceActivityDetection;
+    if (options.get(&quot;voiceActivityDetection&quot;, voiceActivityDetection))
+        m_voiceActivityDetection = voiceActivityDetection;
+
+    bool iceRestart;
+    if (options.get(&quot;iceRestart&quot;, 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 &quot;Dictionary.h&quot;
+#include &quot;ExceptionCode.h&quot;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+
+namespace WebCore {
+
+class Dictionary;
+
+class RTCOfferAnswerOptions : public RefCounted&lt;RTCOfferAnswerOptions&gt; {
+public:
+    static PassRefPtr&lt;RTCOfferAnswerOptions&gt; create(const Dictionary&amp;, ExceptionCode&amp;);
+
+    const String&amp; requestIdentity() const { return m_requestIdentity; }
+
+    virtual ~RTCOfferAnswerOptions() { }
+
+protected:
+    virtual bool initialize(const Dictionary&amp;);
+    RTCOfferAnswerOptions()
+        : m_requestIdentity(&quot;ifconfigured&quot;)
+    {
+    }
+
+private:
+    String m_requestIdentity;
+};
+
+class RTCOfferOptions : public RTCOfferAnswerOptions {
+public:
+    static PassRefPtr&lt;RTCOfferOptions&gt; create(const Dictionary&amp;, ExceptionCode&amp;);
+
+    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&amp;) 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 &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;FrameLoader.h&quot;
</span><span class="cx"> #include &quot;FrameLoaderClient.h&quot;
</span><del>-#include &quot;MediaConstraintsImpl.h&quot;
</del><span class="cx"> #include &quot;MediaStreamEvent.h&quot;
</span><span class="cx"> #include &quot;RTCConfiguration.h&quot;
</span><span class="cx"> #include &quot;RTCDTMFSender.h&quot;
</span><span class="lines">@@ -52,6 +51,7 @@
</span><span class="cx"> #include &quot;RTCIceCandidate.h&quot;
</span><span class="cx"> #include &quot;RTCIceCandidateDescriptor.h&quot;
</span><span class="cx"> #include &quot;RTCIceCandidateEvent.h&quot;
</span><ins>+#include &quot;RTCOfferAnswerOptions.h&quot;
</ins><span class="cx"> #include &quot;RTCPeerConnectionErrorCallback.h&quot;
</span><span class="cx"> #include &quot;RTCSessionDescription.h&quot;
</span><span class="cx"> #include &quot;RTCSessionDescriptionCallback.h&quot;
</span><span class="lines">@@ -203,7 +203,7 @@
</span><span class="cx">         (*stream)-&gt;removeObserver(this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RTCPeerConnection::createOffer(PassRefPtr&lt;RTCSessionDescriptionCallback&gt; successCallback, PassRefPtr&lt;RTCPeerConnectionErrorCallback&gt; errorCallback, const Dictionary&amp; mediaConstraints, ExceptionCode&amp; ec)
</del><ins>+void RTCPeerConnection::createOffer(PassRefPtr&lt;RTCSessionDescriptionCallback&gt; successCallback, PassRefPtr&lt;RTCPeerConnectionErrorCallback&gt; errorCallback, const Dictionary&amp; offerOptions, ExceptionCode&amp; 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&lt;MediaConstraints&gt; constraints = MediaConstraintsImpl::create(mediaConstraints, ec);
-    if (ec)
</del><ins>+    RefPtr&lt;RTCOfferOptions&gt; options = RTCOfferOptions::create(offerOptions, ec);
+    if (ec) {
+        callOnMainThread([=] {
+            RefPtr&lt;DOMError&gt; error = DOMError::create(&quot;Invalid createOffer argument.&quot;);
+            errorCallback-&gt;handleEvent(error.get());
+        });
</ins><span class="cx">         return;
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;RTCSessionDescriptionRequestImpl&gt; request = RTCSessionDescriptionRequestImpl::create(scriptExecutionContext(), successCallback, errorCallback);
</span><del>-    m_peerHandler-&gt;createOffer(request.release(), constraints);
</del><ins>+    m_peerHandler-&gt;createOffer(request.release(), options.release());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RTCPeerConnection::createAnswer(PassRefPtr&lt;RTCSessionDescriptionCallback&gt; successCallback, PassRefPtr&lt;RTCPeerConnectionErrorCallback&gt; errorCallback, const Dictionary&amp; mediaConstraints, ExceptionCode&amp; ec)
</del><ins>+void RTCPeerConnection::createAnswer(PassRefPtr&lt;RTCSessionDescriptionCallback&gt; successCallback, PassRefPtr&lt;RTCPeerConnectionErrorCallback&gt; errorCallback, const Dictionary&amp; answerOptions, ExceptionCode&amp; 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&lt;MediaConstraints&gt; constraints = MediaConstraintsImpl::create(mediaConstraints, ec);
-    if (ec)
</del><ins>+    RefPtr&lt;RTCOfferAnswerOptions&gt; options = RTCOfferAnswerOptions::create(answerOptions, ec);
+    if (ec) {
+        callOnMainThread([=] {
+            RefPtr&lt;DOMError&gt; error = DOMError::create(&quot;Invalid createAnswer argument.&quot;);
+            errorCallback-&gt;handleEvent(error.get());
+        });
</ins><span class="cx">         return;
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;RTCSessionDescriptionRequestImpl&gt; request = RTCSessionDescriptionRequestImpl::create(scriptExecutionContext(), successCallback, errorCallback);
</span><del>-    m_peerHandler-&gt;createAnswer(request.release(), constraints.release());
</del><ins>+    m_peerHandler-&gt;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&lt;RTCPeerConnection&gt; create(ScriptExecutionContext&amp;, const Dictionary&amp; rtcConfiguration, ExceptionCode&amp;);
</span><span class="cx">     ~RTCPeerConnection();
</span><span class="cx"> 
</span><del>-    void createOffer(PassRefPtr&lt;RTCSessionDescriptionCallback&gt;, PassRefPtr&lt;RTCPeerConnectionErrorCallback&gt;, const Dictionary&amp; mediaConstraints, ExceptionCode&amp;);
</del><ins>+    void createOffer(PassRefPtr&lt;RTCSessionDescriptionCallback&gt;, PassRefPtr&lt;RTCPeerConnectionErrorCallback&gt;, const Dictionary&amp; offerOptions, ExceptionCode&amp;);
</ins><span class="cx"> 
</span><del>-    void createAnswer(PassRefPtr&lt;RTCSessionDescriptionCallback&gt;, PassRefPtr&lt;RTCPeerConnectionErrorCallback&gt;, const Dictionary&amp; mediaConstraints, ExceptionCode&amp;);
</del><ins>+    void createAnswer(PassRefPtr&lt;RTCSessionDescriptionCallback&gt;, PassRefPtr&lt;RTCPeerConnectionErrorCallback&gt;, const Dictionary&amp; answerOptions, ExceptionCode&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void setLocalDescription(PassRefPtr&lt;RTCSessionDescription&gt;, PassRefPtr&lt;VoidCallback&gt;, PassRefPtr&lt;RTCPeerConnectionErrorCallback&gt;, ExceptionCode&amp;);
</span><span class="cx">     PassRefPtr&lt;RTCSessionDescription&gt; localDescription(ExceptionCode&amp;);
</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&lt;RTCConfiguration&gt;) = 0;
</span><span class="cx"> 
</span><del>-    virtual void createOffer(PassRefPtr&lt;RTCSessionDescriptionRequest&gt;, PassRefPtr&lt;MediaConstraints&gt;) = 0;
-    virtual void createAnswer(PassRefPtr&lt;RTCSessionDescriptionRequest&gt;, PassRefPtr&lt;MediaConstraints&gt;) = 0;
</del><ins>+    virtual void createOffer(PassRefPtr&lt;RTCSessionDescriptionRequest&gt;, PassRefPtr&lt;RTCOfferOptions&gt;) = 0;
+    virtual void createAnswer(PassRefPtr&lt;RTCSessionDescriptionRequest&gt;, PassRefPtr&lt;RTCOfferAnswerOptions&gt;) = 0;
</ins><span class="cx">     virtual void setLocalDescription(PassRefPtr&lt;RTCVoidRequest&gt;, PassRefPtr&lt;RTCSessionDescriptionDescriptor&gt;) = 0;
</span><span class="cx">     virtual void setRemoteDescription(PassRefPtr&lt;RTCVoidRequest&gt;, PassRefPtr&lt;RTCSessionDescriptionDescriptor&gt;) = 0;
</span><span class="cx">     virtual PassRefPtr&lt;RTCSessionDescriptionDescriptor&gt; 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&lt;RTCSessionDescriptionRequest&gt; request, PassRefPtr&lt;MediaConstraints&gt; constraints)
</del><ins>+void RTCPeerConnectionHandlerMock::createOffer(PassRefPtr&lt;RTCSessionDescriptionRequest&gt; request, PassRefPtr&lt;RTCOfferOptions&gt;)
</ins><span class="cx"> {
</span><del>-    String succeedValue;
-    RefPtr&lt;SessionRequestNotifier&gt; notifier;
-    if (constraints-&gt;getMandatoryConstraintValue(&quot;succeed&quot;, succeedValue) &amp;&amp; succeedValue == &quot;false&quot;)
-        notifier = adoptRef(new SessionRequestNotifier(request, 0, RTCPeerConnectionHandler::incompatibleConstraintsErrorName()));
-    else
-        notifier = adoptRef(new SessionRequestNotifier(request, RTCSessionDescriptionDescriptor::create(&quot;offer&quot;, &quot;local&quot;)));
-
</del><ins>+    RefPtr&lt;SessionRequestNotifier&gt; notifier = adoptRef(new SessionRequestNotifier(request, RTCSessionDescriptionDescriptor::create(&quot;offer&quot;, &quot;local&quot;)));
</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&lt;RTCSessionDescriptionRequest&gt; request, PassRefPtr&lt;MediaConstraints&gt; constraints)
</del><ins>+void RTCPeerConnectionHandlerMock::createAnswer(PassRefPtr&lt;RTCSessionDescriptionRequest&gt; request, PassRefPtr&lt;RTCOfferAnswerOptions&gt;)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;SessionRequestNotifier&gt; 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-&gt;getMandatoryConstraintValue(&quot;succeed&quot;, succeedValue) &amp;&amp; succeedValue == &quot;false&quot;)
-        notifier = adoptRef(new SessionRequestNotifier(request, 0, RTCPeerConnectionHandler::incompatibleConstraintsErrorName()));
-    else
-        notifier = adoptRef(new SessionRequestNotifier(request, RTCSessionDescriptionDescriptor::create(&quot;answer&quot;, &quot;local&quot;)));
-
</del><ins>+    RefPtr&lt;SessionRequestNotifier&gt; notifier = adoptRef(new SessionRequestNotifier(request, RTCSessionDescriptionDescriptor::create(&quot;answer&quot;, &quot;local&quot;)));
</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&lt;RTCConfiguration&gt;) override;
</span><span class="cx"> 
</span><del>-    virtual void createOffer(PassRefPtr&lt;RTCSessionDescriptionRequest&gt;, PassRefPtr&lt;MediaConstraints&gt;) override;
-    virtual void createAnswer(PassRefPtr&lt;RTCSessionDescriptionRequest&gt;, PassRefPtr&lt;MediaConstraints&gt;) override;
</del><ins>+    virtual void createOffer(PassRefPtr&lt;RTCSessionDescriptionRequest&gt;, PassRefPtr&lt;RTCOfferOptions&gt;) override;
+    virtual void createAnswer(PassRefPtr&lt;RTCSessionDescriptionRequest&gt;, PassRefPtr&lt;RTCOfferAnswerOptions&gt;) override;
</ins><span class="cx">     virtual void setLocalDescription(PassRefPtr&lt;RTCVoidRequest&gt;, PassRefPtr&lt;RTCSessionDescriptionDescriptor&gt;) override;
</span><span class="cx">     virtual void setRemoteDescription(PassRefPtr&lt;RTCVoidRequest&gt;, PassRefPtr&lt;RTCSessionDescriptionDescriptor&gt;) override;
</span><span class="cx">     virtual PassRefPtr&lt;RTCSessionDescriptionDescriptor&gt; localDescription() override;
</span></span></pre>
</div>
</div>

</body>
</html>