| Index: webrtc/p2p/base/dtlstransport.h
|
| diff --git a/webrtc/p2p/base/dtlstransport.h b/webrtc/p2p/base/dtlstransport.h
|
| index 27cece49d04ea9cfe328ad0084eca36a7b967f93..6e7720b3e0c9cd5e2150e1e3f2ed3589ee67f186 100644
|
| --- a/webrtc/p2p/base/dtlstransport.h
|
| +++ b/webrtc/p2p/base/dtlstransport.h
|
| @@ -23,27 +23,25 @@ namespace cricket {
|
| class PortAllocator;
|
|
|
| // Base should be a descendant of cricket::Transport
|
| +//
|
| +// Everything in this class should be called on the worker thread.
|
| template<class Base>
|
| class DtlsTransport : public Base {
|
| public:
|
| - DtlsTransport(rtc::Thread* signaling_thread,
|
| - rtc::Thread* worker_thread,
|
| - const std::string& content_name,
|
| + DtlsTransport(const std::string& content_name,
|
| PortAllocator* allocator,
|
| rtc::SSLIdentity* identity)
|
| - : Base(signaling_thread, worker_thread, content_name, allocator),
|
| + : Base(content_name, allocator),
|
| identity_(identity),
|
| secure_role_(rtc::SSL_CLIENT),
|
| - ssl_max_version_(rtc::SSL_PROTOCOL_DTLS_10) {
|
| - }
|
| + ssl_max_version_(rtc::SSL_PROTOCOL_DTLS_10) {}
|
|
|
| ~DtlsTransport() {
|
| Base::DestroyAllChannels();
|
| }
|
| - virtual void SetIdentity_w(rtc::SSLIdentity* identity) {
|
| - identity_ = identity;
|
| - }
|
| - virtual bool GetIdentity_w(rtc::SSLIdentity** identity) {
|
| +
|
| + virtual void SetIdentity(rtc::SSLIdentity* identity) { identity_ = identity; }
|
| + virtual bool GetIdentity(rtc::SSLIdentity** identity) {
|
| if (!identity_)
|
| return false;
|
|
|
| @@ -51,13 +49,13 @@ class DtlsTransport : public Base {
|
| return true;
|
| }
|
|
|
| - virtual bool SetSslMaxProtocolVersion_w(rtc::SSLProtocolVersion version) {
|
| + virtual bool SetSslMaxProtocolVersion(rtc::SSLProtocolVersion version) {
|
| ssl_max_version_ = version;
|
| return true;
|
| }
|
|
|
| - virtual bool ApplyLocalTransportDescription_w(TransportChannelImpl* channel,
|
| - std::string* error_desc) {
|
| + virtual bool ApplyLocalTransportDescription(TransportChannelImpl* channel,
|
| + std::string* error_desc) {
|
| rtc::SSLFingerprint* local_fp =
|
| Base::local_description()->identity_fingerprint.get();
|
|
|
| @@ -90,11 +88,11 @@ class DtlsTransport : public Base {
|
| }
|
|
|
| // Apply the description in the base class.
|
| - return Base::ApplyLocalTransportDescription_w(channel, error_desc);
|
| + return Base::ApplyLocalTransportDescription(channel, error_desc);
|
| }
|
|
|
| - virtual bool NegotiateTransportDescription_w(ContentAction local_role,
|
| - std::string* error_desc) {
|
| + virtual bool NegotiateTransportDescription(ContentAction local_role,
|
| + std::string* error_desc) {
|
| if (!Base::local_description() || !Base::remote_description()) {
|
| const std::string msg = "Local and Remote description must be set before "
|
| "transport descriptions are negotiated";
|
| @@ -191,7 +189,7 @@ class DtlsTransport : public Base {
|
| }
|
|
|
| // Now run the negotiation for the base class.
|
| - return Base::NegotiateTransportDescription_w(local_role, error_desc);
|
| + return Base::NegotiateTransportDescription(local_role, error_desc);
|
| }
|
|
|
| virtual DtlsTransportChannelWrapper* CreateTransportChannel(int component) {
|
| @@ -210,16 +208,14 @@ class DtlsTransport : public Base {
|
| Base::DestroyTransportChannel(base_channel);
|
| }
|
|
|
| - virtual bool GetSslRole_w(rtc::SSLRole* ssl_role) const {
|
| + virtual bool GetSslRole(rtc::SSLRole* ssl_role) const {
|
| ASSERT(ssl_role != NULL);
|
| *ssl_role = secure_role_;
|
| return true;
|
| }
|
|
|
| - private:
|
| - virtual bool ApplyNegotiatedTransportDescription_w(
|
| - TransportChannelImpl* channel,
|
| - std::string* error_desc) {
|
| + bool ApplyNegotiatedTransportDescription(TransportChannelImpl* channel,
|
| + std::string* error_desc) override {
|
| // Set ssl role. Role must be set before fingerprint is applied, which
|
| // initiates DTLS setup.
|
| if (!channel->SetSslRole(secure_role_)) {
|
| @@ -234,9 +230,10 @@ class DtlsTransport : public Base {
|
| return BadTransportDescription("Failed to apply remote fingerprint.",
|
| error_desc);
|
| }
|
| - return Base::ApplyNegotiatedTransportDescription_w(channel, error_desc);
|
| + return Base::ApplyNegotiatedTransportDescription(channel, error_desc);
|
| }
|
|
|
| + private:
|
| rtc::SSLIdentity* identity_;
|
| rtc::SSLRole secure_role_;
|
| rtc::SSLProtocolVersion ssl_max_version_;
|
|
|