diff options
Diffstat (limited to 'chromium/third_party/libjingle/source/talk/p2p/base/transport.h')
-rw-r--r-- | chromium/third_party/libjingle/source/talk/p2p/base/transport.h | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/chromium/third_party/libjingle/source/talk/p2p/base/transport.h b/chromium/third_party/libjingle/source/talk/p2p/base/transport.h index f9e9d887457..7f460d1127b 100644 --- a/chromium/third_party/libjingle/source/talk/p2p/base/transport.h +++ b/chromium/third_party/libjingle/source/talk/p2p/base/transport.h @@ -187,6 +187,8 @@ struct TransportStats { TransportChannelStatsList channel_stats; }; +bool BadTransportDescription(const std::string& desc, std::string* err_desc); + class Transport : public talk_base::MessageHandler, public sigslot::has_slots<> { public: @@ -234,6 +236,8 @@ class Transport : public talk_base::MessageHandler, } sigslot::signal1<Transport*> SignalReadableState; sigslot::signal1<Transport*> SignalWritableState; + sigslot::signal1<Transport*> SignalCompleted; + sigslot::signal1<Transport*> SignalFailed; // Returns whether the client has requested the channels to connect. bool connect_requested() const { return connect_requested_; } @@ -270,11 +274,13 @@ class Transport : public talk_base::MessageHandler, // Set the local TransportDescription to be used by TransportChannels. // This should be called before ConnectChannels(). bool SetLocalTransportDescription(const TransportDescription& description, - ContentAction action); + ContentAction action, + std::string* error_desc); // Set the remote TransportDescription to be used by TransportChannels. bool SetRemoteTransportDescription(const TransportDescription& description, - ContentAction action); + ContentAction action, + std::string* error_desc); // Tells all current and future channels to start connecting. When the first // channel begins connecting, the following signal is raised. @@ -362,25 +368,27 @@ class Transport : public talk_base::MessageHandler, // Pushes down the transport parameters from the local description, such // as the ICE ufrag and pwd. // Derived classes can override, but must call the base as well. - virtual bool ApplyLocalTransportDescription_w(TransportChannelImpl* - channel); + virtual bool ApplyLocalTransportDescription_w(TransportChannelImpl* channel, + std::string* error_desc); // Pushes down remote ice credentials from the remote description to the // transport channel. - virtual bool ApplyRemoteTransportDescription_w(TransportChannelImpl* ch); + virtual bool ApplyRemoteTransportDescription_w(TransportChannelImpl* ch, + std::string* error_desc); // Negotiates the transport parameters based on the current local and remote // transport description, such at the version of ICE to use, and whether DTLS // should be activated. // Derived classes can negotiate their specific parameters here, but must call // the base as well. - virtual bool NegotiateTransportDescription_w(ContentAction local_role); + virtual bool NegotiateTransportDescription_w(ContentAction local_role, + std::string* error_desc); // Pushes down the transport parameters obtained via negotiation. // Derived classes can set their specific parameters here, but must call the // base as well. virtual bool ApplyNegotiatedTransportDescription_w( - TransportChannelImpl* channel); + TransportChannelImpl* channel, std::string* error_desc); virtual bool GetSslRole_w(talk_base::SSLRole* ssl_role) const { return false; @@ -435,6 +443,8 @@ class Transport : public talk_base::MessageHandler, void OnChannelCandidatesAllocationDone(TransportChannelImpl* channel); // Called when there is ICE role change. void OnRoleConflict(TransportChannelImpl* channel); + // Called when the channel removes a connection. + void OnChannelConnectionRemoved(TransportChannelImpl* channel); // Dispatches messages to the appropriate handler (below). void OnMessage(talk_base::Message* msg); @@ -468,12 +478,16 @@ class Transport : public talk_base::MessageHandler, void SetIceRole_w(IceRole role); void SetRemoteIceMode_w(IceMode mode); bool SetLocalTransportDescription_w(const TransportDescription& desc, - ContentAction action); + ContentAction action, + std::string* error_desc); bool SetRemoteTransportDescription_w(const TransportDescription& desc, - ContentAction action); + ContentAction action, + std::string* error_desc); bool GetStats_w(TransportStats* infos); bool GetRemoteCertificate_w(talk_base::SSLCertificate** cert); + // Sends SignalCompleted if we are now in that state. + void MaybeCompleted_w(); talk_base::Thread* signaling_thread_; talk_base::Thread* worker_thread_; |