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

Unified Diff: webrtc/api/objc/RTCPeerConnection+DataChannel.mm

Issue 1640993002: Update API for Objective-C RTCPeerConnection. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Changes based on feedback Created 4 years, 10 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
« no previous file with comments | « webrtc/api/objc/RTCPeerConnection.mm ('k') | webrtc/api/objc/RTCPeerConnection+Private.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/objc/RTCPeerConnection+DataChannel.mm
diff --git a/webrtc/api/objc/RTCPeerConnection+DataChannel.mm b/webrtc/api/objc/RTCPeerConnection+DataChannel.mm
new file mode 100644
index 0000000000000000000000000000000000000000..cf646adda67697754795587a4f2af140086ad252
--- /dev/null
+++ b/webrtc/api/objc/RTCPeerConnection+DataChannel.mm
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2015 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#import "webrtc/api/objc/RTCPeerConnection+Private.h"
+
+#import "webrtc/api/objc/RTCDataChannel+Private.h"
+#import "webrtc/api/objc/RTCDataChannelConfiguration+Private.h"
+#import "webrtc/base/objc/NSString+StdString.h"
+
+@implementation RTCPeerConnection (DataChannel)
+
+- (RTCDataChannel *)dataChannelForLabel:(NSString *)label
+ configuration:
+ (RTCDataChannelConfiguration *)configuration {
+ std::string labelString = [NSString stdStringForString:label];
+ const webrtc::DataChannelInit nativeInit =
+ configuration.nativeDataChannelInit;
+ rtc::scoped_refptr<webrtc::DataChannelInterface> dataChannel =
+ self.nativePeerConnection->CreateDataChannel(labelString,
+ &nativeInit);
+ return [[RTCDataChannel alloc] initWithNativeDataChannel:dataChannel];
+}
+
+@end
« no previous file with comments | « webrtc/api/objc/RTCPeerConnection.mm ('k') | webrtc/api/objc/RTCPeerConnection+Private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698