OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |