| Index: talk/app/webrtc/datachannel.h
|
| diff --git a/talk/app/webrtc/datachannel.h b/talk/app/webrtc/datachannel.h
|
| index 2713ae3b553ed7a79f32de9f34a214c3396e1877..4506f71b146c71f95ab22a04fbcffca97b43bb32 100644
|
| --- a/talk/app/webrtc/datachannel.h
|
| +++ b/talk/app/webrtc/datachannel.h
|
| @@ -29,7 +29,6 @@
|
| #define TALK_APP_WEBRTC_DATACHANNEL_H_
|
|
|
| #include <deque>
|
| -#include <set>
|
| #include <string>
|
|
|
| #include "talk/app/webrtc/datachannelinterface.h"
|
| @@ -82,28 +81,6 @@
|
| }
|
|
|
| OpenHandshakeRole open_handshake_role;
|
| -};
|
| -
|
| -// Helper class to allocate unique IDs for SCTP DataChannels
|
| -class SctpSidAllocator {
|
| - public:
|
| - // Gets the first unused odd/even id based on the DTLS role. If |role| is
|
| - // SSL_CLIENT, the allocated id starts from 0 and takes even numbers;
|
| - // otherwise, the id starts from 1 and takes odd numbers.
|
| - // Returns false if no id can be allocated.
|
| - bool AllocateSid(rtc::SSLRole role, int* sid);
|
| -
|
| - // Attempts to reserve a specific sid. Returns false if it's unavailable.
|
| - bool ReserveSid(int sid);
|
| -
|
| - // Indicates that |sid| isn't in use any more, and is thus available again.
|
| - void ReleaseSid(int sid);
|
| -
|
| - private:
|
| - // Checks if |sid| is available to be assigned to a new SCTP data channel.
|
| - bool IsSidAvailable(int sid) const;
|
| -
|
| - std::set<int> used_sids_;
|
| };
|
|
|
| // DataChannel is a an implementation of the DataChannelInterface based on
|
| @@ -152,6 +129,9 @@
|
| // rtc::MessageHandler override.
|
| virtual void OnMessage(rtc::Message* msg);
|
|
|
| + // Called if the underlying data engine is closing.
|
| + void OnDataEngineClose();
|
| +
|
| // Called when the channel's ready to use. That can happen when the
|
| // underlying DataMediaChannel becomes ready, or when this channel is a new
|
| // stream on an existing DataMediaChannel, and we've finished negotiation.
|
| @@ -161,7 +141,6 @@
|
| void OnDataReceived(cricket::DataChannel* channel,
|
| const cricket::ReceiveDataParams& params,
|
| const rtc::Buffer& payload);
|
| - void OnStreamClosedRemotely(uint32_t sid);
|
|
|
| // The remote peer request that this channel should be closed.
|
| void RemotePeerRequestClose();
|
| @@ -172,10 +151,7 @@
|
| // be called once.
|
| void SetSctpSid(int sid);
|
| // Called when the transport channel is created.
|
| - // Only needs to be called for SCTP data channels.
|
| void OnTransportChannelCreated();
|
| - // Called when the transport channel is destroyed.
|
| - void OnTransportChannelDestroyed();
|
|
|
| // The following methods are for RTP only.
|
|
|
| @@ -190,11 +166,6 @@
|
| cricket::DataChannelType data_channel_type() const {
|
| return data_channel_type_;
|
| }
|
| -
|
| - // Emitted when state transitions to kClosed.
|
| - // In the case of SCTP channels, this signal can be used to tell when the
|
| - // channel's sid is free.
|
| - sigslot::signal1<DataChannel*> SignalClosed;
|
|
|
| protected:
|
| DataChannel(DataChannelProviderInterface* client,
|
| @@ -276,6 +247,16 @@
|
| PacketQueue queued_send_data_;
|
| };
|
|
|
| +class DataChannelFactory {
|
| + public:
|
| + virtual rtc::scoped_refptr<DataChannel> CreateDataChannel(
|
| + const std::string& label,
|
| + const InternalDataChannelInit* config) = 0;
|
| +
|
| + protected:
|
| + virtual ~DataChannelFactory() {}
|
| +};
|
| +
|
| // Define proxy for DataChannelInterface.
|
| BEGIN_PROXY_MAP(DataChannel)
|
| PROXY_METHOD1(void, RegisterObserver, DataChannelObserver*)
|
|
|