<!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>[214421] 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/214421">214421</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2017-03-27 11:13:19 -0700 (Mon, 27 Mar 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>Tighten RTCDatachannel creation and parameter getters
https://bugs.webkit.org/show_bug.cgi?id=170081
Patch by Youenn Fablet <youenn@apple.com> on 2017-03-27
Reviewed by Eric Carlson.
Source/WebCore:
Covered by updated tests.
Adding some parameter checks when creating data channels.
Making some getters nullable as per the spec.
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCDataChannel.idl:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::createDataChannel):
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::createDataChannel):
(WebCore::LibWebRTCMediaEndpoint::addDataChannel):
* platform/mediastream/RTCDataChannelHandler.h:
(): Deleted.
LayoutTests:
* webrtc/datachannel/basic-expected.txt:
* webrtc/datachannel/basic.html:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestswebrtcdatachannelbasicexpectedtxt">trunk/LayoutTests/webrtc/datachannel/basic-expected.txt</a></li>
<li><a href="#trunkLayoutTestswebrtcdatachannelbasichtml">trunk/LayoutTests/webrtc/datachannel/basic.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCDataChannelh">trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCDataChannelidl">trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCPeerConnectioncpp">trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCPeerConnectionidl">trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamlibwebrtcLibWebRTCMediaEndpointcpp">trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamRTCDataChannelHandlerh">trunk/Source/WebCore/platform/mediastream/RTCDataChannelHandler.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (214420 => 214421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-27 18:10:45 UTC (rev 214420)
+++ trunk/LayoutTests/ChangeLog        2017-03-27 18:13:19 UTC (rev 214421)
</span><span class="lines">@@ -1,5 +1,15 @@
</span><span class="cx"> 2017-03-27 Youenn Fablet <youenn@apple.com>
</span><span class="cx">
</span><ins>+ Tighten RTCDatachannel creation and parameter getters
+ https://bugs.webkit.org/show_bug.cgi?id=170081
+
+ Reviewed by Eric Carlson.
+
+ * webrtc/datachannel/basic-expected.txt:
+ * webrtc/datachannel/basic.html:
+
+2017-03-27 Youenn Fablet <youenn@apple.com>
+
</ins><span class="cx"> Add support for RTCRtpReceiver/RTCRtpSender getParameters
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=170057
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestswebrtcdatachannelbasicexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/webrtc/datachannel/basic-expected.txt (214420 => 214421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webrtc/datachannel/basic-expected.txt        2017-03-27 18:10:45 UTC (rev 214420)
+++ trunk/LayoutTests/webrtc/datachannel/basic-expected.txt        2017-03-27 18:13:19 UTC (rev 214421)
</span><span class="lines">@@ -3,4 +3,15 @@
</span><span class="cx"> PASS Basic data channel exchange from receiver to offerer
</span><span class="cx"> PASS Basic data channel exchange from offerer to receiver using UDP only
</span><span class="cx"> PASS Basic data channel exchange from offerer to receiver using TCP only
</span><ins>+PASS Basic data channel exchange from offerer to receiver
+PASS Creating data channel with very long label
+PASS Creating data channel after closing the connection
+PASS Wrong data channel init: long protocol
+PASS Wrong data channel init: long id
+PASS Wrong data channel init: maxPacketLifeTime and maxRetransmits
+PASS Right data channel init: ordered init
+PASS Right data channel init: unordered init
+PASS Right data channel init: default ordered init with id
+PASS Right data channel init: no init
+PASS Right data channel init: null
</ins><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestswebrtcdatachannelbasichtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/webrtc/datachannel/basic.html (214420 => 214421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webrtc/datachannel/basic.html        2017-03-27 18:10:45 UTC (rev 214420)
+++ trunk/LayoutTests/webrtc/datachannel/basic.html        2017-03-27 18:13:19 UTC (rev 214421)
</span><span class="lines">@@ -118,6 +118,107 @@
</span><span class="cx"> });
</span><span class="cx"> }, "Basic data channel exchange from offerer to receiver using TCP only");
</span><span class="cx">
</span><ins>+promise_test((test) => {
+ counter = 0;
+ return new Promise((resolve, reject) => {
+ if (window.internals)
+ internals.useMockRTCPeerConnectionFactory("TwoRealPeerConnections");
+
+ var checkDataChannelOptions = (channel, init) => {
+ assert_equals(channel.ordered, init.ordered, "ordered");
+ assert_equals(channel.maxPacketLifeTime, init.maxPacketLifeTime, "maxPacketLifeTime");
+ assert_equals(channel.maxRetransmitTime, init.maxRetransmitTime, "maxRetransmitTime");
+ assert_equals(channel.maxRetransmits, init.maxRetransmits, "maxRetransmits");
+ assert_equals(channel.protocol, init.protocol, "protocol");
+ assert_equals(channel.negotiated, init.negotiated, "negotiated");
+ assert_equals(channel.id, init.id, "id");
+ };
+
+ finishTest = resolve;
+ createConnections((localConnection) => {
+ var init = { ordered: true, maxPacketLifeTime: 10, maxRetransmitTime: 11, protocol: "whatever", negotiated: false, id: "id" };
+ localChannel = localConnection.createDataChannel('sendDataChannel', init);
+ localChannel.onopen = () => { sendMessages(localChannel) };
+ }, (remoteConnection) => {
+ remoteConnection.ondatachannel = (event) => {
+ remoteChannel = event.channel;
+ remoteChannel.onmessage = receiveMessages;
+ };
+ });
+ });
+}, "Basic data channel exchange from offerer to receiver");
+
+var longString = "abcdefgh";
+for (var cptr = 0; cptr < 16; ++cptr)
+ longString += longString;
+
+test(() => {
+ if (window.internals)
+ internals.useMockRTCPeerConnectionFactory("OneRealPeerConnections");
+ var pc = new RTCPeerConnection();
+ assert_throws(new TypeError, () => { pc.createDataChannel(longString); });
+}, "Creating data channel with very long label");
+
+test(() => {
+ if (window.internals)
+ internals.useMockRTCPeerConnectionFactory("OneRealPeerConnections");
+ var pc = new RTCPeerConnection();
+ pc.close();
+ assert_throws("InvalidStateError", () => { pc.createDataChannel('sendDataChannel'); });
+}, "Creating data channel after closing the connection");
+
+function testWrongDataChannelInit(init, title)
+{
+ return test(() => {
+ if (window.internals)
+ internals.useMockRTCPeerConnectionFactory("OneRealPeerConnections");
+ var pc = new RTCPeerConnection();
+ assert_throws(new TypeError, () => { pc.createDataChannel('sendDataChannel', init); });
+ }, "Wrong data channel init: " + title);
+}
+
+function testRightDataChannelInit(init, title)
+{
+ return test(() => {
+ if (window.internals)
+ internals.useMockRTCPeerConnectionFactory("OneRealPeerConnections");
+ var pc = new RTCPeerConnection();
+ channel = pc.createDataChannel('sendDataChannel', init);
+
+ if (!init)
+ init = { };
+ if (init.ordered === undefined)
+ init.ordered = true;
+ if (init.maxPacketLifeTime === undefined)
+ init.maxPacketLifeTime = null;
+ if (init.maxRetransmits === undefined)
+ init.maxRetransmits = null;
+ if (init.protocol === undefined)
+ init.protocol = "";
+ if (init.negotiated === undefined)
+ init.negotiated = false;
+ if (init.id === undefined)
+ init.id = null;
+
+ assert_equals(channel.ordered, init.ordered, "ordered");
+ assert_equals(channel.maxPacketLifeTime, init.maxPacketLifeTime, "maxPacketLifeTime");
+ assert_equals(channel.maxRetransmitTime, init.maxRetransmitTime, "maxRetransmitTime");
+ assert_equals(channel.maxRetransmits, init.maxRetransmits, "maxRetransmits");
+ assert_equals(channel.protocol, init.protocol, "protocol");
+ assert_equals(channel.negotiated, init.negotiated, "negotiated");
+ assert_equals(channel.id, init.id, "id");
+ }, "Right data channel init: " + title);
+}
+
+testWrongDataChannelInit({negotiated: false, protocol: longString}, "long protocol");
+testWrongDataChannelInit({id: 65535}, "long id");
+testWrongDataChannelInit({maxPacketLifeTime: 1, maxRetransmits: 1}, "maxPacketLifeTime and maxRetransmits");
+
+testRightDataChannelInit({ordered: true, maxRetransmit: 11, protocol: "whatever", negotiated: false, id: 1 }, "ordered init");
+testRightDataChannelInit({ordered: false, maxPacketLifeTime: 10, protocol: "whatever", negotiated: false, id: 2 }, "unordered init");
+testRightDataChannelInit({protocol: "whatever", negotiated: false, id: 123 }, "default ordered init with id");
+testRightDataChannelInit(undefined, "no init");
+testRightDataChannelInit(null, "null");
</ins><span class="cx"> </script>
</span><span class="cx"> </body>
</span><span class="cx"> </html>
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (214420 => 214421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-27 18:10:45 UTC (rev 214420)
+++ trunk/Source/WebCore/ChangeLog        2017-03-27 18:13:19 UTC (rev 214421)
</span><span class="lines">@@ -1,5 +1,28 @@
</span><span class="cx"> 2017-03-27 Youenn Fablet <youenn@apple.com>
</span><span class="cx">
</span><ins>+ Tighten RTCDatachannel creation and parameter getters
+ https://bugs.webkit.org/show_bug.cgi?id=170081
+
+ Reviewed by Eric Carlson.
+
+ Covered by updated tests.
+
+ Adding some parameter checks when creating data channels.
+ Making some getters nullable as per the spec.
+
+ * Modules/mediastream/RTCDataChannel.h:
+ * Modules/mediastream/RTCDataChannel.idl:
+ * Modules/mediastream/RTCPeerConnection.cpp:
+ (WebCore::RTCPeerConnection::createDataChannel):
+ * Modules/mediastream/RTCPeerConnection.idl:
+ * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
+ (WebCore::LibWebRTCMediaEndpoint::createDataChannel):
+ (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
+ * platform/mediastream/RTCDataChannelHandler.h:
+ (): Deleted.
+
+2017-03-27 Youenn Fablet <youenn@apple.com>
+
</ins><span class="cx"> Add support for RTCRtpReceiver/RTCRtpSender getParameters
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=170057
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCDataChannelh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.h (214420 => 214421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.h        2017-03-27 18:10:45 UTC (rev 214420)
+++ trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.h        2017-03-27 18:13:19 UTC (rev 214421)
</span><span class="lines">@@ -48,12 +48,12 @@
</span><span class="cx"> public:
</span><span class="cx"> static Ref<RTCDataChannel> create(ScriptExecutionContext&, std::unique_ptr<RTCDataChannelHandler>&&, String&&, RTCDataChannelInit&&);
</span><span class="cx">
</span><del>- bool ordered() const { return m_options.ordered; }
- unsigned short maxRetransmitTime() const { return m_options.maxRetransmitTime; }
- unsigned short maxRetransmits() const { return m_options.maxRetransmits; }
</del><ins>+ bool ordered() const { return *m_options.ordered; }
+ std::optional<unsigned short> maxPacketLifeTime() const { return m_options.maxPacketLifeTime; }
+ std::optional<unsigned short> maxRetransmits() const { return m_options.maxRetransmits; }
</ins><span class="cx"> String protocol() const { return m_options.protocol; }
</span><del>- bool negotiated() const { return m_options.negotiated; };
- unsigned short id() const { return m_options.id; };
</del><ins>+ bool negotiated() const { return *m_options.negotiated; };
+ std::optional<unsigned short> id() const { return m_options.id; };
</ins><span class="cx">
</span><span class="cx"> String label() const { return m_label; }
</span><span class="cx"> const AtomicString& readyState() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCDataChannelidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.idl (214420 => 214421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.idl        2017-03-27 18:10:45 UTC (rev 214420)
+++ trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.idl        2017-03-27 18:13:19 UTC (rev 214421)
</span><span class="lines">@@ -28,11 +28,11 @@
</span><span class="cx"> ] interface RTCDataChannel : EventTarget {
</span><span class="cx"> readonly attribute DOMString label;
</span><span class="cx"> readonly attribute boolean ordered;
</span><del>- readonly attribute unsigned short maxRetransmitTime;
- readonly attribute unsigned short maxRetransmits;
</del><ins>+ readonly attribute unsigned short? maxPacketLifeTime;
+ readonly attribute unsigned short? maxRetransmits;
</ins><span class="cx"> readonly attribute DOMString protocol;
</span><span class="cx"> readonly attribute boolean negotiated;
</span><del>- readonly attribute unsigned short id;
</del><ins>+ readonly attribute unsigned short? id;
</ins><span class="cx"> readonly attribute DOMString readyState;
</span><span class="cx"> readonly attribute unsigned long bufferedAmount;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (214420 => 214421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp        2017-03-27 18:10:45 UTC (rev 214420)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp        2017-03-27 18:13:19 UTC (rev 214421)
</span><span class="lines">@@ -332,7 +332,15 @@
</span><span class="cx"> if (m_signalingState == RTCSignalingState::Closed)
</span><span class="cx"> return Exception { INVALID_STATE_ERR };
</span><span class="cx">
</span><del>- // FIXME: Check options
</del><ins>+ if (options.negotiated && !options.negotiated.value() && (label.length() > 65535 || options.protocol.length() > 65535))
+ return Exception { TypeError };
+
+ if (options.maxPacketLifeTime && options.maxRetransmits)
+ return Exception { TypeError };
+
+ if (options.id && options.id.value() > 65534)
+ return Exception { TypeError };
+
</ins><span class="cx"> auto channelHandler = m_backend->createDataChannelHandler(label, options);
</span><span class="cx"> if (!channelHandler)
</span><span class="cx"> return Exception { NOT_SUPPORTED_ERR };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl (214420 => 214421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl        2017-03-27 18:10:45 UTC (rev 214420)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl        2017-03-27 18:13:19 UTC (rev 214421)
</span><span class="lines">@@ -38,8 +38,7 @@
</span><span class="cx"> EnabledAtRuntime=PeerConnection
</span><span class="cx"> ] dictionary RTCDataChannelInit {
</span><span class="cx"> boolean ordered = true;
</span><del>- // FIXME 169644: rename to maxPacketLifeTime;
- unsigned short maxRetransmitTime;
</del><ins>+ unsigned short maxPacketLifeTime;
</ins><span class="cx"> unsigned short maxRetransmits;
</span><span class="cx"> USVString protocol = "";
</span><span class="cx"> boolean negotiated = false;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamlibwebrtcLibWebRTCMediaEndpointcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp (214420 => 214421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp        2017-03-27 18:10:45 UTC (rev 214420)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp        2017-03-27 18:13:19 UTC (rev 214421)
</span><span class="lines">@@ -562,12 +562,17 @@
</span><span class="cx"> std::unique_ptr<RTCDataChannelHandler> LibWebRTCMediaEndpoint::createDataChannel(const String& label, const RTCDataChannelInit& options)
</span><span class="cx"> {
</span><span class="cx"> webrtc::DataChannelInit init;
</span><del>- init.ordered = options.ordered;
- init.maxRetransmitTime = options.maxRetransmitTime;
- init.maxRetransmits = options.maxRetransmits;
</del><ins>+ if (options.ordered)
+ init.ordered = *options.ordered;
+ if (options.maxPacketLifeTime)
+ init.maxRetransmitTime = *options.maxPacketLifeTime;
+ if (options.maxRetransmits)
+ init.maxRetransmits = *options.maxRetransmits;
</ins><span class="cx"> init.protocol = options.protocol.utf8().data();
</span><del>- init.negotiated = options.negotiated;
- init.id = options.id;
</del><ins>+ if (options.negotiated)
+ init.negotiated = *options.negotiated;
+ if (options.id)
+ init.id = *options.id;
</ins><span class="cx">
</span><span class="cx"> return std::make_unique<LibWebRTCDataChannelHandler>(m_backend->CreateDataChannel(label.utf8().data(), &init));
</span><span class="cx"> }
</span><span class="lines">@@ -579,7 +584,7 @@
</span><span class="cx">
</span><span class="cx"> RTCDataChannelInit init;
</span><span class="cx"> init.ordered = dataChannel->ordered();
</span><del>- init.maxRetransmitTime = dataChannel->maxRetransmitTime();
</del><ins>+ init.maxPacketLifeTime = dataChannel->maxRetransmitTime();
</ins><span class="cx"> init.maxRetransmits = dataChannel->maxRetransmits();
</span><span class="cx"> init.protocol = String(protocol.data(), protocol.size());
</span><span class="cx"> init.negotiated = dataChannel->negotiated();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamRTCDataChannelHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/RTCDataChannelHandler.h (214420 => 214421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/RTCDataChannelHandler.h        2017-03-27 18:10:45 UTC (rev 214420)
+++ trunk/Source/WebCore/platform/mediastream/RTCDataChannelHandler.h        2017-03-27 18:13:19 UTC (rev 214421)
</span><span class="lines">@@ -26,17 +26,18 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEB_RTC)
</span><span class="cx">
</span><ins>+#include <wtf/Optional.h>
</ins><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> struct RTCDataChannelInit {
</span><del>- bool ordered { true };
- int maxRetransmitTime { -1 };
- int maxRetransmits { -1 };
</del><ins>+ std::optional<bool> ordered;
+ std::optional<unsigned short> maxPacketLifeTime;
+ std::optional<unsigned short> maxRetransmits;
</ins><span class="cx"> String protocol;
</span><del>- bool negotiated { false };
- int id { -1 };
</del><ins>+ std::optional<bool> negotiated;
+ std::optional<unsigned short> id;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> class RTCDataChannelHandlerClient;
</span></span></pre>
</div>
</div>
</body>
</html>