Mark all virtual overrides in the hierarchies of UdpTransportData and

UdpSocketWrapper as such.

This will make further changes to these classes safer by ensuring that the
compile breaks if the base class changes and not all overrides are fixed.

This also removes an unused function.

BUG=none
TEST=none
R=henrik.lundin@webrtc.org, henrikg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/23579004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7195 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrikg@webrtc.org 2014-09-16 15:29:02 +00:00
parent 80132e4d70
commit dae612ebf8
6 changed files with 52 additions and 55 deletions

View File

@ -33,14 +33,14 @@ public:
protected:
// Inherited from UdpTransportData
virtual void IncomingRTPPacket(const int8_t* incomingRtpPacket,
const int32_t rtpPacketLength,
const int8_t* fromIP,
const uint16_t fromPort);
const int32_t rtpPacketLength,
const int8_t* fromIP,
const uint16_t fromPort) OVERRIDE;
virtual void IncomingRTCPPacket(const int8_t* incomingRtcpPacket,
const int32_t rtcpPacketLength,
const int8_t* fromIP,
const uint16_t fromPort);
const int32_t rtcpPacketLength,
const int8_t* fromIP,
const uint16_t fromPort) OVERRIDE;
private:
RtpRtcp *_rtpMod;

View File

@ -71,12 +71,15 @@ public:
bool timeOutTriggered () { return (_timeOut); };
// Inherited from RtpFeedback
virtual int32_t OnInitializeDecoder(const int32_t id,
const int8_t payloadType,
const int8_t payloadName[RTP_PAYLOAD_NAME_SIZE],
const uint32_t frequency,
const uint8_t channels,
const uint32_t rate) { return(0);};
virtual int32_t OnInitializeDecoder(
const int32_t id,
const int8_t payloadType,
const int8_t payloadName[RTP_PAYLOAD_NAME_SIZE],
const uint32_t frequency,
const uint8_t channels,
const uint32_t rate) OVERRIDE {
return 0;
}
virtual void OnPacketTimeout(const int32_t id);
@ -86,31 +89,31 @@ public:
virtual void OnPeriodicDeadOrAlive(const int32_t id,
const RTPAliveType alive) {};
virtual void OnIncomingSSRCChanged( const int32_t id,
const uint32_t SSRC) {};
virtual void OnIncomingSSRCChanged(const int32_t id,
const uint32_t SSRC) OVERRIDE {}
virtual void OnIncomingCSRCChanged( const int32_t id,
const uint32_t CSRC,
const bool added) {};
virtual void OnIncomingCSRCChanged(const int32_t id,
const uint32_t CSRC,
const bool added) OVERRIDE {}
// Inherited from RtpData
virtual int32_t OnReceivedPayloadData(const uint8_t* payloadData,
const uint16_t payloadSize,
const webrtc::WebRtcRTPHeader* rtpHeader);
virtual int32_t OnReceivedPayloadData(
const uint8_t* payloadData,
const uint16_t payloadSize,
const webrtc::WebRtcRTPHeader* rtpHeader) OVERRIDE;
// Inherited from UdpTransportData
virtual void IncomingRTPPacket(const int8_t* incomingRtpPacket,
const int32_t rtpPacketLength,
const int8_t* fromIP,
const uint16_t fromPort);
const int32_t rtpPacketLength,
const int8_t* fromIP,
const uint16_t fromPort) OVERRIDE;
virtual void IncomingRTCPPacket(const int8_t* incomingRtcpPacket,
const int32_t rtcpPacketLength,
const int8_t* fromIP,
const uint16_t fromPort);
const int32_t rtcpPacketLength,
const int8_t* fromIP,
const uint16_t fromPort) OVERRIDE;

View File

@ -42,36 +42,37 @@ public:
bool ipV6Enable = false, bool disableGQOS = false);
virtual ~UdpSocket2Windows();
virtual int32_t ChangeUniqueId(const int32_t id);
virtual int32_t ChangeUniqueId(const int32_t id) OVERRIDE;
virtual bool ValidHandle();
virtual bool ValidHandle() OVERRIDE;
virtual bool SetCallback(CallbackObj, IncomingSocketCallback);
virtual bool SetCallback(CallbackObj, IncomingSocketCallback) OVERRIDE;
virtual bool Bind(const SocketAddress& name);
virtual bool Bind(const SocketAddress& name) OVERRIDE;
virtual bool SetSockopt(int32_t level, int32_t optname,
const int8_t* optval, int32_t optlen);
const int8_t* optval, int32_t optlen) OVERRIDE;
virtual bool StartReceiving(const uint32_t receiveBuffers);
virtual inline bool StartReceiving() {return StartReceiving(8);}
virtual bool StopReceiving();
virtual bool StartReceiving(const uint32_t receiveBuffers) OVERRIDE;
virtual inline bool StartReceiving() OVERRIDE {return StartReceiving(8);}
virtual bool StopReceiving() OVERRIDE;
virtual int32_t SendTo(const int8_t* buf, int32_t len,
const SocketAddress& to);
const SocketAddress& to) OVERRIDE;
virtual void CloseBlocking();
virtual void CloseBlocking() OVERRIDE;
SOCKET GetFd() { return _socket;}
virtual SOCKET GetFd() { return _socket;}
virtual bool SetQos(int32_t serviceType, int32_t tokenRate,
int32_t bucketSize, int32_t peekBandwith,
int32_t minPolicedSize, int32_t maxSduSize,
const SocketAddress &stRemName,
int32_t overrideDSCP = 0);
int32_t overrideDSCP = 0) OVERRIDE;
virtual int32_t SetTOS(const int32_t serviceType);
virtual int32_t SetPCP(const int32_t pcp);
virtual int32_t SetTOS(const int32_t serviceType) OVERRIDE;
virtual int32_t SetPCP(const int32_t pcp) OVERRIDE;
virtual uint32_t ReceiveBuffers(){return _receiveBuffers.Value();}
virtual uint32_t ReceiveBuffers() OVERRIDE {return _receiveBuffers.Value();}
protected:
void IOCompleted(PerIoContext* pIOContext, uint32_t ioSize, uint32_t error);

View File

@ -33,7 +33,6 @@ UdpSocketPosix::UdpSocketPosix(const int32_t id, UdpSocketManager* mgr,
"UdpSocketPosix::UdpSocketPosix()");
_wantsIncoming = false;
_error = 0;
_mgr = mgr;
_id = id;
@ -129,9 +128,8 @@ bool UdpSocketPosix::SetSockopt(int32_t level, int32_t optname,
return true;
}
_error = errno;
WEBRTC_TRACE(kTraceError, kTraceTransport, _id,
"UdpSocketPosix::SetSockopt(), error:%d", _error);
"UdpSocketPosix::SetSockopt(), error:%d", errno);
return false;
}
@ -151,9 +149,8 @@ bool UdpSocketPosix::Bind(const SocketAddress& name)
{
return true;
}
_error = errno;
WEBRTC_TRACE(kTraceError, kTraceTransport, _id,
"UdpSocketPosix::Bind() error: %d",_error);
"UdpSocketPosix::Bind() error: %d", errno);
return false;
}
@ -165,16 +162,14 @@ int32_t UdpSocketPosix::SendTo(const int8_t* buf, int32_t len,
reinterpret_cast<const sockaddr*>(&to), size);
if(retVal == SOCKET_ERROR)
{
_error = errno;
WEBRTC_TRACE(kTraceError, kTraceTransport, _id,
"UdpSocketPosix::SendTo() error: %d", _error);
"UdpSocketPosix::SendTo() error: %d", errno);
}
return retVal;
}
SOCKET UdpSocketPosix::GetFd() { return _socket; }
int32_t UdpSocketPosix::GetError() { return _error; }
bool UdpSocketPosix::ValidHandle()
{

View File

@ -52,8 +52,7 @@ public:
// TODO (hellner): make destructor protected.
virtual void CloseBlocking() OVERRIDE;
virtual SOCKET GetFd();
virtual int32_t GetError();
SOCKET GetFd();
virtual bool ValidHandle() OVERRIDE;
@ -76,7 +75,6 @@ private:
int32_t _id;
IncomingSocketCallback _incomingCb;
CallbackObj _obj;
int32_t _error;
SOCKET _socket;
UdpSocketManager* _mgr;

View File

@ -60,8 +60,8 @@ public:
virtual int32_t InitializeSourcePorts(
const uint16_t rtpPort,
const uint16_t rtcpPort = 0) OVERRIDE;
virtual int32_t SourcePorts(uint16_t& rtpPort, uint16_t& rtcpPort) const
OVERRIDE;
virtual int32_t SourcePorts(uint16_t& rtpPort,
uint16_t& rtcpPort) const OVERRIDE;
virtual int32_t ReceiveSocketInformation(
char ipAddr[kIpAddressVersion6Length],
uint16_t& rtpPort,