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

Side by Side Diff: webrtc/api/objc/RTCDataChannel.mm

Issue 1696673003: Tweaks for new Objective-C API. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Don't use object subscripting Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « webrtc/api/objc/RTCDataChannel.h ('k') | webrtc/api/objc/RTCDataChannelConfiguration.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 116 }
117 117
118 - (NSString *)protocol { 118 - (NSString *)protocol {
119 return [NSString stringForStdString:_nativDataChannel->protocol()]; 119 return [NSString stringForStdString:_nativDataChannel->protocol()];
120 } 120 }
121 121
122 - (BOOL)isNegotiated { 122 - (BOOL)isNegotiated {
123 return _nativDataChannel->negotiated(); 123 return _nativDataChannel->negotiated();
124 } 124 }
125 125
126 - (int)id { 126 - (int)channelId {
127 return _nativDataChannel->id(); 127 return _nativDataChannel->id();
128 } 128 }
129 129
130 - (RTCDataChannelState)readyState { 130 - (RTCDataChannelState)readyState {
131 return [[self class] dataChannelStateForNativeState: 131 return [[self class] dataChannelStateForNativeState:
132 _nativDataChannel->state()]; 132 _nativDataChannel->state()];
133 } 133 }
134 134
135 - (uint64_t)bufferedAmount { 135 - (uint64_t)bufferedAmount {
136 return _nativDataChannel->buffered_amount(); 136 return _nativDataChannel->buffered_amount();
(...skipping 17 matching lines...) Expand all
154 - (void)close { 154 - (void)close {
155 _nativDataChannel->Close(); 155 _nativDataChannel->Close();
156 } 156 }
157 157
158 - (BOOL)sendData:(RTCDataBuffer *)data { 158 - (BOOL)sendData:(RTCDataBuffer *)data {
159 return _nativDataChannel->Send(*data.nativeDataBuffer); 159 return _nativDataChannel->Send(*data.nativeDataBuffer);
160 } 160 }
161 161
162 - (NSString *)description { 162 - (NSString *)description {
163 return [NSString stringWithFormat:@"RTCDataChannel:\n%ld\n%@\n%@", 163 return [NSString stringWithFormat:@"RTCDataChannel:\n%ld\n%@\n%@",
164 (long)self.id, 164 (long)self.channelId,
165 self.label, 165 self.label,
166 [[self class] 166 [[self class]
167 stringForState:self.readyState]]; 167 stringForState:self.readyState]];
168 } 168 }
169 169
170 #pragma mark - Private 170 #pragma mark - Private
171 171
172 - (instancetype)initWithNativeDataChannel: 172 - (instancetype)initWithNativeDataChannel:
173 (rtc::scoped_refptr<webrtc::DataChannelInterface>)nativeDataChannel { 173 (rtc::scoped_refptr<webrtc::DataChannelInterface>)nativeDataChannel {
174 NSParameterAssert(nativeDataChannel); 174 NSParameterAssert(nativeDataChannel);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 case RTCDataChannelStateOpen: 214 case RTCDataChannelStateOpen:
215 return @"Open"; 215 return @"Open";
216 case RTCDataChannelStateClosing: 216 case RTCDataChannelStateClosing:
217 return @"Closing"; 217 return @"Closing";
218 case RTCDataChannelStateClosed: 218 case RTCDataChannelStateClosed:
219 return @"Closed"; 219 return @"Closed";
220 } 220 }
221 } 221 }
222 222
223 @end 223 @end
OLDNEW
« no previous file with comments | « webrtc/api/objc/RTCDataChannel.h ('k') | webrtc/api/objc/RTCDataChannelConfiguration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698