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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 void OnMessage(const DataBuffer& buffer) override { | 28 void OnMessage(const DataBuffer& buffer) override { |
29 RTCDataBuffer *data_buffer = | 29 RTCDataBuffer *data_buffer = |
30 [[RTCDataBuffer alloc] initWithNativeBuffer:buffer]; | 30 [[RTCDataBuffer alloc] initWithNativeBuffer:buffer]; |
31 [channel_.delegate dataChannel:channel_ | 31 [channel_.delegate dataChannel:channel_ |
32 didReceiveMessageWithBuffer:data_buffer]; | 32 didReceiveMessageWithBuffer:data_buffer]; |
33 } | 33 } |
34 | 34 |
35 void OnBufferedAmountChange(uint64_t previousAmount) override { | 35 void OnBufferedAmountChange(uint64_t previousAmount) override { |
36 id<RTCDataChannelDelegate> delegate = channel_.delegate; | 36 id<RTCDataChannelDelegate> delegate = channel_.delegate; |
37 if ([delegate | 37 SEL sel = @selector(dataChannel:didChangeBufferedAmount:); |
38 respondsToSelector:@selector(channel:didChangeBufferedAmount:)]) { | 38 if ([delegate respondsToSelector:sel]) { |
39 [delegate dataChannel:channel_ didChangeBufferedAmount:previousAmount]; | 39 [delegate dataChannel:channel_ didChangeBufferedAmount:previousAmount]; |
40 } | 40 } |
41 } | 41 } |
42 | 42 |
43 private: | 43 private: |
44 __weak RTCDataChannel *channel_; | 44 __weak RTCDataChannel *channel_; |
45 }; | 45 }; |
46 } | 46 } |
47 | 47 |
48 | 48 |
(...skipping 165 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 |