Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2009)

Unified Diff: Source/modules/mediastream/RTCPeerConnection.cpp

Issue 16305017: Removes the old createDataChannel and starts to use the new one with WebRTCDataChannelInit (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/mediastream/RTCPeerConnection.cpp
diff --git a/Source/modules/mediastream/RTCPeerConnection.cpp b/Source/modules/mediastream/RTCPeerConnection.cpp
index ae92d9e94a9f5479eec611ea6988d8a10f01be41..c11c0b81e3c99aaf01ce6417090d9e530d58d9d3 100644
--- a/Source/modules/mediastream/RTCPeerConnection.cpp
+++ b/Source/modules/mediastream/RTCPeerConnection.cpp
@@ -57,6 +57,7 @@
#include "modules/mediastream/RTCStatsCallback.h"
#include "modules/mediastream/RTCStatsRequestImpl.h"
#include "modules/mediastream/RTCVoidRequestImpl.h"
+#include "public/platform/WebRTCDataChannelInit.h"
#include "public/platform/WebRTCICECandidate.h"
#include "public/platform/WebRTCSessionDescription.h"
@@ -444,9 +445,23 @@ PassRefPtr<RTCDataChannel> RTCPeerConnection::createDataChannel(String label, co
return 0;
}
- bool reliable = true;
- options.get("reliable", reliable);
- RefPtr<RTCDataChannel> channel = RTCDataChannel::create(scriptExecutionContext(), m_peerHandler.get(), label, reliable, ec);
+ WebKit::WebRTCDataChannelInit init;
+ options.get("ordered", init.ordered);
+ options.get("negotiated", init.negotiated);
+
+ unsigned short value = 0;
+ if (options.get("id", value))
+ init.id = value;
+ if (options.get("maxRetransmits", value))
+ init.maxRetransmits = value;
+ if (options.get("maxRetransmitTime", value))
+ init.maxRetransmitTime = value;
+
+ String protocolString;
+ options.get("protocol", protocolString);
+ init.protocol = protocolString;
+
+ RefPtr<RTCDataChannel> channel = RTCDataChannel::create(scriptExecutionContext(), m_peerHandler.get(), label, init, ec);
if (ec)
return 0;
m_dataChannels.append(channel);

Powered by Google App Engine
This is Rietveld 408576698