OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 bool binary; | 68 bool binary; |
69 }; | 69 }; |
70 | 70 |
71 class DataChannelObserver { | 71 class DataChannelObserver { |
72 public: | 72 public: |
73 // The data channel state have changed. | 73 // The data channel state have changed. |
74 virtual void OnStateChange() = 0; | 74 virtual void OnStateChange() = 0; |
75 // A data buffer was successfully received. | 75 // A data buffer was successfully received. |
76 virtual void OnMessage(const DataBuffer& buffer) = 0; | 76 virtual void OnMessage(const DataBuffer& buffer) = 0; |
77 // The data channel's buffered_amount has changed. | 77 // The data channel's buffered_amount has changed. |
78 virtual void OnBufferedAmountChange(uint64_t previous_amount){}; | 78 virtual void OnBufferedAmountChange(uint64_t previous_amount) {} |
79 | 79 |
80 protected: | 80 protected: |
81 virtual ~DataChannelObserver() {} | 81 virtual ~DataChannelObserver() {} |
82 }; | 82 }; |
83 | 83 |
84 class DataChannelInterface : public rtc::RefCountInterface { | 84 class DataChannelInterface : public rtc::RefCountInterface { |
85 public: | 85 public: |
86 // Keep in sync with DataChannel.java:State and | 86 // Keep in sync with DataChannel.java:State and |
87 // RTCDataChannel.h:RTCDataChannelState. | 87 // RTCDataChannel.h:RTCDataChannelState. |
88 enum DataState { | 88 enum DataState { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // Sends |data| to the remote peer. | 137 // Sends |data| to the remote peer. |
138 virtual bool Send(const DataBuffer& buffer) = 0; | 138 virtual bool Send(const DataBuffer& buffer) = 0; |
139 | 139 |
140 protected: | 140 protected: |
141 virtual ~DataChannelInterface() {} | 141 virtual ~DataChannelInterface() {} |
142 }; | 142 }; |
143 | 143 |
144 } // namespace webrtc | 144 } // namespace webrtc |
145 | 145 |
146 #endif // WEBRTC_API_DATACHANNELINTERFACE_H_ | 146 #endif // WEBRTC_API_DATACHANNELINTERFACE_H_ |
OLD | NEW |