Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: webrtc/p2p/base/dtlstransportchannel.h

Issue 1414363002: Exposing DTLS transport state from TransportChannel. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing Windows compiler warning. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/p2p/base/dtlstransportchannel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/dtlstransportchannel.h
diff --git a/webrtc/p2p/base/dtlstransportchannel.h b/webrtc/p2p/base/dtlstransportchannel.h
index b445c69efa96fb1091ea740be6dfaba6826e535e..41e081b7fea360b38a9a689ab15a626d544b8b22 100644
--- a/webrtc/p2p/base/dtlstransportchannel.h
+++ b/webrtc/p2p/base/dtlstransportchannel.h
@@ -81,15 +81,6 @@ class StreamInterfaceChannel : public rtc::StreamInterface {
// which translates it into packet writes on channel_.
class DtlsTransportChannelWrapper : public TransportChannelImpl {
public:
- enum State {
- STATE_NONE, // No state or rejected.
- STATE_OFFERED, // Our identity has been set.
- STATE_ACCEPTED, // The other side sent a fingerprint.
- STATE_STARTED, // We are negotiating.
- STATE_OPEN, // Negotiation complete.
- STATE_CLOSED // Connection closed.
- };
-
// The parameters here are:
// transport -- the DtlsTransport that created us
// channel -- the TransportChannel we are wrapping
@@ -106,7 +97,10 @@ class DtlsTransportChannelWrapper : public TransportChannelImpl {
bool SetRemoteFingerprint(const std::string& digest_alg,
const uint8_t* digest,
size_t digest_len) override;
- bool IsDtlsActive() const override { return dtls_state_ != STATE_NONE; }
+
+ // Returns false if no local certificate was set, or if the peer doesn't
+ // support DTLS.
+ bool IsDtlsActive() const override { return dtls_active_; }
// Called to send a packet (via DTLS, if turned on).
int SendPacket(const char* data,
@@ -230,7 +224,7 @@ class DtlsTransportChannelWrapper : public TransportChannelImpl {
rtc::scoped_ptr<rtc::SSLStreamAdapter> dtls_; // The DTLS stream
StreamInterfaceChannel* downward_; // Wrapper for channel_, owned by dtls_.
std::vector<std::string> srtp_ciphers_; // SRTP ciphers to use with DTLS.
- State dtls_state_;
+ bool dtls_active_ = false;
rtc::scoped_refptr<rtc::RTCCertificate> local_certificate_;
rtc::SSLRole ssl_role_;
rtc::SSLProtocolVersion ssl_max_version_;
« no previous file with comments | « no previous file | webrtc/p2p/base/dtlstransportchannel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698