diff --git a/p2p/base/connection.h b/p2p/base/connection.h index 7c468bcff8..88e930c216 100644 --- a/p2p/base/connection.h +++ b/p2p/base/connection.h @@ -65,7 +65,7 @@ class ConnectionRequest : public StunRequest { int resend_delay() override; private: - Connection* connection_; + Connection* const connection_; }; // Represents a communication link between a port on the local client and a diff --git a/p2p/base/stun_request.cc b/p2p/base/stun_request.cc index 44376ced95..d6210fc2dc 100644 --- a/p2p/base/stun_request.cc +++ b/p2p/base/stun_request.cc @@ -174,7 +174,8 @@ bool StunRequestManager::CheckResponse(const char* data, size_t size) { } StunRequest::StunRequest() - : count_(0), + : rtc::MessageHandler(false), + count_(0), timeout_(false), manager_(0), msg_(new StunMessage()), @@ -183,7 +184,12 @@ StunRequest::StunRequest() } StunRequest::StunRequest(StunMessage* request) - : count_(0), timeout_(false), manager_(0), msg_(request), tstamp_(0) { + : rtc::MessageHandler(false), + count_(0), + timeout_(false), + manager_(0), + msg_(request), + tstamp_(0) { msg_->SetTransactionID(rtc::CreateRandomString(kStunTransactionIdLength)); } diff --git a/p2p/base/stun_request.h b/p2p/base/stun_request.h index 1756904615..39f928eaf4 100644 --- a/p2p/base/stun_request.h +++ b/p2p/base/stun_request.h @@ -76,7 +76,7 @@ class StunRequestManager { private: typedef std::map RequestMap; - rtc::Thread* thread_; + rtc::Thread* const thread_; RequestMap requests_; std::string origin_; @@ -85,7 +85,7 @@ class StunRequestManager { // Represents an individual request to be sent. The STUN message can either be // constructed beforehand or built on demand. -class StunRequest : public rtc::MessageHandlerAutoCleanup { +class StunRequest : public rtc::MessageHandler { public: StunRequest(); explicit StunRequest(StunMessage* request);