henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 1 | /* |
kjellander | b24317b | 2016-02-10 07:54:43 -0800 | [diff] [blame] | 2 | * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 3 | * |
kjellander | b24317b | 2016-02-10 07:54:43 -0800 | [diff] [blame] | 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
Henrik Kjellander | 15583c1 | 2016-02-10 10:53:12 +0100 | [diff] [blame] | 11 | #ifndef WEBRTC_API_DATACHANNEL_H_ |
| 12 | #define WEBRTC_API_DATACHANNEL_H_ |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 13 | |
jiayl@webrtc.org | b43c99d | 2014-06-20 17:11:14 +0000 | [diff] [blame] | 14 | #include <deque> |
deadbeef | ab9b2d1 | 2015-10-14 11:33:11 -0700 | [diff] [blame] | 15 | #include <set> |
buildbot@webrtc.org | a09a999 | 2014-08-13 17:26:08 +0000 | [diff] [blame] | 16 | #include <string> |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 17 | |
Henrik Kjellander | 15583c1 | 2016-02-10 10:53:12 +0100 | [diff] [blame] | 18 | #include "webrtc/api/datachannelinterface.h" |
| 19 | #include "webrtc/api/proxy.h" |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 20 | #include "webrtc/base/messagehandler.h" |
| 21 | #include "webrtc/base/scoped_ref_ptr.h" |
| 22 | #include "webrtc/base/sigslot.h" |
kjellander | a96e2d7 | 2016-02-04 23:52:28 -0800 | [diff] [blame] | 23 | #include "webrtc/media/base/mediachannel.h" |
kjellander@webrtc.org | 9b8df25 | 2016-02-12 06:47:59 +0100 | [diff] [blame] | 24 | #include "webrtc/pc/channel.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 25 | |
| 26 | namespace webrtc { |
| 27 | |
wu@webrtc.org | 7818752 | 2013-10-07 23:32:02 +0000 | [diff] [blame] | 28 | class DataChannel; |
| 29 | |
| 30 | class DataChannelProviderInterface { |
| 31 | public: |
wu@webrtc.org | cecfd18 | 2013-10-30 05:18:12 +0000 | [diff] [blame] | 32 | // Sends the data to the transport. |
wu@webrtc.org | 7818752 | 2013-10-07 23:32:02 +0000 | [diff] [blame] | 33 | virtual bool SendData(const cricket::SendDataParams& params, |
jbauch | eec21bd | 2016-03-20 06:15:43 -0700 | [diff] [blame] | 34 | const rtc::CopyOnWriteBuffer& payload, |
wu@webrtc.org | 7818752 | 2013-10-07 23:32:02 +0000 | [diff] [blame] | 35 | cricket::SendDataResult* result) = 0; |
wu@webrtc.org | cecfd18 | 2013-10-30 05:18:12 +0000 | [diff] [blame] | 36 | // Connects to the transport signals. |
wu@webrtc.org | 7818752 | 2013-10-07 23:32:02 +0000 | [diff] [blame] | 37 | virtual bool ConnectDataChannel(DataChannel* data_channel) = 0; |
wu@webrtc.org | cecfd18 | 2013-10-30 05:18:12 +0000 | [diff] [blame] | 38 | // Disconnects from the transport signals. |
wu@webrtc.org | 7818752 | 2013-10-07 23:32:02 +0000 | [diff] [blame] | 39 | virtual void DisconnectDataChannel(DataChannel* data_channel) = 0; |
wu@webrtc.org | cecfd18 | 2013-10-30 05:18:12 +0000 | [diff] [blame] | 40 | // Adds the data channel SID to the transport for SCTP. |
bemasc@webrtc.org | 9b5467e | 2014-12-04 23:16:52 +0000 | [diff] [blame] | 41 | virtual void AddSctpDataStream(int sid) = 0; |
wu@webrtc.org | cecfd18 | 2013-10-30 05:18:12 +0000 | [diff] [blame] | 42 | // Removes the data channel SID from the transport for SCTP. |
bemasc@webrtc.org | 9b5467e | 2014-12-04 23:16:52 +0000 | [diff] [blame] | 43 | virtual void RemoveSctpDataStream(int sid) = 0; |
wu@webrtc.org | 07a6fbe | 2013-11-04 18:41:34 +0000 | [diff] [blame] | 44 | // Returns true if the transport channel is ready to send data. |
| 45 | virtual bool ReadyToSendData() const = 0; |
wu@webrtc.org | 7818752 | 2013-10-07 23:32:02 +0000 | [diff] [blame] | 46 | |
| 47 | protected: |
| 48 | virtual ~DataChannelProviderInterface() {} |
| 49 | }; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 50 | |
henrika@webrtc.org | aebb1ad | 2014-01-14 10:00:58 +0000 | [diff] [blame] | 51 | struct InternalDataChannelInit : public DataChannelInit { |
| 52 | enum OpenHandshakeRole { |
| 53 | kOpener, |
| 54 | kAcker, |
| 55 | kNone |
| 56 | }; |
| 57 | // The default role is kOpener because the default |negotiated| is false. |
| 58 | InternalDataChannelInit() : open_handshake_role(kOpener) {} |
| 59 | explicit InternalDataChannelInit(const DataChannelInit& base) |
| 60 | : DataChannelInit(base), open_handshake_role(kOpener) { |
| 61 | // If the channel is externally negotiated, do not send the OPEN message. |
| 62 | if (base.negotiated) { |
| 63 | open_handshake_role = kNone; |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | OpenHandshakeRole open_handshake_role; |
| 68 | }; |
| 69 | |
deadbeef | ab9b2d1 | 2015-10-14 11:33:11 -0700 | [diff] [blame] | 70 | // Helper class to allocate unique IDs for SCTP DataChannels |
| 71 | class SctpSidAllocator { |
| 72 | public: |
| 73 | // Gets the first unused odd/even id based on the DTLS role. If |role| is |
| 74 | // SSL_CLIENT, the allocated id starts from 0 and takes even numbers; |
| 75 | // otherwise, the id starts from 1 and takes odd numbers. |
| 76 | // Returns false if no id can be allocated. |
| 77 | bool AllocateSid(rtc::SSLRole role, int* sid); |
| 78 | |
| 79 | // Attempts to reserve a specific sid. Returns false if it's unavailable. |
| 80 | bool ReserveSid(int sid); |
| 81 | |
| 82 | // Indicates that |sid| isn't in use any more, and is thus available again. |
| 83 | void ReleaseSid(int sid); |
| 84 | |
| 85 | private: |
| 86 | // Checks if |sid| is available to be assigned to a new SCTP data channel. |
| 87 | bool IsSidAvailable(int sid) const; |
| 88 | |
| 89 | std::set<int> used_sids_; |
| 90 | }; |
| 91 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 92 | // DataChannel is a an implementation of the DataChannelInterface based on |
wu@webrtc.org | cecfd18 | 2013-10-30 05:18:12 +0000 | [diff] [blame] | 93 | // libjingle's data engine. It provides an implementation of unreliable or |
| 94 | // reliabledata channels. Currently this class is specifically designed to use |
| 95 | // both RtpDataEngine and SctpDataEngine. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 96 | |
| 97 | // DataChannel states: |
wu@webrtc.org | cecfd18 | 2013-10-30 05:18:12 +0000 | [diff] [blame] | 98 | // kConnecting: The channel has been created the transport might not yet be |
| 99 | // ready. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 100 | // kOpen: The channel have a local SSRC set by a call to UpdateSendSsrc |
| 101 | // and a remote SSRC set by call to UpdateReceiveSsrc and the transport |
| 102 | // has been writable once. |
| 103 | // kClosing: DataChannelInterface::Close has been called or UpdateReceiveSsrc |
| 104 | // has been called with SSRC==0 |
| 105 | // kClosed: Both UpdateReceiveSsrc and UpdateSendSsrc has been called with |
| 106 | // SSRC==0. |
| 107 | class DataChannel : public DataChannelInterface, |
wu@webrtc.org | 07a6fbe | 2013-11-04 18:41:34 +0000 | [diff] [blame] | 108 | public sigslot::has_slots<>, |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 109 | public rtc::MessageHandler { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 110 | public: |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 111 | static rtc::scoped_refptr<DataChannel> Create( |
wu@webrtc.org | cecfd18 | 2013-10-30 05:18:12 +0000 | [diff] [blame] | 112 | DataChannelProviderInterface* provider, |
wu@webrtc.org | 7818752 | 2013-10-07 23:32:02 +0000 | [diff] [blame] | 113 | cricket::DataChannelType dct, |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 114 | const std::string& label, |
henrika@webrtc.org | aebb1ad | 2014-01-14 10:00:58 +0000 | [diff] [blame] | 115 | const InternalDataChannelInit& config); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 116 | |
| 117 | virtual void RegisterObserver(DataChannelObserver* observer); |
| 118 | virtual void UnregisterObserver(); |
| 119 | |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 120 | virtual std::string label() const { return label_; } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 121 | virtual bool reliable() const; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 122 | virtual bool ordered() const { return config_.ordered; } |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 123 | virtual uint16_t maxRetransmitTime() const { |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 124 | return config_.maxRetransmitTime; |
| 125 | } |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 126 | virtual uint16_t maxRetransmits() const { return config_.maxRetransmits; } |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 127 | virtual std::string protocol() const { return config_.protocol; } |
| 128 | virtual bool negotiated() const { return config_.negotiated; } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 129 | virtual int id() const { return config_.id; } |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 130 | virtual uint64_t buffered_amount() const; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 131 | virtual void Close(); |
| 132 | virtual DataState state() const { return state_; } |
| 133 | virtual bool Send(const DataBuffer& buffer); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 134 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 135 | // rtc::MessageHandler override. |
| 136 | virtual void OnMessage(rtc::Message* msg); |
wu@webrtc.org | 07a6fbe | 2013-11-04 18:41:34 +0000 | [diff] [blame] | 137 | |
wu@webrtc.org | 91053e7 | 2013-08-10 07:18:04 +0000 | [diff] [blame] | 138 | // Called when the channel's ready to use. That can happen when the |
| 139 | // underlying DataMediaChannel becomes ready, or when this channel is a new |
| 140 | // stream on an existing DataMediaChannel, and we've finished negotiation. |
| 141 | void OnChannelReady(bool writable); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 142 | |
| 143 | // Sigslots from cricket::DataChannel |
| 144 | void OnDataReceived(cricket::DataChannel* channel, |
| 145 | const cricket::ReceiveDataParams& params, |
jbauch | eec21bd | 2016-03-20 06:15:43 -0700 | [diff] [blame] | 146 | const rtc::CopyOnWriteBuffer& payload); |
deadbeef | ab9b2d1 | 2015-10-14 11:33:11 -0700 | [diff] [blame] | 147 | void OnStreamClosedRemotely(uint32_t sid); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 148 | |
wu@webrtc.org | cecfd18 | 2013-10-30 05:18:12 +0000 | [diff] [blame] | 149 | // The remote peer request that this channel should be closed. |
| 150 | void RemotePeerRequestClose(); |
| 151 | |
| 152 | // The following methods are for SCTP only. |
| 153 | |
jiayl@webrtc.org | b43c99d | 2014-06-20 17:11:14 +0000 | [diff] [blame] | 154 | // Sets the SCTP sid and adds to transport layer if not set yet. Should only |
| 155 | // be called once. |
wu@webrtc.org | cecfd18 | 2013-10-30 05:18:12 +0000 | [diff] [blame] | 156 | void SetSctpSid(int sid); |
| 157 | // Called when the transport channel is created. |
deadbeef | ab9b2d1 | 2015-10-14 11:33:11 -0700 | [diff] [blame] | 158 | // Only needs to be called for SCTP data channels. |
wu@webrtc.org | cecfd18 | 2013-10-30 05:18:12 +0000 | [diff] [blame] | 159 | void OnTransportChannelCreated(); |
deadbeef | ab9b2d1 | 2015-10-14 11:33:11 -0700 | [diff] [blame] | 160 | // Called when the transport channel is destroyed. |
| 161 | void OnTransportChannelDestroyed(); |
wu@webrtc.org | cecfd18 | 2013-10-30 05:18:12 +0000 | [diff] [blame] | 162 | |
| 163 | // The following methods are for RTP only. |
| 164 | |
| 165 | // Set the SSRC this channel should use to send data on the |
| 166 | // underlying data engine. |send_ssrc| == 0 means that the channel is no |
| 167 | // longer part of the session negotiation. |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 168 | void SetSendSsrc(uint32_t send_ssrc); |
wu@webrtc.org | cecfd18 | 2013-10-30 05:18:12 +0000 | [diff] [blame] | 169 | // Set the SSRC this channel should use to receive data from the |
| 170 | // underlying data engine. |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 171 | void SetReceiveSsrc(uint32_t receive_ssrc); |
wu@webrtc.org | cecfd18 | 2013-10-30 05:18:12 +0000 | [diff] [blame] | 172 | |
sergeyu@chromium.org | a23f0ca | 2013-11-13 22:48:52 +0000 | [diff] [blame] | 173 | cricket::DataChannelType data_channel_type() const { |
| 174 | return data_channel_type_; |
| 175 | } |
| 176 | |
deadbeef | ab9b2d1 | 2015-10-14 11:33:11 -0700 | [diff] [blame] | 177 | // Emitted when state transitions to kClosed. |
| 178 | // In the case of SCTP channels, this signal can be used to tell when the |
| 179 | // channel's sid is free. |
| 180 | sigslot::signal1<DataChannel*> SignalClosed; |
| 181 | |
wu@webrtc.org | 7818752 | 2013-10-07 23:32:02 +0000 | [diff] [blame] | 182 | protected: |
| 183 | DataChannel(DataChannelProviderInterface* client, |
| 184 | cricket::DataChannelType dct, |
| 185 | const std::string& label); |
| 186 | virtual ~DataChannel(); |
| 187 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 188 | private: |
jiayl@webrtc.org | b43c99d | 2014-06-20 17:11:14 +0000 | [diff] [blame] | 189 | // A packet queue which tracks the total queued bytes. Queued packets are |
| 190 | // owned by this class. |
| 191 | class PacketQueue { |
| 192 | public: |
| 193 | PacketQueue(); |
| 194 | ~PacketQueue(); |
| 195 | |
| 196 | size_t byte_count() const { |
| 197 | return byte_count_; |
| 198 | } |
| 199 | |
| 200 | bool Empty() const; |
| 201 | |
| 202 | DataBuffer* Front(); |
| 203 | |
| 204 | void Pop(); |
| 205 | |
| 206 | void Push(DataBuffer* packet); |
| 207 | |
| 208 | void Clear(); |
| 209 | |
| 210 | void Swap(PacketQueue* other); |
| 211 | |
| 212 | private: |
| 213 | std::deque<DataBuffer*> packets_; |
| 214 | size_t byte_count_; |
| 215 | }; |
| 216 | |
Lally Singh | 5c6c6e0 | 2015-05-29 11:52:39 -0400 | [diff] [blame] | 217 | // The OPEN(_ACK) signaling state. |
| 218 | enum HandshakeState { |
| 219 | kHandshakeInit, |
| 220 | kHandshakeShouldSendOpen, |
| 221 | kHandshakeShouldSendAck, |
| 222 | kHandshakeWaitingForAck, |
| 223 | kHandshakeReady |
| 224 | }; |
| 225 | |
henrika@webrtc.org | aebb1ad | 2014-01-14 10:00:58 +0000 | [diff] [blame] | 226 | bool Init(const InternalDataChannelInit& config); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 227 | void DoClose(); |
| 228 | void UpdateState(); |
| 229 | void SetState(DataState state); |
Lally Singh | 5c6c6e0 | 2015-05-29 11:52:39 -0400 | [diff] [blame] | 230 | void DisconnectFromProvider(); |
jiayl@webrtc.org | b43c99d | 2014-06-20 17:11:14 +0000 | [diff] [blame] | 231 | |
wu@webrtc.org | d64719d | 2013-08-01 00:00:07 +0000 | [diff] [blame] | 232 | void DeliverQueuedReceivedData(); |
jiayl@webrtc.org | b43c99d | 2014-06-20 17:11:14 +0000 | [diff] [blame] | 233 | |
| 234 | void SendQueuedDataMessages(); |
jiayl@webrtc.org | 6ca6190 | 2014-11-12 17:28:40 +0000 | [diff] [blame] | 235 | bool SendDataMessage(const DataBuffer& buffer, bool queue_if_blocked); |
jiayl@webrtc.org | b43c99d | 2014-06-20 17:11:14 +0000 | [diff] [blame] | 236 | bool QueueSendDataMessage(const DataBuffer& buffer); |
| 237 | |
| 238 | void SendQueuedControlMessages(); |
jbauch | eec21bd | 2016-03-20 06:15:43 -0700 | [diff] [blame] | 239 | void QueueControlMessage(const rtc::CopyOnWriteBuffer& buffer); |
| 240 | bool SendControlMessage(const rtc::CopyOnWriteBuffer& buffer); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 241 | |
| 242 | std::string label_; |
henrika@webrtc.org | aebb1ad | 2014-01-14 10:00:58 +0000 | [diff] [blame] | 243 | InternalDataChannelInit config_; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 244 | DataChannelObserver* observer_; |
| 245 | DataState state_; |
henrika@webrtc.org | 44461fa | 2014-01-13 09:35:02 +0000 | [diff] [blame] | 246 | cricket::DataChannelType data_channel_type_; |
| 247 | DataChannelProviderInterface* provider_; |
Lally Singh | 5c6c6e0 | 2015-05-29 11:52:39 -0400 | [diff] [blame] | 248 | HandshakeState handshake_state_; |
henrika@webrtc.org | aebb1ad | 2014-01-14 10:00:58 +0000 | [diff] [blame] | 249 | bool connected_to_provider_; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 250 | bool send_ssrc_set_; |
henrika@webrtc.org | 44461fa | 2014-01-13 09:35:02 +0000 | [diff] [blame] | 251 | bool receive_ssrc_set_; |
Lally Singh | 5c6c6e0 | 2015-05-29 11:52:39 -0400 | [diff] [blame] | 252 | bool writable_; |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 253 | uint32_t send_ssrc_; |
| 254 | uint32_t receive_ssrc_; |
wu@webrtc.org | 91053e7 | 2013-08-10 07:18:04 +0000 | [diff] [blame] | 255 | // Control messages that always have to get sent out before any queued |
| 256 | // data. |
jiayl@webrtc.org | b43c99d | 2014-06-20 17:11:14 +0000 | [diff] [blame] | 257 | PacketQueue queued_control_data_; |
| 258 | PacketQueue queued_received_data_; |
| 259 | PacketQueue queued_send_data_; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 260 | }; |
| 261 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 262 | // Define proxy for DataChannelInterface. |
nisse | 72c8d2b | 2016-04-15 03:49:07 -0700 | [diff] [blame] | 263 | BEGIN_SIGNALING_PROXY_MAP(DataChannel) |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 264 | PROXY_METHOD1(void, RegisterObserver, DataChannelObserver*) |
| 265 | PROXY_METHOD0(void, UnregisterObserver) |
| 266 | PROXY_CONSTMETHOD0(std::string, label) |
| 267 | PROXY_CONSTMETHOD0(bool, reliable) |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 268 | PROXY_CONSTMETHOD0(bool, ordered) |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 269 | PROXY_CONSTMETHOD0(uint16_t, maxRetransmitTime) |
| 270 | PROXY_CONSTMETHOD0(uint16_t, maxRetransmits) |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 271 | PROXY_CONSTMETHOD0(std::string, protocol) |
| 272 | PROXY_CONSTMETHOD0(bool, negotiated) |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 273 | PROXY_CONSTMETHOD0(int, id) |
| 274 | PROXY_CONSTMETHOD0(DataState, state) |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 275 | PROXY_CONSTMETHOD0(uint64_t, buffered_amount) |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 276 | PROXY_METHOD0(void, Close) |
| 277 | PROXY_METHOD1(bool, Send, const DataBuffer&) |
nisse | 72c8d2b | 2016-04-15 03:49:07 -0700 | [diff] [blame] | 278 | END_SIGNALING_PROXY() |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 279 | |
| 280 | } // namespace webrtc |
| 281 | |
Henrik Kjellander | 15583c1 | 2016-02-10 10:53:12 +0100 | [diff] [blame] | 282 | #endif // WEBRTC_API_DATACHANNEL_H_ |